UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

47 lines (46 loc) 1.85 kB
import { InputHTMLAttributes } from 'react'; export interface RadioProps extends InputHTMLAttributes<HTMLInputElement> { /** Label text displayed next to the radio. */ label: string; /** Name of the radio group. */ name: string; /** Set the value of the radio. */ value: string; /** Controls whether the radio is checked. */ checked?: boolean; /** Allows the addition of e.g. decorative icons for an option. */ customArea?: React.ReactNode; /** Changes the position of the custom area and lifts size restrictions. * @default false */ isCustomAreaAbove?: boolean; /** Disables the radio, preventing user interaction. * @default false */ disabled?: boolean; /** * Id of the parent Fieldset, required for a11y when systemFeedback is set */ fieldsetId?: string; /** Makes the label use `ds.utility-medium-bold` if any option has a `hint` and `hideUncheckedHint` is set to false. * @default false */ isBold?: boolean; /** Short descriptive text displayed beneath the label. */ hint?: string; /** Marks the radio as invalid, typically used for form validation. * @default false */ invalid?: boolean; /** Controls whether the hint is displayed when the radio button is not checked. * @default false */ hideUncheckedHint?: boolean; /** Callback function called when the state of the radio changes. */ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void; } /** * Generally used in radio groups—collections of radio buttons describing a set of related options. * Only one radio button in a given group can be selected at the same time. * */ export declare const DSRadio: import('react').ForwardRefExoticComponent<RadioProps & import('react').RefAttributes<HTMLInputElement>>;