Radio
Single radio input. Prefer RadioGroup.
Code
import * as React from 'react';
import { Radio } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
display: 'flex',
gap: 20,
}}
>
<Radio name="r" defaultChecked>
Monthly
</Radio>
<Radio name="r">Yearly</Radio>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { Radio } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/radio.jsonGuidelines
- Use only when composing a custom radio layout.
Props
| Prop | Type | Required |
|---|---|---|
invalid | boolean | No |
name | string | No |
value | string | No |
checked | boolean | No |
defaultChecked | boolean | No |
disabled | boolean | No |
onChange | (e: React.ChangeEvent<HTMLInputElement>) => void | No |
className | string | No |
children | React.ReactNode | No |