Skip to content
v0.2.10

Radio

A labeled native radio for one choice within a group.

Preview
Project visibility

Use Radio

Radio 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.tsxTSX
"use client";

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

export function Example() {
  return (
    <FloodRoot>
      <fieldset>
        <legend>Visibility</legend>
        <Radio label="Private" name="visibility" value="private" defaultChecked />
        <Radio label="Public" name="visibility" value="public" />
      </fieldset>
    </FloodRoot>
  );
}

Design notes

  • Radios in one group share a name. The host supplies fieldset and legend.
  • Native browser keyboard and form behavior remain available.
  • The control and visible label form one content-width unit with an 8px-at-16px-root internal gap. Use an explicit parent gap="4" (16px at that root) between units; the glyph keeps its token-defined size.

API reference

PropValuesDefault
labelReactNodeRequired
Native HTML propsOmit<InputHTMLAttributes<HTMLInputElement>, "type" | "size">Forwarded
View TypeScript source