UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

35 lines (34 loc) 1.49 kB
import { HTMLProps, PropGetter } from "../../core/components/index.types.js"; import "../../core/index.js"; import { FieldProps } from "../field/field.js"; import * as react2693 from "react"; import { ChangeEvent } from "react"; //#region src/components/radio/use-radio-group.d.ts interface RadioGroupContext extends Omit<UseRadioGroupReturn, "getRootProps"> {} declare const RadioGroupContext: react2693.Context<RadioGroupContext | undefined>, useRadioGroupContext: () => RadioGroupContext | undefined; interface UseRadioGroupProps<Y extends string = string> extends Omit<HTMLProps, "defaultValue" | "onChange" | "value">, FieldProps { /** * The initial value of the radio group. */ defaultValue?: Y; /** * The value of the radio group. */ value?: Y; /** * The callback fired when any children radio is checked or unchecked. */ onChange?: (value: Y) => void; } declare const useRadioGroup: <Y extends string = string>(props?: UseRadioGroupProps<Y>) => { name: string; value: Y; getInputProps: PropGetter<"input", undefined, undefined>; getLabelProps: PropGetter<"label", undefined, undefined>; getRootProps: PropGetter<"div", undefined, undefined>; onChange: (valueOrEv: ChangeEvent<HTMLInputElement> | Y) => void; }; type UseRadioGroupReturn = ReturnType<typeof useRadioGroup>; //#endregion export { RadioGroupContext, UseRadioGroupProps, UseRadioGroupReturn, useRadioGroup, useRadioGroupContext }; //# sourceMappingURL=use-radio-group.d.ts.map