@trail-ui/react
Version:
55 lines (52 loc) • 1.81 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { MenuItemVariantProps, SlotsToClasses, MenuItemSlots } from '@trail-ui/theme';
import { ReactNode } from 'react';
import { ListBoxItemProps as ListBoxItemProps$1 } from 'react-aria-components';
type ListBoxItemSelectedIconProps = {
/**
* The current icon, usually an checkmark icon.
*/
icon?: ReactNode;
/**
* The current selected status.
*/
isSelected?: boolean;
/**
* The current disabled status.
* @default false
*/
isDisabled?: boolean;
};
interface ListBoxItemProps extends ListBoxItemProps$1, MenuItemVariantProps {
/**
* The menu item subtitle.
*/
description?: ReactNode | string;
/**
* The menu item start content.
*/
startContent?: ReactNode;
/**
* The menu item end content.
*/
endContent?: ReactNode;
/**
* The menu item `selected` icon, it's usually an checkmark icon.
* If you pass a function, NextUI will expose the current selected icon and the selected status,
* In case you want to use a custom indicator or modify the current one.
*
* Important: The selected icon will be rendered only if the menu selection mode is different than `none`.
*/
selectedIcon?: ReactNode | ((props: ListBoxItemSelectedIconProps) => ReactNode) | null;
/**
* Classes object to style the listbox item and its children.
*/
classNames?: SlotsToClasses<MenuItemSlots>;
children: ReactNode;
/**
* Event gives the value of the current LIstBox item that has focus.
*/
onFocusChange?: (key: string) => void;
}
declare function ListBoxItem(props: ListBoxItemProps): react_jsx_runtime.JSX.Element;
export { ListBoxItem, ListBoxItemProps, ListBoxItemSelectedIconProps };