BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/plate/block-selection

Block Selection

plate/block-selection
FreeComponent

A visual overlay for selected blocks.

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/block-selection.json

Source

src/registry/ui/block-selection.tsxplatejs.org/r/block-selection.json
1'use client';
2
3import * as React from 'react';
4
5import { DndPlugin } from '@platejs/dnd';
6import { useBlockSelected } from '@platejs/selection/react';
7import { cva } from 'class-variance-authority';
8import { type PlateElementProps, usePluginOption } from 'platejs/react';
9
10export const blockSelectionVariants = cva(
11 'pointer-events-none absolute inset-0 z-1 bg-brand/[.13] transition-opacity',
12 {
13 defaultVariants: {
14 active: true,
15 },
16 variants: {
17 active: {
18 false: 'opacity-0',
19 true: 'opacity-100',
20 },
21 },
22 }
23);
24
25export function BlockSelection(props: PlateElementProps) {
26 const isBlockSelected = useBlockSelected();
27 const isDragging = usePluginOption(DndPlugin, 'isDragging');
28
29 if (
30 !isBlockSelected ||
31 props.plugin.key === 'tr' ||
32 props.plugin.key === 'table'
33 )
34 return null;
35
36 return (
37 <div
38 className={blockSelectionVariants({
39 active: isBlockSelected && !isDragging,
40 })}
41 data-slot="block-selection"
42 />
43 );
44}

What it pulls in

npm packages

  • @platejs/selection

Files it writes

  • src/registry/ui/block-selection.tsx

Facts

Registry
plate
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
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