Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

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 { DateRangePicker } from '@dryui/ui';
</script>

<DateRangePicker.Root>
  <DateRangePicker.Trigger>...</DateRangePicker.Trigger>
  <DateRangePicker.Content>...</DateRangePicker.Content>
  <DateRangePicker.Calendar>...</DateRangePicker.Calendar>
  <DateRangePicker.Preset>...</DateRangePicker.Preset>
</DateRangePicker.Root>

Import options

Root package

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

Per-component subpath

ts
import { DateRangePicker } from '@dryui/ui/date-range-picker'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Default

svelte
<script lang="ts">
  let startDate = $state(null);
  let endDate = $state(null);
</script>
<DateRangePicker.Root bind:startDate bind:endDate>
  <DateRangePicker.Trigger />
  <DateRangePicker.Content>
    <DateRangePicker.Calendar />
  </DateRangePicker.Content>
</DateRangePicker.Root>

With Presets

svelte
<DateRangePicker.Root bind:startDate bind:endDate>
  <DateRangePicker.Trigger />
  <DateRangePicker.Content>
    <DateRangePicker.Preset startDate={lastWeek} endDate={now}>Last 7 days</DateRangePicker.Preset>
    <DateRangePicker.Preset startDate={lastMonth} endDate={now}>Last 30 days</DateRangePicker.Preset>
    <DateRangePicker.Calendar />
  </DateRangePicker.Content>
</DateRangePicker.Root>

Structure

Compound components always start with DateRangePicker.Root. Use this structure block to understand required wrappers before you wire state or styling.

DateRangePicker.Root
  DateRangePicker.Trigger
  DateRangePicker.Content
  DateRangePicker.Calendar
  DateRangePicker.Preset
DateRangePicker.Root DateRangePicker.TriggerDateRangePicker.ContentDateRangePicker.CalendarDateRangePicker.Preset

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with DateRangePicker.Root, then add only the parts you need.

DateRangePicker.TriggerDateRangePicker.ContentDateRangePicker.CalendarDateRangePicker.Preset

DateRangePicker.Root

Prop Type Default Required Bindable
open
boolean
false
startDate
Date | null
$bindable<Date | null>(null)
endDate
Date | null
$bindable<Date | null>(null)
locale
string
min
Date | null
max
Date | null
disabled
boolean
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

DateRangePicker.Trigger

Prop Type Default Required Bindable
placeholder
string
children
Snippet | undefined

Forwards <button> attributes via rest props. Common examples: type, disabled, name. Omitted: children.

DateRangePicker.Content

Prop Type Default Required Bindable
placement
toptop-starttop-endbottombottom-startbottom-end
offset
number
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

DateRangePicker.Calendar

Prop Type Default Required Bindable

Forwards <div> attributes via rest props. Common examples: id, style, role.

DateRangePicker.Preset

Prop Type Default Required Bindable
startDate
Date
endDate
Date
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name. Omitted: children.