# `LedgerUI.Components.Palette`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/components/palette.ex#L1)

Swatches of the kit palette: a warm-neutral base with a teal brand scale, status signals and
chart series. Colours are always read from the tokens (`var(--teal-500)`), so the swatches
follow the theme.

    <.palette variant="ramp" />
    <.palette variant="chips" scale="teal" />
    <.palette
      cols={6}
      colors={[
        %{token: "--bg-page", name: "Página", light: "#ffffff", dark: "#0e100f"},
        %{token: "--ink", name: "Ink", light: "#141514", dark: "#f2f3f2"}
      ]}
    />

## Variants

  * `swatches` (default): a grid of `lu-swc` cards, one per entry of `colors` with the colour,
    its name, the token and (when given) the `light` and `dark` hex values. `cols` is the
    number of columns.
  * `ramp`: the full `scale` (`teal` by default) as a strip of labelled steps (`steps`,
    `50..900` by default), the label turning white from step 400.
  * `chips`: the same scale as a row of small rounded chips, appearing one after the other
    (`lu-palrow`).

# `palette`

## Attributes

* `variant` (`:string`) - Defaults to `"swatches"`. Must be one of `"swatches"`, `"ramp"`, or `"chips"`.
* `colors` (`:list`) - `swatches`: maps with `:token` (`"--bg-page"`), `:name`, `:light`, `:dark`. Defaults to `[]`.
* `cols` (`:integer`) - `swatches`: number of columns. Defaults to `6`.
* `scale` (`:string`) - `ramp` and `chips`: the colour scale (`--<scale>-<step>`). Defaults to `"teal"`.
* `steps` (`:list`) - `ramp` and `chips`: the steps of the scale. Defaults to `["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
