Komponenty
Wybór koloru
Wybiera kolor i przesyła go wraz z otaczającym formularzem.
Użycie
Podstawowy
HTML
<bs:bsui-color-picker defaultValue="#7c3aed" />Pole z etykietą
Próbka koloru, pole hex i tekst pomocy wyjaśniający, gdzie zostanie zastosowany kolor.
HTML
<bs:bsui-field>
<bs:bsui-field-label text="Accent color" />
<bs:bsui-color-picker name="accent" defaultValue="#0ea5e9" />
<bs:bsui-field-description text="Used for buttons, links and focus rings." />
</bs:bsui-field>Paleta marki
Kilka selektorów w jednym wierszu, z których każdy zapisuje własną wartość.
HTML
<bs:bsui-stack direction="row" gap="4" align="start">
<bs:bsui-field>
<bs:bsui-field-label text="Primary" />
<bs:bsui-color-picker name="primary" defaultValue="#111827" />
</bs:bsui-field>
<bs:bsui-field>
<bs:bsui-field-label text="Accent" />
<bs:bsui-color-picker name="accent" defaultValue="#f59e0b" />
</bs:bsui-field>
</bs:bsui-stack>Wyłączone
Zarówno natywny próbnik koloru, jak i pole hex są zablokowane.
HTML
<bs:bsui-color-picker defaultValue="#64748b" disabled="true" />Atrybuty
| Atrybut | Typ | Domyślnie |
|---|---|---|
name | text | — |
defaultValue | text | #000000 |
disabled | toggle | false |
nameAlt | text | — |
onChange | text | — |
value | text | — |