Skip to main content
Version: 1.0.3

Radio

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

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 Variant

Use the size prop to control the radio button size.

XS
SM
MD
LG
XL

Animation Variant

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' | 'neon''default'The visual style of the radio button
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'The size of the radio button
optionsRadioOption[]-Array of radio options to display
namestring-The name attribute for the radio group
valuestring-Controlled value of the selected radio option
defaultValuestring-Default value for uncontrolled usage
onChange(value: string) => void-Callback when the selected value changes
disabledbooleanfalseWhether the radio group is disabled
labelPosition'left' | 'right''right'Position of the label relative to the radio button
checkedVariant'default' | 'classic' | 'surface''surface'Visual style variant for the checked indicator
animationVariant'bounce' | 'scale' | 'pulse' | 'glow' | 'shake' | 'flip' | 'nina''bounce'Animation style for interactions
direction'vertical' | 'horizontal''vertical'Layout direction of the radio group
classNamestring-Additional CSS classes to apply to the radio group