CompactSlider
is a highly customizable multi-purpose slider control for SwiftUI. It can be used to select a single value, or a range of values, or multiple values, or a point in a grid, or a polar point in a circular grid. The slider can be displayed horizontally, vertically, or in a (circular) grid. The slider can be customized with a variety of styles and options, including the possibility to design your own style.
The slider is a replacement for the build-in slider and is designed specifically for SwiftUI. For me, the main motivation for writing a component that already exists is the very slow performance under macOS 12 and below (e.g. when you need to resize the screen with multiple sliders or when animating) and the severely outdated design at that time.
I was inspired by the slider design that Apple's Photos app developed, which makes heavy use of sliders. Also new sliders in the Camera app on iPhone 16 Pro.
The slider basically defines two variants: a linear slider and a grid slider. The linear slider can be horizontal or vertical, and also scrollable, where the handle is still and the scale is moving.
The grid slider can be used to select a point in a grid or a polar point in a circular grid. The point in the grid represents a value of the x and y axis. The polar point represents a value of the angle and radius.
Possible slider types defined by the CompactSliderType
:
- a horizontal slider with alignments: leading, center, trailing.
- a vertical slider with alignments: top, center, bottom.
- a scrollable horizontal slider.
- a scrollable vertical slider.
- a grid slider.
- a circular grid slider.
- Swift 5.9+
- Xcode 15+
- SwiftUI 3+
- macOS 12+
- iOS 15+
- watchOS 8+
- visionOS 1+
- In Xcode go to
File
⟩Add Packages...
. - Search for the link below and click
Add Package
:
https://github.com/buh/CompactSlider.git
- Select to which target you want to add it and select
Add Package
.

The demo package contains several use cases.
Demo
macOS | iOS |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
GridDemo
macOS | iOS |
---|---|
![]() |
![]() |
CircularGridDemo
macOS | iOS |
---|---|
![]() |
![]() |
SystemDemo
macOS | iOS |
---|---|
![]() |
![]() |
WatchOSDemo
Horizontal | Vertical | Grid | Circular Grid |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Version 1.0 is deprecated and no longer supported. You can find the documentation for version 1.0 in the file: README v1.
You can buy me a coffee here ☕️
CompactSlider
is available under the MIT license