Radio button groups with ASCII styling for single-choice selections.
Selected: react
Selected: medium
npm install react-ascii-ui
import { AsciiRadioGroup } from 'react-ascii-ui';
export default function App() {
const [selected, setSelected] = useState('option1');
const options = [
{ value: 'option1', label: 'Option 1' },
{ value: 'option2', label: 'Option 2' },
{ value: 'option3', label: 'Option 3' }
];
return (
<AsciiRadioGroup
name="example"
options={options}
value={selected}
onChange={setSelected}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | - | Name attribute for radio group |
| options | RadioOption[] | - | Array of radio options |
| value | string | - | Currently selected value |
| onChange | (value: string) => void | - | Called when selection changes |
interface RadioOption {
value: string;
label: string;
}