@postenbring/hedwig-react
Version:
React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).
22 lines • 1.24 kB
TypeScript
import { type ChangeEventHandler, forwardRef, type InputHTMLAttributes, type ReactNode } from "react";
import { FieldsetDescription } from "../fieldset/fieldset-description";
import { type FieldsetProps } from "../fieldset";
import { FieldsetLegend } from "../fieldset/fieldset-legend";
export interface RadioGroupProps extends Omit<FieldsetProps, "onChange"> {
children: ReactNode;
/** Will be passed to all Radio buttons within the radio group */
name?: InputHTMLAttributes<HTMLInputElement>["name"];
/** If you want the group to be controlled, you can pass the selected value here */
value?: InputHTMLAttributes<HTMLInputElement>["value"];
/** Will be passed to all Radio buttons within the radio group */
onChange?: ChangeEventHandler<HTMLInputElement> | undefined;
}
type RadioGroupContextProps = Pick<RadioGroupProps, "name" | "value" | "onChange" | "size">;
export declare const useRadioGroupContext: () => RadioGroupContextProps;
export declare const RadioGroup: RadioGroupType;
type RadioGroupType = ReturnType<typeof forwardRef<HTMLFieldSetElement, RadioGroupProps>> & {
Description: typeof FieldsetDescription;
Legend: typeof FieldsetLegend;
};
export {};
//# sourceMappingURL=radio-group.d.ts.map