SwatchRow


Compact
Rounded
Surfaces
Background var(--bg)
Tone var(--tone)
Card var(--card)
Accent
Accent var(--accent)
Hover var(--accent-hover)
Muted var(--accent-muted)
Text
Aa Text var(--text)
Aa Muted var(--text-muted)

Usage


Svelte
<script>
    import type { Swatch } from "./SwatchRow/swatchRow.config";
    import SwatchRow from "./SwatchRow/SwatchRow.svelte";

    const swatches: Swatch[] = [
        { label: "Background", value: "var(--bg)", bg: "var(--bg)", color: "var(--text)" },
        { label: "Tone", value: "var(--tone)", bg: "var(--tone)", color: "var(--text)" },
        { label: "Card", value: "var(--card)", bg: "var(--card)", color: "var(--text)" },
    ];
</script>

<SwatchRow {swatches} />

API


package_2

import type { Swatch } from '@abhc/spektral-ui';

SwatchRow

PropTypeDefault
swatchesSwatch[]required
compactbooleanfalse
roundedbooleanfalse
Prop swatches
Type Swatch[]
Default required
Prop compact
Type boolean
Default false
Prop rounded
Type boolean
Default false

Swatch

FieldTypeRequired
labelstringyes
valuestringyes
bgstringyes
colorstringyes
isTextbooleanno
Field label
Type string
Required yes
Field value
Type string
Required yes
Field bg
Type string
Required yes
Field color
Type string
Required yes
Field isText
Type boolean
Required no