Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component Improvements & Docs Overhaul #184

Merged
merged 221 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
75c1309
init calendar work;
huntabyte Nov 10, 2023
1e74465
more calendar stuff
huntabyte Nov 10, 2023
f2fa8a9
Merge branch 'main' into feat/calendar
huntabyte Nov 10, 2023
b2b8c65
more calendar stuff
huntabyte Nov 11, 2023
4146517
init calendar preview
huntabyte Nov 11, 2023
38c9ea7
add vars
huntabyte Nov 15, 2023
d918749
more
huntabyte Nov 15, 2023
afae7f2
styles
huntabyte Nov 15, 2023
0e29a26
tabs
huntabyte Nov 15, 2023
01ce793
more styles
huntabyte Nov 15, 2023
7809d06
more
huntabyte Nov 15, 2023
2f90c0b
typo
huntabyte Nov 15, 2023
ab66d2c
remove spacing from title
huntabyte Nov 15, 2023
19e969b
accordion
huntabyte Nov 15, 2023
9316065
accordion updates
huntabyte Nov 15, 2023
96e3ffe
sidebar spacing
huntabyte Nov 15, 2023
2d3d79c
add table of contents
huntabyte Nov 15, 2023
d89edab
before butchering types maybe
huntabyte Nov 16, 2023
76708d8
type updates
huntabyte Nov 16, 2023
2f4232b
more types
huntabyte Nov 16, 2023
fa48771
cleanup
huntabyte Nov 16, 2023
3e83020
more
huntabyte Nov 16, 2023
848d958
almost done with type updates
huntabyte Nov 16, 2023
62365b2
more type work
huntabyte Nov 16, 2023
519faf4
more work
huntabyte Nov 16, 2023
a2d2453
many more type updates whew
huntabyte Nov 16, 2023
da8b2cc
refactor docs
huntabyte Nov 16, 2023
aa1df40
remove console log
huntabyte Nov 16, 2023
69f1470
theme toggle
huntabyte Nov 16, 2023
56d9044
scrollbars
huntabyte Nov 16, 2023
2ec9634
avatar
huntabyte Nov 17, 2023
87a3073
initial context menu
huntabyte Nov 17, 2023
77a3548
submenu
huntabyte Nov 17, 2023
d744a38
additional subtrigger styles
huntabyte Nov 17, 2023
8e97f64
fix separator
huntabyte Nov 17, 2023
698aaa5
trim accordion
huntabyte Nov 17, 2023
de67cfe
wip dialog
huntabyte Nov 17, 2023
eb35d76
more dialog stuff
huntabyte Nov 17, 2023
1248157
updates
huntabyte Nov 17, 2023
b09539d
code theme
huntabyte Nov 18, 2023
7bd63e8
focus styles
huntabyte Nov 18, 2023
439e3d8
alert dialog focus styles
huntabyte Nov 18, 2023
278303c
checkbox demo
huntabyte Nov 18, 2023
dd11989
dropdown menu
huntabyte Nov 18, 2023
292a806
fix code copy bug
huntabyte Nov 18, 2023
74502f8
light switch
huntabyte Nov 18, 2023
215071a
update toc
huntabyte Nov 18, 2023
e73116c
more stuff
huntabyte Nov 18, 2023
20052b5
fix toc
huntabyte Nov 18, 2023
40eebb6
fix checkbox
huntabyte Nov 18, 2023
1df4e92
fix checkbox
huntabyte Nov 18, 2023
2d77bf0
fix overflowing
huntabyte Nov 18, 2023
040fc46
formatting
huntabyte Nov 18, 2023
9ae70a8
initial select idea
huntabyte Nov 18, 2023
b2631a6
init popover
huntabyte Nov 18, 2023
6f4e9dd
popover
huntabyte Nov 18, 2023
35ae2bb
popover
huntabyte Nov 18, 2023
715f925
finish popover
huntabyte Nov 18, 2023
c98c3c6
switch
huntabyte Nov 18, 2023
43074fe
tooltip
huntabyte Nov 18, 2023
ca6f8a2
label demo
huntabyte Nov 18, 2023
b748a82
tests
huntabyte Nov 19, 2023
3400ae8
refactor api ref
huntabyte Nov 19, 2023
530e722
init menubar
huntabyte Nov 19, 2023
d55a4e5
init progress
huntabyte Nov 19, 2023
66b4ae5
fix: switch ring
huntabyte Nov 19, 2023
1bed65c
fix: switch ring in popover demo
huntabyte Nov 19, 2023
be37316
fix: menubar cursor
huntabyte Nov 19, 2023
b222816
refactor: floating
huntabyte Nov 19, 2023
73384c2
tooltip positioning
huntabyte Nov 20, 2023
bd14118
consolidation
huntabyte Nov 20, 2023
65cab94
more things
huntabyte Nov 20, 2023
c23fd25
change: positioning props
huntabyte Nov 20, 2023
797591c
fixes
huntabyte Nov 20, 2023
9e3464e
more fixes;
huntabyte Nov 20, 2023
767e974
fix light mode
huntabyte Nov 20, 2023
9101d66
link preview
huntabyte Nov 20, 2023
e1e1139
init menubar
huntabyte Nov 20, 2023
2261be3
logo
huntabyte Nov 20, 2023
382a5e5
favicon
huntabyte Nov 20, 2023
7d61a48
spacing
huntabyte Nov 20, 2023
2c4fe9e
checkbox border
huntabyte Nov 20, 2023
c96d32f
popover sideoffset
huntabyte Nov 20, 2023
248a471
context menu
huntabyte Nov 20, 2023
3e1282f
radio indicator doc
huntabyte Nov 20, 2023
62877d5
collapsible demo
huntabyte Nov 20, 2023
11a714a
cleanup dropdown
huntabyte Nov 20, 2023
cd9a5a4
init tabs demo
huntabyte Nov 20, 2023
1b44fcb
tabs demo
huntabyte Nov 21, 2023
b1f7877
slider demo
huntabyte Nov 21, 2023
44d5603
radio group demo init
huntabyte Nov 21, 2023
01f77a1
update select indicator
huntabyte Nov 21, 2023
eea20e3
cleanup select demo
huntabyte Nov 21, 2023
e59cd5b
more select cleanup
huntabyte Nov 21, 2023
10c747b
more spacing at end of sidebar nav
huntabyte Nov 21, 2023
b3f5fc6
scaling on button active state
huntabyte Nov 21, 2023
7742459
remove scaling from tabs triggers
huntabyte Nov 21, 2023
53490b6
cleanup
huntabyte Nov 21, 2023
5434ff6
comment cleanup
huntabyte Nov 21, 2023
cac3fd4
fixes
huntabyte Nov 21, 2023
ab8eb11
themes
huntabyte Nov 21, 2023
31e8284
fixes
huntabyte Nov 21, 2023
756c1a1
more cleanup
huntabyte Nov 21, 2023
a7d9633
toggle demos
huntabyte Nov 21, 2023
2780cac
more
huntabyte Nov 21, 2023
d99ef87
more docs
huntabyte Nov 21, 2023
d72f9a1
more docs
huntabyte Nov 21, 2023
26f42b4
tooltip api ref
huntabyte Nov 21, 2023
363d4cf
tooltip api ref
huntabyte Nov 21, 2023
7732325
fix label demo
huntabyte Nov 21, 2023
35b5de5
preview styles
huntabyte Nov 21, 2023
8cb9e0e
logo focus states
huntabyte Nov 21, 2023
3dd9600
fix: collapsible typo
huntabyte Nov 24, 2023
b298e71
fixes
huntabyte Nov 24, 2023
f1a3b1c
cleanup tabs
huntabyte Nov 24, 2023
7401545
Merge branch 'feat/calendar' into redesign-docs-v2
huntabyte Nov 24, 2023
ec2151d
merge calendar
huntabyte Nov 24, 2023
a8ee6fd
add changeset
huntabyte Nov 24, 2023
940c66d
cal style
huntabyte Nov 24, 2023
3883b85
attrs
huntabyte Nov 24, 2023
7e08c09
range calendar
huntabyte Nov 24, 2023
0512c66
fix: range
huntabyte Nov 24, 2023
0b959df
fix: pnpm lock
huntabyte Nov 24, 2023
87f7e62
fix: menubar border color
huntabyte Nov 25, 2023
20aefa8
fix: menubar bg
huntabyte Nov 25, 2023
f988d55
fixes
huntabyte Nov 25, 2023
f917f01
init calendar api reference
huntabyte Nov 25, 2023
f20cf5a
cal styles
huntabyte Nov 25, 2023
b782ef2
range cal init api ref
huntabyte Nov 25, 2023
2688a52
cal styles
huntabyte Nov 25, 2023
7419991
fix: toggle group doc
huntabyte Nov 25, 2023
61cb465
data attr table
huntabyte Nov 25, 2023
70690b8
switch styles
huntabyte Nov 26, 2023
f066196
fix switch styles
huntabyte Nov 26, 2023
d832a9a
fix menubar
huntabyte Nov 26, 2023
36c9e1f
progress-demo
huntabyte Nov 26, 2023
2cdec2b
shorten data attributes
huntabyte Nov 26, 2023
27f3e5e
styles
huntabyte Nov 26, 2023
a943e65
init date field
huntabyte Nov 26, 2023
f7076a4
remove ununsed stuff
huntabyte Nov 26, 2023
c34b812
rename things
huntabyte Nov 26, 2023
74d94a3
date field init
huntabyte Nov 26, 2023
bfe2399
styles
huntabyte Nov 26, 2023
f1c99e4
add easing to progress
huntabyte Nov 27, 2023
f47ccea
context menu icons
huntabyte Nov 27, 2023
b30c736
accordion
huntabyte Nov 27, 2023
6736557
cleanup date field
huntabyte Nov 27, 2023
88f954a
date field / date range field refactor
huntabyte Nov 27, 2023
7589705
add changeset
huntabyte Nov 27, 2023
c91edfd
figuring out picker
huntabyte Nov 27, 2023
51e2ae5
more dpicker stuff
huntabyte Nov 27, 2023
f34ba95
fix data attrs
huntabyte Nov 27, 2023
cb64c96
datepicker demo
huntabyte Nov 27, 2023
30ab4e2
stuff
huntabyte Nov 27, 2023
70f29e9
fix data attrs
huntabyte Nov 29, 2023
2ab5efd
fix: menubar demo hover lag
huntabyte Nov 29, 2023
702df10
Merge branch 'main' into redesign-docs-v2
huntabyte Nov 29, 2023
a433366
formatting
huntabyte Nov 29, 2023
60f2558
date picker structure
huntabyte Nov 29, 2023
5ebdb76
fix: duplicate style in dropdown
huntabyte Nov 29, 2023
6bb1dd2
fix: dropdown border style
huntabyte Nov 29, 2023
0ef8567
toggle demo
huntabyte Nov 30, 2023
44840db
toggle group demo
huntabyte Nov 30, 2023
dbf59e1
fix: dialog mobile padding
huntabyte Nov 30, 2023
ace86de
styles
huntabyte Nov 30, 2023
d735742
more style
huntabyte Nov 30, 2023
26e976d
more stuff
huntabyte Nov 30, 2023
66cb61a
enum data attr
huntabyte Nov 30, 2023
1871b04
data attrs table adjustments
huntabyte Nov 30, 2023
a7ede80
slot prop api ref
huntabyte Nov 30, 2023
16bf31c
slot prop api section table
huntabyte Nov 30, 2023
37f715d
cleanup
huntabyte Nov 30, 2023
84146cd
cleanup
huntabyte Nov 30, 2023
9064e93
redirect /docs to /docs/introductiong
huntabyte Nov 30, 2023
272b9d0
fix imports
huntabyte Nov 30, 2023
7208a3a
popover demo
huntabyte Nov 30, 2023
02ff0c8
fix: popover demo input bg
huntabyte Nov 30, 2023
0772760
popover demo
huntabyte Nov 30, 2023
96ef625
fix attr type in api ref
huntabyte Nov 30, 2023
ca314e1
fix tests
huntabyte Nov 30, 2023
cd2ff58
menubar updates
huntabyte Nov 30, 2023
d3d50af
radio group updates
huntabyte Nov 30, 2023
1ec7799
calendar styles
huntabyte Dec 1, 2023
f775645
datepicker styles
huntabyte Dec 1, 2023
56e093a
tabs demo styles
huntabyte Dec 1, 2023
adb9c3f
range hover styles
huntabyte Dec 1, 2023
77c1394
revert popover button style
huntabyte Dec 1, 2023
0a9b578
toggle active tyles
huntabyte Dec 1, 2023
a59ef1c
toggle group styles
huntabyte Dec 1, 2023
7fc40d7
update melt
huntabyte Dec 1, 2023
f382c26
slice weekday
huntabyte Dec 1, 2023
70b37d1
fix: typo
huntabyte Dec 1, 2023
c8e0fa3
add date range picker
huntabyte Dec 1, 2023
9329736
date field api ref
huntabyte Dec 1, 2023
56c5668
date range field api ref
huntabyte Dec 1, 2023
35863a0
date range picker api ref
huntabyte Dec 1, 2023
8349969
cleanup
huntabyte Dec 1, 2023
4f901c5
Merge branch 'main' into redesign-docs-v2
huntabyte Dec 1, 2023
5af6b8e
api section formatting
huntabyte Dec 1, 2023
63ce0f8
multiple calendar types
huntabyte Dec 2, 2023
2a431e5
descriptions
huntabyte Dec 2, 2023
82abe49
wip select multiple
huntabyte Dec 2, 2023
695721f
cleanup
huntabyte Dec 2, 2023
9659611
fix select multiple
huntabyte Dec 2, 2023
541cb33
check cleanup
huntabyte Dec 2, 2023
05b70df
add more floating things
huntabyte Dec 2, 2023
4122979
init calendar tests
huntabyte Dec 2, 2023
fbe87de
cal tests
huntabyte Dec 2, 2023
af77272
more cal tests
huntabyte Dec 2, 2023
0e63866
more cal tests
huntabyte Dec 2, 2023
e4eb83c
more calendar tests
huntabyte Dec 3, 2023
9989e32
range calendar tests
huntabyte Dec 3, 2023
858a856
refactor: calendar tests
huntabyte Dec 3, 2023
39c8b83
tests: date field
huntabyte Dec 3, 2023
4444c77
date range field tests
huntabyte Dec 3, 2023
560c7f1
work on type exports
huntabyte Dec 3, 2023
72d5745
add attrs to builder
huntabyte Dec 4, 2023
c76d0a8
types
huntabyte Dec 4, 2023
3812ed2
export types
huntabyte Dec 4, 2023
68b96ab
fix floating types
huntabyte Dec 4, 2023
83b2a5b
update API ref
huntabyte Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/brave-schools-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": minor
---

