Docs
Controls

Level PickerNew

A stepped slider for a few named levels: the red thumb rides a glass track, ticks at each stop and settles where a flick would land.

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

Colors and metrics for LevelPicker. .standard is the house palette: the brand red on neutral glass.

Notes

  • For a handful of named levels, such as fan speed, quality or text size. Pass any Hashable options with a label, or strings with the convenience initializer.
  • A red capsule sits on a liquid glass track over detent dots. Tap a stop and the capsule flows there: the end facing the new stop leads on a tight spring and the far end follows on a looser one, so it stretches across the stops between and gathers in.
  • Drag the capsule and it follows the finger directly, with a soft edge past either end. selection updates at each stop it crosses, with a selection tick, so what it controls follows live. On release it lands where the flick was heading, carrying the finger's speed.
  • Stop names sit under the track with the chosen one in full ink. Turn them off with showsLabels: false and mark the ends with minimumImage and maximumImage instead.
  • VoiceOver reads it as one adjustable element with the level's name as its value: swipe up or down to change it. The track mirrors in right-to-left languages. .disabled(true) dims it.
  • Under Reduce Motion the capsule slides whole on one short spring with no overshoot. Reduce Transparency draws the track as a solid shape.

Usage

LevelPickerExample()

Install

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

Terminal

$npx swiftpieces add LevelPicker

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

>Add the SwiftPieces "Level Picker" 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 buttons and controls →

Build it yourself: SwiftUI motion guide · SwiftUI buttons guide · 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