@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.
56 lines • 1.6 kB
TypeScript
import * as React from 'react';
import type { BaseUIComponentProps, NonNativeButtonProps } from "../../utils/types.js";
/**
* A menu item that works like a radio button in a given group.
* Renders a `<div>` element.
*
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
*/
export declare const MenuRadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<Element>>;
export type MenuRadioItemState = {
/**
* Whether the radio item should ignore user interaction.
*/
disabled: boolean;
/**
* Whether the radio item is currently highlighted.
*/
highlighted: boolean;
/**
* Whether the radio item is currently selected.
*/
checked: boolean;
};
export interface MenuRadioItemProps extends NonNativeButtonProps, BaseUIComponentProps<'div', MenuRadioItem.State> {
/**
* Value of the radio item.
* This is the value that will be set in the MenuRadioGroup when the item is selected.
*/
value: any;
/**
* The click handler for the menu item.
*/
onClick?: React.MouseEventHandler<HTMLElement>;
/**
* Whether the component should ignore user interaction.
* @default false
*/
disabled?: boolean;
/**
* Overrides the text label to use when the item is matched during keyboard text navigation.
*/
label?: string;
/**
* @ignore
*/
id?: string;
/**
* Whether to close the menu when the item is clicked.
* @default false
*/
closeOnClick?: boolean;
}
export declare namespace MenuRadioItem {
type State = MenuRadioItemState;
type Props = MenuRadioItemProps;
}