BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/plate/date-node

Date Element

plate/date-node
FreeComponent

A date field component with calendar picker.

Live preview

live · rendered by the registry
Rendered by plate on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://platejs.org/r/date-node.json

Source

src/registry/ui/date-node.tsxplatejs.org/r/date-node.json
1'use client';
2
3import * as React from 'react';
4
5import {
6 formatDateValue,
7 getDateDisplayLabel,
8 parseCanonicalDateValue,
9} from '@platejs/date';
10import type { TDateElement } from 'platejs';
11import type { PlateElementProps } from 'platejs/react';
12
13import { PlateElement, useReadOnly } from 'platejs/react';
14
15import { Calendar } from '@/components/ui/calendar';
16import {
17 Popover,
18 PopoverContent,
19 PopoverTrigger,
20} from '@/components/ui/popover';
21import { cn } from '@/lib/utils';
22import { inlineSuggestionVariants } from '@/registry/lib/suggestion';
23
24export function DateElement(props: PlateElementProps<TDateElement>) {
25 const { editor, element } = props;
26 const readOnly = useReadOnly();
27
28 const trigger = (
29 <span
30 className={cn(
31 'w-fit cursor-pointer rounded-sm bg-muted px-1 text-muted-foreground',
32 inlineSuggestionVariants()
33 )}
34 contentEditable={false}
35 draggable
36 >
37 {element.date || element.rawDate ? (
38 getDateDisplayLabel(element)
39 ) : (
40 <span>Pick a date</span>
41 )}
42 </span>
43 );
44
45 return (
46 <PlateElement
47 {...props}
48 className="inline-block"
49 attributes={{
50 ...props.attributes,
51 contentEditable: false,
52 }}
53 >
54 {readOnly ? (
55 trigger
56 ) : (
57 <Popover>
58 <PopoverTrigger asChild>{trigger}</PopoverTrigger>
59 <PopoverContent className="w-auto p-0">
60 <Calendar
61 selected={parseCanonicalDateValue(element.date ?? '')}
62 onSelect={(date) => {
63 if (!date) return;
64
65 editor.tf.setNodes(
66 { date: formatDateValue(date), rawDate: undefined },
67 { at: element }
68 );
69 }}
70 mode="single"
71 initialFocus
72 />
73 </PopoverContent>
74 </Popover>
75 )}
76 {props.children}
77 </PlateElement>
78 );
79}

What it pulls in

npm packages

  • @platejs/date

Other registry items

  • calendar
  • https://platejs.org/r/suggestion.json

Files it writes

  • src/registry/ui/date-node.tsx
  • src/registry/ui/date-node-static.tsx

Facts

Registry
plate
Type
registry:ui
Access
Free
Files written
2
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on plate platejs.org udecode/plate on GitHub Raw registry item This item as JSON

More from plate

All 324 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ai-kitai-kitplateComponentsFree1 dep
AI Menuai-menuplateComponentsFree5 deps · 2 files
AI Leafai-nodeplateComponentsFreeno deps
AI Toolbar Buttonai-toolbar-buttonplateComponentsFree1 dep
align-base-kitalign-base-kitplateComponentsFree1 dep
align-kitalign-kitplateComponentsFree1 dep
Align Toolbar Buttonalign-toolbar-buttonplateComponentsFree1 dep
autoformat-classic-kitautoformat-classic-kitplateComponentsFree2 deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex