Editor Behavior
Focus, gap cursor and trailing node: the editor behaviours that make a document feel finished.
Preview
Installation
Add the item with the shadcn CLI, or copy the source manually.
pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-behaviorRequires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.
Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/rich-text-editor-behavior
typeset.css next to your stylesheet, import it after Tailwind and add the .typeset-docs preset. See the Rich text editor setup.API Reference
Props accepted by the exported components.
EditorFocus
Registers the focus extension. The focused node receives a class, so the focus ring can be styled from the document stylesheet.
| Prop | Type | Default |
|---|---|---|
className | string | 'has-focus' |
mode | 'all' | 'deepest' | 'shallowest' | 'all' |
EditorGapcursor
Registers the gap cursor extension. The caret can sit between two blocks, where a regular text cursor cannot go.
This component accepts no custom props.
EditorTrailingNode
Registers the trailing node extension. An empty block is kept at the end of the document, so there is always somewhere to keep writing.
This component accepts no custom props.