@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.
49 lines (48 loc) • 1.52 kB
TypeScript
import * as React from 'react';
import type { BaseUIComponentProps } from '../../utils/types.js';
/**
* Represents the radio button itself.
* Renders a `<button>` element and a hidden `<input>` beside.
*
* Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
*/
declare const RadioRoot: React.ForwardRefExoticComponent<RadioRoot.Props & React.RefAttributes<HTMLButtonElement>>;
declare namespace RadioRoot {
interface Props extends Omit<BaseUIComponentProps<'button', State>, 'value'> {
/**
* The unique identifying value of the radio in a group.
*/
value: unknown;
/**
* Whether the component should ignore user interaction.
* @default false
*/
disabled?: boolean;
/**
* Whether the user must choose a value before submitting a form.
* @default false
*/
required?: boolean;
/**
* Whether the user should be unable to select the radio button.
* @default false
*/
readOnly?: boolean;
}
interface State {
/**
* Whether the radio button is currently selected.
*/
checked: boolean;
disabled: boolean;
/**
* Whether the user should be unable to select the radio button.
*/
readOnly: boolean;
/**
* Whether the user must choose a value before submitting a form.
*/
required: boolean;
}
}
export { RadioRoot };