AsciiRadioGroup

Radio button groups with ASCII styling for single-choice selections.

Preview

Choose framework:

Selected: react

Select size:

Selected: medium

Installation

npm install react-ascii-ui

Usage

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}
    />
  );
}

Examples

Basic Selection

Priority Levels

Form Integration

Deployment Environment:

API Reference

PropTypeDefaultDescription
namestring-Name attribute for radio group
optionsRadioOption[]-Array of radio options
valuestring-Currently selected value
onChange(value: string) => void-Called when selection changes

RadioOption Interface

interface RadioOption {
  value: string;
  label: string;
}