HexSwatch

Color swatch that displays a hex value as docs data. Used in design-system reference pages where the hex IS the content, not a styling literal.

Preview

Usage

import { HexSwatch } from '@ramtt/ui'

<HexSwatch token="--bg" hex="#FAF9F5" label="Canvas" usage="Page background" />

Props

PropTypeDefaultDescription
hex*stringThe hex value to display (passed as data, not styling)
tokenstringOptional token name shown above the swatch (e.g. "--n50")
labelstringOptional label shown below the hex
usagestringOptional usage description
sizenumber56Swatch size in px