UNPKG

@styleless-ui/react

Version:

Completely unstyled, headless and accessible React UI components.

37 lines (36 loc) 1.08 kB
import * as React from "react"; import type { MergeElementProps } from "../../typings"; interface OwnProps { /** * The content of the component. */ children?: React.ReactNode | ((ctx: { active: boolean; disabled: boolean; selected: boolean; }) => React.ReactNode); /** * The className applied to the component. */ className?: string | ((ctx: { active: boolean; disabled: boolean; selected: boolean; }) => string); /** * The value of the radio. */ value: string; /** * If `true`, the radio will be disabled. * @default false */ disabled?: boolean; /** * The Callback is fired when the item is selected. */ onSelect?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void; } export type Props = Omit<MergeElementProps<"div", OwnProps>, "defaultValue" | "defaultChecked">; declare const MenuRadioItem: (props: Props, ref: React.Ref<HTMLDivElement>) => JSX.Element; export default MenuRadioItem;