@payfit/unity-components
Version:
24 lines (23 loc) • 1.09 kB
TypeScript
import { ReactNode } from 'react';
import { ListBoxItemProps } from 'react-aria-components/ListBox';
/**
* Props for the MultiSelectOption component.
* @template T - The type of the value this option represents (string or number).
*/
export interface MultiSelectOptionProps<T> extends Omit<ListBoxItemProps, 'children' | 'id' | 'value'> {
/** The value associated with this option. Must be unique within the MultiSelect */
value: T;
/** The content to display for this option */
children: ReactNode;
/** Whether the option is disabled. When true, the option cannot be selected */
isDisabled?: boolean;
/** Whether the option should receive focus when rendered. Use sparingly */
autoFocus?: boolean;
/** Additional text displayed below the option to provide more context */
helperText?: string;
/** Text used by search and typeahead when the visual content is complex */
textValue?: string;
}
export declare const MultiSelectOption: <T>(props: MultiSelectOptionProps<T> & {
ref?: React.ForwardedRef<HTMLDivElement>;
}) => React.JSX.Element;