Color Swatch

A color swatch displays a color sample.

<ColorSwatch color="#f00" />

Installation

pnpm dlx 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.

API Reference

A ColorSwatch displays a preview of a selected color.

PropType
string | Color
string

Last updated on 12/21/2025

dotUI

Bringing singularity to the web.

Built with passion by @mehdibha.