SwipeUI

Radio cards

Selectable radio cards with a measured sliding selection ring.

npx @swipeui/cli add radio-cards
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Picking a plan, shipping option or payment method where each choice deserves a card with a description.
  • Onboarding questions with a few rich answers.
  • Comparisons where the selected card should clearly stand out with a ring.

When not to use it

  • Long lists. Use Select or a list.
  • Multiple choices. Use Chip group or checkboxes.
  • Plain options without descriptions. Radio group's rows variant is lighter.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add radio-cards
  • Adds components/swipeui/ui/use-radio-cards.ts, components/swipeui/ui/radio-cards.tsx and 13 shared helpers.
  • Installs react-native-reanimated, uniwind, react-native-worklets, clsx, tailwind-merge, expo-haptics, class-variance-authority, react-native-svg, react-native-gesture-handler. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/paywall.tsx
import { RadioCards } from '@/components/swipeui/ui/radio-cards';

<RadioCards options={plans} />;

Examples

Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.

API reference

RadioCardsProps

PropTypeDefaultDescription
optionsreadonly RadioCardOption<T>[]—

Cards in reading order.

value?T | null—

Controlled selection.

defaultValue?T | nullnull

Initial selection.

onValueChange?((value: T | null) => void)—

Reports a newly selected card.

layout?"carousel" | "grid" | "stack"'grid'

Grid, full-width stack, or settle-select carousel.

minColumnWidth?number156

Minimum grid column width in points.

indicator?"check" | "dot" | "none"'dot'

Drawn selected mark.

highlight?SelectionHighlightMode'glide'

Gliding ring or no ring.

orientation?"horizontal" | "vertical"—

Legacy reading axis; vertical maps to stack, horizontal to grid.

disabled?booleanfalse

Disable every card.

typeahead?booleantrue

Typed label navigation.

haptics?boolean | SelectionHapticstrue

Selection and carousel detent channels.

motion?MotionOverrideapp feel

Ring and mark motion.

messages?Partial<SelectionMessages>English

Built-in unavailable hint.

accessibilityLabel?string—

Spoken group name.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Root style.

testID?string—

Identifier; each card appends its value.

Native view/input props not listed here pass through where the exported TypeScript type allows them.

Cards can supply a decorative background node; titles stay bold and badges sit at the bottom end. Grid surfaces stretch to match the selected ring.

Radio cards settings

PropDoesDefault
hapticsEnables selection or press feedbacktrue
motionOverrides the app's motion feelApp feel

| layout | Responsive grid, full-width stack or settle-select carousel | grid | | minColumnWidth | Minimum grid column width, in points | 156 | | indicator | Drawn dot, check or no mark | dot | | highlight | Gliding resizing ring; snaps on layout | glide | | typeahead | Jump by typing the label | true | | disabled | Disable all cards | false | | messages | Translate built-in hints | English | | orientation | Legacy vertical stack or horizontal grid | Unset |

Composition and behavior

The carousel selects at momentum end. Scrolling past a card does not select it. Taps and keyboard navigation remain available. Options accept meta for rich content, badge, icon and disabledReason.

  • Radio group with the cards variant and a sliding selection ring.
  • Cards use your card radius, so presets reshape them.

Behavior and gestures

  • Tap a card to select it; a selection ring slides to it with a light tick.
  • Tapping the selected card keeps it selected.
  • Disabled cards dim and can't be picked.

Accessibility

  • Works like Radio group: a radio group of radios with checked state and descriptions as hints.
  • Each card is a single, large target.
  • Name the group with accessibilityLabel.

Motion

  • Uses the select, toggle and press motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • The ring measures each card and slides with the select spring.
  • Reduce Motion moves it instantly.

Performance

  • A preset of Radio group with the same cost.

Notes for AI

  • Write short descriptions so cards stay even in height.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items