UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

36 lines (35 loc) 1.75 kB
import { BoxProps, CompoundStylesApiProps, ElementProps, Factory, MantineColor } from '../../../core'; export type MenuRadioItemStylesNames = 'item' | 'itemLabel' | 'itemSection' | 'itemIndicator'; export interface MenuRadioItemProps extends BoxProps, CompoundStylesApiProps<MenuRadioItemFactory>, ElementProps<'button', 'color' | 'onChange' | 'value'> { 'data-disabled'?: boolean; /** Item label */ children?: React.ReactNode; /** Key of `theme.colors` or any valid CSS color */ color?: MantineColor; /** If set, closes the menu when this item is clicked. By default, radio items do not close the menu. */ closeMenuOnClick?: boolean; /** Section displayed at the end of the label */ rightSection?: React.ReactNode; /** Sets disabled attribute, applies disabled styles */ disabled?: boolean; /** Value of the radio item. Used by the parent `Menu.RadioGroup` to determine which item is selected. */ value: string; /** Overrides selected state determined by the parent `Menu.RadioGroup`. */ checked?: boolean; /** Called with the item value when item is selected. Overrides `onChange` of the parent `Menu.RadioGroup`. */ onChange?: (value: string) => void; /** Replaces the default radio indicator rendered when the item is selected. Overrides `checkIcon` set on `Menu`. */ checkIcon?: React.ReactNode; } export type MenuRadioItemFactory = Factory<{ props: MenuRadioItemProps; ref: HTMLButtonElement; stylesNames: MenuRadioItemStylesNames; compound: true; }>; export declare const MenuRadioItem: import("../../..").MantineComponent<{ props: MenuRadioItemProps; ref: HTMLButtonElement; stylesNames: MenuRadioItemStylesNames; compound: true; }>;