import { radioPropDefs } from "@radix-ui/themes/props" import type { Meta, StoryObj } from "@storybook/react" import { Radio } from "./Radio" /** * The Radio component allows users to select one option from a set of choices. * It should always be used within a group with other radio buttons. */ const meta: Meta = { title: "base/selection/Radio", component: Radio, parameters: { layout: "centered", }, tags: ["autodocs"], argTypes: { size: { control: "select", options: radioPropDefs.size.values, }, color: { control: "select", options: radioPropDefs.color.values, }, highContrast: { control: "boolean", }, disabled: { control: "boolean", }, }, } satisfies Meta export default meta type Story = StoryObj /** * Default radio button. */ export const Default: Story = { args: { defaultChecked: true, }, } /** * Radio buttons can have different states. */ export const States: Story = { render: args => (
), } /** * Radio buttons can be disabled. */ export const Disabled: Story = { render: args => (
), } /** * Different sizes of radio buttons. */ export const Sizes: Story = { render: args => (
), } /** * Radio buttons can have different colors. */ export const Colors: Story = { render: args => (
{radioPropDefs.color.values.map(color => (
))}
), } /** * Radio button group with labels. */ export const WithLabels: Story = { render: args => (
Choose your plan:
), }