Color Swatch

A color swatch displays a color sample.

<ColorSwatch color="#f00" />

Installation

npx shadcn@latest add @dotui/color-swatch

Usage

Use color swatches to display a color sample.

import { ColorSwatch } from "@/components/ui/color-swatch";
<ColorSwatch color="#ff0000" />

Playground

Use the controls below to experiment with different color swatch props and see the live preview and code update.

<ColorSwatch color="#ff0000" />

API Reference

A ColorSwatch displays a preview of a selected color.

PropType
string | Color
string

Last updated on 1/13/2026

Built with passion by @mehdibha.