SwatchRow
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
| Prop | Type | Default |
|---|---|---|
| swatches | Swatch[] | required |
| compact | boolean | false |
| rounded | boolean | false |
Prop swatches
Type
Swatch[]Default
requiredProp compact
Type
booleanDefault
falseProp rounded
Type
booleanDefault
falseSwatch
| Field | Type | Required |
|---|---|---|
| label | string | yes |
| value | string | yes |
| bg | string | yes |
| color | string | yes |
| isText | boolean | no |
Field label
Type
stringRequired
yesField value
Type
stringRequired
yesField bg
Type
stringRequired
yesField color
Type
stringRequired
yesField isText
Type
booleanRequired
no