Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { ColorPicker, Field, Label } from '@dryui/ui';
</script>

<Field.Root>
  <Label>Brand color</Label>
  <ColorPicker.Root>
    <ColorPicker.Area>...</ColorPicker.Area>
    <ColorPicker.HueSlider>...</ColorPicker.HueSlider>
    <ColorPicker.AlphaSlider>...</ColorPicker.AlphaSlider>
    <ColorPicker.Input>...</ColorPicker.Input>
    <ColorPicker.Swatch>...</ColorPicker.Swatch>
    <ColorPicker.EyeDropper>...</ColorPicker.EyeDropper>
    <ColorPicker.ChannelInput>...</ColorPicker.ChannelInput>
  </ColorPicker.Root>
</Field.Root>

Import options

Root package

ts
import { ColorPicker } from '@dryui/ui'

Per-component subpath

ts
import { ColorPicker } from '@dryui/ui/color-picker'

API

Props, CSS variables, and the public data attributes you can target when styling.

Prop Type Description Default Required Bindable

ColorPicker.Root

width
number
— — — —
areaHeight
number
— — — —
value
string
Current controlled or bindable value. '#ff0000' — ✓
alpha
number
— 1 — ✓
disabled
boolean
Prevents interaction and applies disabled styling. false — —
children
Snippet
Content rendered inside the component. — ✓ —

ColorPicker.Area

width
number
— 200 — —
height
number
— 150 — —

ColorPicker.HueSlider

ColorPicker.AlphaSlider

ColorPicker.Input

format
hexrgbhsl
— 'hex' — —

ColorPicker.Swatch

color
string
Semantic color or tone applied to the component. — — —

ColorPicker.EyeDropper

children
Snippet
Content rendered inside the component. — — —

ColorPicker.ChannelInput

channel
hsv
— — ✓ —