Components
Works like a native radio button with value passed to the form on submission, in controlled or uncontrolled mode. Comes in three sizes, supports error and disabled states, and a RadioGroup compound for exclusive selection with any layout, FormControl group labels and card-based composition.
npx @21st-dev/cli add reshaped/reshaped-radioLoading preview...
import { Card, Reshaped, Text, View } from "reshaped/bundle";
import Radio, { RadioGroup } from "@/components/ui/reshaped-radio";
export default function Demo() {
return (
<Reshaped theme="slate">
<div style={{ maxWidth: 520, width: "100%", margin: "0 auto", padding: 24 }}>
<RadioGroup name="animalCustom" defaultValue="cat">
<View gap={3}>
<Card as="label">
<View gap={3} direction="row" align="center">
<Radio value="dog" />
<View.Item grow>
<Text variant="body-1" weight="medium">
Dog
</Text>
<Text variant="body-2">
The dog is a domesticated animal of the family Canidae.
</Text>
</View.Item>
</View>
</Card>
<Card as="label">
<View gap={3} direction="row" align="center">
<Radio value="cat" />
<View.Item grow>
<Text variant="body-1" weight="medium">
Cat
</Text>
<Text variant="body-2">
The cat is a domesticated animal of the family Felidae.
</Text>
</View.Item>
</View>
</Card>
</View>
</RadioGroup>
</div>
</Reshaped>
);
}
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...