UNPKG

@postenbring/hedwig-react

Version:

React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).

24 lines 1.23 kB
import { type ChangeEventHandler, type ReactNode } from "react"; import { type FieldsetProps } from "../fieldset"; import type { RadioButtonProps } from "./radio-button"; export interface RadioGroupProps extends Omit<FieldsetProps, "onChange"> { children: ReactNode; /** Will be passed to all Radio buttons within the radio group */ name?: RadioButtonProps["name"]; /** If you want the group to be controlled, you can pass the selected value here */ value?: RadioButtonProps["value"]; /** * Error message is passed to the internal Fieldset, and will also give contained Radio buttons * error styling and aria to indicate invalid state. */ errorMessage?: ReactNode; /** Will be passed to all Radio buttons within the radio group */ onChange?: ChangeEventHandler<HTMLInputElement> | undefined; } type RadioGroupContextProps = { hasError: boolean; } & Pick<RadioGroupProps, "name" | "value" | "onChange">; export declare const useRadioGroupContext: () => RadioGroupContextProps; export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLFieldSetElement>>; export {}; //# sourceMappingURL=radio-group.d.ts.map