@yamada-ui/radio
Version:
Yamada UI radio component
31 lines (28 loc) • 1.24 kB
TypeScript
import { ThemeProps, ComponentArgs } from '@yamada-ui/core';
import { FormControlOptions } from '@yamada-ui/form-control';
import { FlexProps } from '@yamada-ui/layouts';
import { RefAttributes, ReactElement } from 'react';
import { RadioProps } from './radio.js';
import { UseRadioGroupProps } from './use-radio-group.js';
import './use-radio.js';
import '@yamada-ui/utils';
type RadioItem<Y extends number | string = string> = RadioProps<Y>;
interface RadioGroupSharedProps<Y extends number | string = string> extends Omit<FlexProps, "defaultValue" | "onChange">, UseRadioGroupProps<Y>, FormControlOptions {
}
interface RadioGroupProps<Y extends number | string = string> extends RadioGroupSharedProps<Y>, ThemeProps<"Radio"> {
/**
* If provided, generate radios based on items.
*
* @default '[]'
*/
items?: RadioItem<Y>[];
}
/**
* `RadioGroup` is a component that groups `Radio` components.
*
* @see Docs https://yamada-ui.com/components/forms/radio
*/
declare const RadioGroup: {
<Y extends number | string = string>(props: RadioGroupProps<Y> & RefAttributes<HTMLDivElement>): ReactElement;
} & ComponentArgs;
export { RadioGroup, type RadioGroupProps, type RadioGroupSharedProps, type RadioItem };