Skip to content
v0.2.10

RadioCard

A native radio choice presented as a selectable content card.

Preview
Plan

Use RadioCard

RadioCard is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
radio-card.tsxTSX
"use client";

import { FloodRoot, Fieldset, Stack, RadioCard } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Fieldset legend="Plan">
        <Stack gap="2">
          <RadioCard name="plan" value="starter" label="Starter" description="For your next idea." metadata="Free" defaultChecked />
          <RadioCard name="plan" value="team" label="Team" description="For working together." metadata="$12 / month" />
        </Stack>
      </Fieldset>
    </FloodRoot>
  );
}

Design notes

  • Group choices in a Fieldset and give them the same name.
  • Native arrow-key behavior, forms and reset remain available. Apply readOnly consistently to the whole group.

API reference

PropValuesDefault
labelstringRequired
descriptionReactNode—
iconReactNode—
metadataReactNode—
density"compact" | "comfortable"—
Native HTML propsOmit<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size">, "label" | "children">Forwarded
View TypeScript source