RadioGroup

A set of mutually exclusive options.

Import

import { RadioGroup } from "@tarve/core";

Usage

RadioGroup.tsx
import { RadioGroup } from "@tarve/core";

let plan = "pro";

<RadioGroup
  value={plan}
  options={[
    { value: "free", label: "Free" },
    { value: "pro", label: "Pro" },
    { value: "team", label: "Team", disabled: true },
  ]}
  onValueChange={(value) => {
    plan = value;
  }}
/>

Props

PropTypeDefault
options required RadioOption[]—
value required string—
disabled boolean—
onValueChange (value: string) => void—
orientation "horizontal" | "vertical""vertical"

Common props

Shared by every component. See descriptions →

childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle

Types

RadioOption
interface RadioOption { value: string; label: string; disabled?: boolean }