inputs/DSColorPicker

DSColorPicker

inputs
since v2.0

Colour 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

PropTypeDefaultDescription
selectionreqBinding<Color>โ€”Currently selected colour.
palette[Color]DSColor.paletteSwatch colours to display.
labelString?nilField label.
allowCustomBooltrueShows 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]
)

Related Components