LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Components

Radio button

Also called radio group or option button

A round option in a group where choosing one clears the others, so people pick exactly one answer, like a plan or a shipping speed.

import { useId } from 'react';
import { Radio } from '@base-ui/react/radio';
import { RadioGroup } from '@base-ui/react/radio-group';

const PLANS = [
  { value: 'free', name: 'Free', price: '$0', detail: 'One project' },
  { value: 'pro', name: 'Pro', price: '$12/mo', detail: 'Unlimited projects' },
  { value: 'team', name: 'Team', price: '$30/mo', detail: 'Shared billing' }
];

export function PlanPicker() {
  const labelId = useId();

  // Arrow keys move the selection between plans, like native radios.
  return (
    <RadioGroup
      name='plan'
      defaultValue='pro'
      aria-labelledby={labelId}
      className='flex w-80 flex-col gap-2'
    >
      <p id={labelId} className='text-sm font-medium'>
        Choose a plan
      </p>
      {PLANS.map((plan) => (
        <label
          key={plan.value}
          className='flex cursor-pointer items-center gap-3 rounded-xl border p-4 transition-colors has-[[data-checked]]:border-blue-600 has-[[data-checked]]:bg-blue-500/10'
        >
          <Radio.Root
            value={plan.value}
            className='flex size-5 shrink-0 items-center justify-center rounded-full border bg-background outline-none focus-visible:ring-2 focus-visible:ring-ring data-checked:border-blue-600'
          >
            {/* The dot scales in from 0 on a curve that overshoots a touch, like a small spring. */}
            <Radio.Indicator className='size-2.5 rounded-full bg-blue-600 transition-transform duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] data-ending-style:scale-0 data-starting-style:scale-0' />
          </Radio.Root>
          <span className='flex-1'>
            <span className='block text-sm font-medium'>{plan.name}</span>
            <span className='text-sm text-muted-foreground'>{plan.detail}</span>
          </span>
          <span className='text-sm font-medium tabular-nums'>{plan.price}</span>
        </label>
      ))}
    </RadioGroup>
  );
}
Build the plan picker as card-style radio buttons for Free ($0), Pro ($12/mo), and Team ($30/mo). Use native radio inputs that share a name so the arrow keys work, make each whole card clickable with a blue border and a light blue background when selected, and scale the inner dot in from 0 with a spring over about 200ms. Pre-select Pro.

Paste into Layerwise or any AI coding tool.

What is Radio button?

Radio buttons come in groups. Each option has a small circle, and selecting one fills its circle with a dot while clearing the rest, like the preset buttons on an old car radio that gave them their name. A popular variation turns each option into a card with the price or details inside and a highlighted border on the chosen one.

Use radio buttons when people must pick exactly one of two to about six options and should see them all at once, such as a plan, a delivery speed, or a payment method. For longer lists, use a select or combobox, and for one setting that turns on and off, use a switch or checkbox.

Pre-select a sensible default when there is one, and keep the options in a predictable order. Native radio inputs that share a name get arrow-key navigation for free. Let the dot scale in with a quick spring of about 150 to 200ms, and make the whole card clickable.

Often confused with

Checkbox
Checkboxes allow any number of choices. Radio buttons allow exactly one per group.
Segmented control
A segmented control is a compact bar for a few short options, often switching a view. Radio buttons have room for longer labels and details.

Related terms

All terms

Checkbox

A small square you tick to turn an option on or select an item, with a dash in a parent box when only some items are checked.

Segmented control

A compact row of two to five options in one pill-shaped track, where a sliding thumb marks the single selected option.

Card

A bordered, rounded container that groups one item’s image, title, details, and actions so it can sit in a list or grid with others.

Spring animation

An animation driven by simulated spring physics in place of a fixed duration and curve, so motion can overshoot, settle, and react naturally.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit
Choose a plan