Docs
Inputs

Choice GroupNew

Radio and checkbox rows on a glass card: one red drop flows from ring to ring, and checked boxes flood red with a popping check.

$npx swiftpieces add ChoiceGroup
Free · MIT + Commons ClauseiOS 17.0+Liquid Glassradiocheckboxpickerformselectionhaptics
Type
ChoiceGroup
Files
ChoiceGroup.swift
Depends on
Nothing (Apple frameworks only)
Version
1.0.0

Colors and type for ChoiceGroup. .standard is the house palette: the brand red on a neutral glass card.

Notes

  • One piece for radio buttons and checkboxes. Bind selection to a single value for a single choice, or to a Set for a multiple choice. Rows sit on one liquid glass card with hairline dividers.
  • In a single choice the selection is one red drop that flows from ring to ring. The edge facing the new row leads on a tight spring and the far edge follows on a looser one, so the drop stretches down or up the card and gathers into the new ring. Rows are measured, so the drop lines up with rows of any height, including wrapped titles.
  • In a multiple choice each box floods red and draws its check in ink with a small pop.
  • Each row takes a title and an optional detail on the trailing side, such as a price. The whole row is the tap target and shades while pressed.
  • One selection haptic fires for every change. VoiceOver reads the title as the group's label and each row as a button, selected for a radio and Checked or Unchecked for a box. .disabled(true) dims the card.
  • Under Reduce Motion the drop slides on one short spring without the stretch, and the check fades instead of popping. Reduce Transparency draws the card as a solid shape.

Usage

ChoiceGroupExample()

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add ChoiceGroup

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Choice Group" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All inputs and forms →

Build it yourself: SwiftUI haptics guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro