inputs/DSColorPicker
DSColorPicker
inputsColour swatch grid with a custom-colour option via the system colour picker. Supports a predefined palette.
iOS 17+macOS 14+
Purpose
Label colours, project/tag colour assignment, and theme customisation.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| selectionreq | Binding<Color> | โ | Currently selected colour. |
| palette | [Color] | DSColor.palette | Swatch colours to display. |
| label | String? | nil | Field label. |
| allowCustom | Bool | true | Shows the system colour picker as the last swatch. |
Examples
Project colour
Colour picker in a project creation form.
swift
DSColorPicker(
selection: $project.color,
label: "Project colour",
palette: [.red, .orange, .yellow, .green, .blue, .purple, .pink]
)