@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
47 lines • 1.53 kB
TypeScript
import * as React from 'react';
import type { BaseUIComponentProps, NonNativeButtonProps } from "../../utils/types.js";
/**
* An individual item in the list.
* Renders a `<div>` element.
*/
export declare const ComboboxItem: React.NamedExoticComponent<ComboboxItemProps & React.RefAttributes<HTMLDivElement>>;
export interface ComboboxItemState {
/**
* Whether the item should ignore user interaction.
*/
disabled: boolean;
/**
* Whether the item is selected.
*/
selected: boolean;
/**
* Whether the item is highlighted.
*/
highlighted: boolean;
}
export interface ComboboxItemProps extends NonNativeButtonProps, Omit<BaseUIComponentProps<'div', ComboboxItem.State>, 'id'> {
children?: React.ReactNode;
/**
* An optional click handler for the item when selected.
* It fires when clicking the item with the pointer, as well as when pressing `Enter` with the keyboard if the item is highlighted when the `Input` or `List` element has focus.
*/
onClick?: React.MouseEventHandler<HTMLElement>;
/**
* The index of the item in the list. Improves performance when specified by avoiding the need to calculate the index automatically from the DOM.
*/
index?: number;
/**
* A unique value that identifies this item.
* @default null
*/
value?: any;
/**
* Whether the component should ignore user interaction.
* @default false
*/
disabled?: boolean;
}
export declare namespace ComboboxItem {
type State = ComboboxItemState;
type Props = ComboboxItemProps;
}