Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Core

Radio

Give radios in a group the same name, or use RadioGroup.

import { Radio } from "@stylhero/ui";

Example

Code
import { Radio, Stack } from "@stylhero/ui";

function RadioExample() {
  return (
    <Stack gap={2}>
      <Radio name="ship" value="standard" label="Standard" hint="3 to 5 days" defaultChecked />
      <Radio name="ship" value="express" label="Express" hint="Next day" />
    </Stack>
  );
}

Props

PropTypeDefaultDescription
label required ReactNode -
hint ReactNode - Smaller text under the label.

Also takes every <input> attribute (id, style, data-*, aria-*, event handlers…), passed to that element. Takes a ref.

Keyboard

KeyDoes
Arrow keysMove to and select the next radio with the same name

Accessibility

  • A native radio inside its <label>.

Generated from src/components/Checkbox.tsx. Something wrong or missing? Open an issue.