Skip to content

Color swatch

Shows a sample of a color.

color-swatch-basic-demo.tsx

Installation

The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.

Named palette

Set colorName for the accessible name. Without it, the name is generated, such as "vibrant red".

Ocean
Pine
Coral
Plum
color-swatch-demo.tsx

Transparency

Ocean 100%
Ocean 60%
Ocean 20%
color-swatch-transparency-demo.tsx

API reference

Color swatch takes the props of React Aria ColorSwatch (opens in a new tab).