remove `arrowSize` prop from menu Root components in favor of passing it as a prop to the Arrow components
5 changes: 5 additions & 0 deletions .changeset/fresh-dryers-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": minor
---

New component: Date Range Picker
5 changes: 5 additions & 0 deletions .changeset/mighty-cobras-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": minor
---

feat: Calendar
5 changes: 5 additions & 0 deletions .changeset/old-dancers-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": minor
---

Breaking change: separate floating `positioning` props into individual props and move them to content components
5 changes: 5 additions & 0 deletions .changeset/spotty-beans-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": minor
---

New components: Range Calendar, Date Field, Date Range Field
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ yarn.lock
package.json

vite.config.js.timestamp-*
vite.config.ts.timestamp-*
vite.config.ts.timestamp-*
src/content/api-reference/extended-types/
9 changes: 5 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
"singleQuote": false,
"trailingComma": "none",
"printWidth": 100,
"plugins": [
"prettier-plugin-svelte"
],
"pluginSearchDirs": [
"."
],
"plugins": [
"prettier-plugin-svelte",
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte",
"printWidth": 100
"printWidth": 80
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion content/components/accordion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Accordion
description: Organizes content into collapsable sections.
description: Organizes content into collapsible sections, allowing users to focus on one section at a time.
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion content/components/alert-dialog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Alert Dialog
description: Presents critical information or prompts to the user, typically requiring their attention or action.
description: A modal window that alerts users with important information and awaits their acknowledgment or action.
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion content/components/aspect-ratio.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Aspect Ratio
description: Displays content with a specified aspect ratio, ensuring consistent and visually balanced presentation.
description: Displays content while maintaining a specified aspect ratio, ensuring consistent visual proportions.
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion content/components/avatar.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Avatar
description: Displays user or entity images with a fallback option for failed loading, ensuring consistent visual representation.
description: Represents a user or entity with a recognizable image or placeholder in UI elements.
---

<script>
Expand Down
58 changes: 58 additions & 0 deletions content/components/calendar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Calendar
description: Displays dates and days of the week, facilitating date-related interactions.
---

<script>
import { APISection, ComponentPreview, CalendarDemo } from '@/components'
export let schemas;
</script>

<ComponentPreview name="calendar-demo" comp="Calendar">

<CalendarDemo slot="preview" />

</ComponentPreview>

## Structure

```svelte
<script lang="ts">
import { Calendar } from "bits-ui";
</script>

<Calendar.Root let:months let:weekdays>
<Calendar.Header>
<Calendar.PrevButton />
<Calendar.Heading />
<Calendar.NextButton />
</Calendar.Header>

{#each months as month}
<Calendar.Grid>
<Calendar.GridHead>
<Calendar.GridRow>
{#each weekdays as day}
<Calendar.HeadCell>
{day}
</Calendar.HeadCell>
{/each}
</Calendar.GridRow>
</Calendar.GridHead>
<Calendar.GridBody>
{#each month.weeks as weekDates}
<Calendar.GridRow>
{#each weekDates as date}
<Calendar.Cell {date}>
<Calendar.Date {date} month={month.value} />
</Calendar.Cell>
{/each}
</Calendar.GridRow>
{/each}
</Calendar.GridBody>
</Calendar.Grid>
{/each}
</Calendar.Root>
```

<APISection {schemas} />
2 changes: 1 addition & 1 deletion content/components/checkbox.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Checkbox
description: Allow users to mark options as checked, unchecked, or indeterminate, accommodating versatile states.
description: Allow users to switch between checked, unchecked, and indeterminate states.
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion content/components/collapsible.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Collapsible
description: An interactive component which expands and collapses content.
description: Conceals or reveals content sections, enhancing space utilization and organization.
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion content/components/context-menu.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Context Menu
description: Displays a menu at the pointer's position when the trigger is right-clicked or long-pressed.
description: Displays options or actions relevant to a specific context or selected item, triggered by a right-click.
---

<script>
Expand Down
36 changes: 36 additions & 0 deletions content/components/date-field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Date Field
description: Enables users to input specific dates within a designated field.
---

<script>
import { APISection, ComponentPreview, DateFieldDemo } from '@/components'
export let schemas;
</script>

<ComponentPreview name="date-field-demo" comp="Date Field">

<DateFieldDemo slot="preview" />

</ComponentPreview>

## Structure

```svelte
<script lang="ts">
import { DateField } from "$lib";
</script>

<DateField.Root>
<DateField.Label>Check-in date</DateField.Label>
<DateField.Input let:segments>
{#each segments as { part, value }}
<DateField.Segment {part}>
{value}
</DateField.Segment>
{/each}
</DateField.Input>
</DateField.Root>
```

<APISection {schemas} />
70 changes: 70 additions & 0 deletions content/components/date-picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Date Picker
description: Facilitates the selection of dates through an input and calendar-based interface.
---

<script>
import { APISection, ComponentPreview, DatePickerDemo } from '@/components'
export let schemas;
</script>

<ComponentPreview name="date-picker-demo" comp="Date Picker">

<DatePickerDemo slot="preview" />

</ComponentPreview>

## Structure

```svelte
<script lang="ts">
import { DatePicker } from "bits-ui";
</script>

<DatePicker.Root>
<DatePicker.Label />
<DatePicker.Input let:segments>
{#each segments as { part, value }}
<DatePicker.Segment {part}>
{value}
</DatePicker.Segment>
{/each}
<DatePicker.Trigger />
</DatePicker.Input>
<DatePicker.Content>
<DatePicker.Calendar let:months let:weekdays>
<DatePicker.Header>
<DatePicker.PrevButton />
<DatePicker.Heading />
<DatePicker.NextButton />
</DatePicker.Header>
{#each months as month}
<DatePicker.Grid>
<DatePicker.GridHead>
<DatePicker.GridRow>
{#each weekdays as day}
<DatePicker.HeadCell>
{day}
</DatePicker.HeadCell>
{/each}
</DatePicker.GridRow>
</DatePicker.GridHead>
<DatePicker.GridBody>
{#each month.weeks as weekDates}
<DatePicker.GridRow>
{#each weekDates as date}
<DatePicker.Cell {date}>
<DatePicker.Date {date} month={month.value} />
</DatePicker.Cell>
{/each}
</DatePicker.GridRow>
{/each}
</DatePicker.GridBody>
</DatePicker.Grid>
{/each}
</DatePicker.Calendar>
</DatePicker.Content>
</DatePicker.Root>
```

<APISection {schemas} />
36 changes: 36 additions & 0 deletions content/components/date-range-field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Date Range Field
description: Allows users to input a range of dates within a designated field.
---

<script>
import { APISection, ComponentPreview, DateRangeFieldDemo } from '@/components'
export let schemas;
</script>

<ComponentPreview name="date-range-field-demo" comp="Date Range Field">

<DateRangeFieldDemo slot="preview" />

</ComponentPreview>

## Structure

```svelte
<script lang="ts">
import { DateField } from "$lib";
</script>

<DateField.Root>
<DateField.Label>Check-in date</DateField.Label>
<DateField.Input let:segments>
{#each segments as { part, value }}
<DateField.Segment {part}>
{value}
</DateField.Segment>
{/each}
</DateField.Input>
</DateField.Root>
```

<APISection {schemas} />
70 changes: 70 additions & 0 deletions content/components/date-range-picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Date Range Picker
description: Facilitates the selection of date ranges through an input and calendar-based interface.
---

<script>
import { APISection, ComponentPreview, DateRangePickerDemo } from '@/components'
export let schemas;
</script>

<ComponentPreview name="date-range-picker-demo" comp="Date Range Picker">

<DateRangePickerDemo slot="preview" />

</ComponentPreview>

## Structure

```svelte
<script lang="ts">
import { DateRangePicker } from "bits-ui";
</script>

<DateRangePicker.Root>
<DateRangePicker.Label />
<DateRangePicker.Input let:segments>
{#each segments as { part, value }}
<DateRangePicker.Segment {part}>
{value}
</DateRangePicker.Segment>
{/each}
<DateRangePicker.Trigger />
</DateRangePicker.Input>
<DateRangePicker.Content>
<DateRangePicker.Calendar let:months let:weekdays>
<DateRangePicker.Header>
<DateRangePicker.PrevButton />
<DateRangePicker.Heading />
<DateRangePicker.NextButton />
</DateRangePicker.Header>
{#each months as month}
<DateRangePicker.Grid>
<DateRangePicker.GridHead>
<DateRangePicker.GridRow>
{#each weekdays as day}
<DateRangePicker.HeadCell>
{day}
</DateRangePicker.HeadCell>
{/each}
</DateRangePicker.GridRow>
</DateRangePicker.GridHead>
<DateRangePicker.GridBody>
{#each month.weeks as weekDates}
<DateRangePicker.GridRow>
{#each weekDates as date}
<DateRangePicker.Cell {date}>
<DateRangePicker.Date {date} month={month.value} />
</DateRangePicker.Cell>
{/each}
</DateRangePicker.GridRow>
{/each}
</DateRangePicker.GridBody>
</DateRangePicker.Grid>
{/each}
</DateRangePicker.Calendar>
</DateRangePicker.Content>
</DateRangePicker.Root>
```

<APISection {schemas} />
Loading