BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/blok/date-picker

Date picker

blok/date-picker
FreeComponent

A date field component that allows users to enter and edit date.

Install it

npx shadcn@latest add https://blok.sitecore.com/r/date-picker.json

Source

src/components/ui/date-picker.tsxblok.sitecore.com/r/date-picker.json · first 6 KB
1"use client";
2
3import { Icon } from "@/lib/icon";
4import { mdiCalendarBlankOutline } from "@mdi/js";
5import { type Locale, format } from "date-fns";
6import * as React from "react";
7import type { DateRange } from "react-day-picker";
8
9import { Button } from "@/components/ui/button";
10import { Calendar } from "@/components/ui/calendar";
11import {
12 Popover,
13 PopoverContent,
14 PopoverTrigger,
15} from "@/components/ui/popover";
16import { cn } from "@/lib/utils";
17
18type CalendarProps = React.ComponentProps<typeof Calendar>;
19
20/**
21 * Optional ARIA strings for the date picker UI outside the calendar grid.
22 * For DayPicker label creators (nav, days, etc.), use `calendarProps.ariaLabels`.
23 */
24export type DatePickerAriaLabels = {
25 /**
26 * `aria-label` on the popover trigger when **no date is selected** (empty state).
27 * When a date is shown, `aria-label` is omitted so the visible formatted date is the accessible name.
28 */
29 popoverTrigger?: string;
30};
31
32export type DatePickerSimpleCalendarProps = Omit<
33 CalendarProps,
34 "mode" | "selected" | "onSelect"
35>;
36
37export type DatePickerSimpleProps = {
38 /** Uncontrolled initial selection */
39 defaultValue?: Date;
40 /** Fires when the selected date changes */
41 onChange?: (date: Date | undefined) => void;
42 /** Trigger label when empty (e.g. translated placeholder) */
43 placeholder?: React.ReactNode;
44 /** `date-fns` format string for the trigger when a date is selected */
45 dateFormat?: string;
46 /** Used with `format()` and forwarded to `Calendar` */
47 locale?: Locale;
48 disabled?: boolean;
49 id?: string;
50 className?: string;
51 ariaLabels?: DatePickerAriaLabels;
52 /** Props forwarded to `Calendar`; `mode`, `selected`, and `onSelect` are fixed */
53 calendarProps?: DatePickerSimpleCalendarProps;
54} & (
55 | {
56 /** Controlled value; pass `undefined` to clear. Omit for uncontrolled usage. */
57 value: Date | undefined;
58 }
59 | { value?: never }
60);
61
62function DatePickerSimple(props: DatePickerSimpleProps) {
63 const {
64 defaultValue,
65 onChange,
66 placeholder = "Pick a date",
67 dateFormat = "PPP",
68 locale,
69 disabled,
70 id,
71 className,
72 ariaLabels,
73 calendarProps,
74 } = props;
75
76 const isControlled = "value" in props;
77 const valueProp = isControlled ? props.value : undefined;
78
79 const [internalDate, setInternalDate] = React.useState<Date | undefined>(
80 defaultValue,
81 );
82
83 const date = isControlled ? valueProp : internalDate;
84
85 const setDate = React.useCallback(
86// … truncated

What it pulls in

npm packages

  • date-fns
  • @mdi/js
  • react-day-picker

Other registry items

  • https://blok.sitecore.com/r/theme.json
  • https://blok.sitecore.com/r/button.json
  • https://blok.sitecore.com/r/calendar.json
  • https://blok.sitecore.com/r/popover.json
  • https://blok.sitecore.com/r/select.json

Files it writes

  • src/components/ui/date-picker.tsx
  • src/lib/icon.tsx

Facts

Registry
blok
Type
registry:ui
Access
Free
Files written
2
Licence
NOASSERTION
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

blok.sitecore.com Sitecore/blok on GitHub Raw registry item This item as JSON

More from blok

All 72 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionblokComponentsFree2 deps · 2 files
Action baraction-barblokComponentsFree1 dep · 2 files
AlertalertblokComponentsFree2 deps · 2 files
Alert dialogalert-dialogblokComponentsFree2 deps
Aspect ratioaspect-ratioblokComponentsFree1 dep
AvataravatarblokComponentsFree1 dep
BadgebadgeblokComponentsFree2 deps
All componentsblok-componentsblokComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex