UNPKG

@base-ui/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.

20 lines 1.16 kB
import * as React from 'react'; import type { UseFieldValidationReturnValue } from "../field/root/useFieldValidation.js"; import type { BaseUIChangeEventDetails } from "../utils/createBaseUIEventDetails.js"; import type { BaseUIEventReasons } from "../utils/reasons.js"; export interface RadioGroupContext<Value> { disabled: boolean | undefined; readOnly: boolean | undefined; required: boolean | undefined; name: string | undefined; checkedValue: Value | undefined; setCheckedValue: (value: Value, eventDetails: BaseUIChangeEventDetails<BaseUIEventReasons['none']>) => void; onValueChange: (value: Value, eventDetails: BaseUIChangeEventDetails<BaseUIEventReasons['none']>) => void; touched: boolean; setTouched: React.Dispatch<React.SetStateAction<boolean>>; validation?: UseFieldValidationReturnValue | undefined; registerControlRef: (element: HTMLElement | null, disabled?: boolean) => void; registerInputRef: (element: HTMLInputElement | null) => void; } export declare const RadioGroupContext: React.Context<RadioGroupContext<any> | undefined>; export declare function useRadioGroupContext(): RadioGroupContext<any> | undefined;