Skip to main content
Version: 1.0.3

Radio

Overiew

A customizable radio component with multiple variants, sizes, and animations

Preview

RadioGroup

Installation

ignix add component radio

Usage

Import the component:

import { RadioGroup } from '@src/components/ui/radio';

RadioGroup

import { RadioGroup } from "./components/ui/radio";

function App() {
const [value, setValue] = useState("one");
const options = [
{ value: "one", label: "Option One" },
{ value: "two", label: "Option Two" },
];
const handleChange = (value: string) => {
setValue(value);
};
const [disabled, setDisabled] = React.useState(false);

return (
<>
<RadioGroup
options={options}
value={value}
onChange={handleChange}
labelPosition="right"
size="md"
checkedVariant="surface"
variant="default"
animationVariant="bounce"
disabled={disabled}
/>
</>
);
}

export default App;

Examples

Sizes Variants

Use the size prop to control the radio button size.

Extra Small
Small
Medium
Large
Extra Large

Animation Variants

Use the animationVariant prop to control the radio button animation.

Bounce
Scale
Pulse
Glow
Shake
Flip
Nina

Props

PropTypeDefaultDescription
variant'default' | 'primary' | 'success' | 'warning' | 'danger' | 'outline' | 'subtle' | 'glass' | 'neon''default'The visual style of the checkbox
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'The size of the checkbox
optionsarray-Options for Radio
labelPosition'left' | 'right''right'Position of the label relative to the checkbox
disabledbooleanfalseWhether the checkbox is disabled
animationVariant'bounce' | 'scale' | 'pulse' | 'glow' | 'shake' | 'flip' | 'nina''bounce'Animation style for interactions
checkedVariant'classic' | 'default' | 'surface''surface'Default checked state for uncontrolled usage
defaultCheckedboolean-Default checked state for uncontrolled usage
onChange(value: string) => void-Callback when checked state changes