UNPKG

retro-react

Version:

A React component library for building retro-style websites

61 lines (60 loc) 2.22 kB
/// <reference types="react" /> import { ThemeUICSSObject } from 'theme-ui'; export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLFieldSetElement>, 'onChange'> { /** * Value set by default. Must match the value of one of the Radio children. * * @default undefined */ defaultValue?: string; /** * Controls whether the RadioGroup is disabled. * * @default false */ disabled?: boolean; /** * Callback fired when the value changes. * * @param {string} newValue The new value of the radio group. * * @default undefined * * @internal */ onChange?: (newValue: string) => void; sx?: ThemeUICSSObject; } export interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> { /** * Label for the radio button. */ label?: string; /** * The boolean value of the Radio. If true, the Radio will be checked. * * @default false * * @internal */ checked?: boolean; } /** * The RadioGroup component with authentic WIN31 styling for single-selection forms. * Features classic inset radio buttons with proper dotted focus indicators. * Used in conjunction with the `Radio` component. * * @example * <RadioGroup defaultValue="playstation" onChange={setValue}> * <Radio label="Super Nintendo" name="console" value="snes" /> * <Radio label="Sega Genesis" name="console" value="genesis" /> * <Radio label="Sony PlayStation" name="console" value="playstation" /> * </RadioGroup> */ export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLFieldSetElement>>; /** * The Radio component with authentic WIN31 styling for single-selection forms. * Features classic inset radio buttons with proper dotted focus indicators. * @see See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio) for more details about the HTML input element of type radio. */ export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLInputElement>>;