Expo App UIExpo App UI
Components

Radio Group

Single-select group of radio options with horizontal or vertical layout.

Installation

npx expo-app-ui add radio-group

Usage

import RadioGroup from "@/components/ui/radio-group";
import { useState } from "react";

const [plan, setPlan] = useState<"free" | "pro">("free");

<RadioGroup
  value={plan}
  onChange={setPlan}
  options={[
    { label: "Free", value: "free" },
    { label: "Pro",  value: "pro" },
  ]}
/>

Props

PropTypeDefaultDescription
optionsRadioOption<T>[]requiredAvailable options
valueT | nullrequiredSelected value
onChange(v: T) => voidrequiredChange handler
direction'vertical' | 'horizontal''vertical'Layout direction
size'sm' | 'md' | 'lg''md'Radio size
colorstring'#2563EB'Selected color
borderColorstring'#9CA3AF'Unselected border

RadioOption shape: { label: string; value: T; disabled?: boolean }.

Accessibility

  • Container: accessibilityRole="radiogroup"
  • Each option: accessibilityRole="radio" with accessibilityState.selected

On this page

Find this useful?

Buy me a coffee