Dashral Pro is hereSee pricing

Dashral

EditorPro

The rich text editor with Pro's motion: the Floating Toolbar glides over a selection, / opens a menu of blocks and @ a list of people at the caret, and images upload in place.

Installation

When to use

  • Writing that people format as they go: docs, notes, posts, product pages, ticket descriptions.
  • Text that names teammates (@ mentions) or holds pictures and code, in an app that should feel like a writing tool.

When not to use

  • A short message or a comment box: the Prompt Composer or a Textarea is lighter.
  • A plain form field with a few styles and a fixed toolbar: the free Rich Text Editor does that, with less to load.

Usage

Editor with your own data: a whole component you can paste as a page.

example.tsx
"use client"

import { Editor } from "@/components/dashral/pro/editor"

const people = [
  { id: "maya", label: "Maya Okafor", description: "Design" },
  { id: "liam", label: "Liam Chen", description: "Engineering" },
]

// Your upload: send the file, give back where it lives.
async function upload(file: File) {
  const body = new FormData()
  body.append("file", file)
  const response = await fetch("/api/uploads", { method: "POST", body })
  return (await response.json()).url as string
}

export default function NoteEditor() {
  return (
    <form className="w-full max-w-2xl">
      <Editor label="Note" name="note" mentions={people} onUpload={upload} />
    </form>
  )
}

API reference

Editor

A rich text editor in one tag, with Pro's motion: the Floating Toolbar over a selection, a / menu of blocks, @ mentions, images that upload in place, and code blocks. It's the Rich Text Editor underneath, so it takes a label, hint and error and its value is HTML for forms.

PropTypeDefault
blocksEditorBlock[] | false

The / menu's blocks, in order; false turns the menu off.

sample
mentionsEditorMention[] | ((query: string) => EditorMention[] | Promise<EditorMention[]>)

People to mention with

—
onUpload(file: File) => Promise<string>

Uploads a picture and gives back its URL. With it, images go in from the / menu, a paste or a drop, showing at once while they upload; a failed upload takes its picture back out.

—
selectionToolbarboolean

The Floating Toolbar over a selection; true by default.

true
toolbarRichTextEditorProps["toolbar"]

A fixed toolbar too, as in the Rich Text Editor; none by default.

false
extensionsAnyExtension[]

More Tiptap extensions, after the built-in ones.

—
editorRefReact.Ref<TiptapEditor | null>

The Tiptap editor, once it exists.

—

type EditorBlockHelpers

PropTypeDefault
pickImage() => void

Opens the file picker for images (only when onUpload is given).

—

type EditorBlock

An item of the / menu.

PropTypeDefault
idstring—
labelstring—
descriptionstring—
iconReact.ReactNode—
keywordsstring

Words it's also found by.

—
run(editor: TiptapEditor, helpers: EditorBlockHelpers) => void

Turns the line into the block (the "/query" typed is already gone).

—

type EditorMention

Someone the @ menu offers.

PropTypeDefault
idstring—
labelstring—
descriptionstring—
avatarstring

A picture's URL; their initials otherwise.

—

Keyboard

KeysAction
/Open the blocks menu at the caret; keep typing to search it
@Open the people menu at the caret; keep typing to search it
↓or↑Move through a menu's items (it wraps round)
EnterorTabInsert the item a menu has picked
EscapeClose a menu, leaving what you typed; on the toolbar, back to the text
Alt + F10From a selection, to the Floating Toolbar
←or→Move between the toolbar's tools (mirrored right to left)
⌘Bor⌘Ior⌘Uor⌘⇧Sor⌘EBold, italic, underline, strikethrough and code, as in the Rich Text Editor

Accessibility

  • The Rich Text Editor underneath: a multi-line textbox named by its label (or aria-label), with its hint and error, and its HTML sent with a form under `name`.
  • The menus keep the focus in the text: the picked item is read out as the highlight moves, and the lists are listboxes of options with the picked one selected.
  • The Floating Toolbar is a toolbar with one tab stop and arrow keys between the tools; each tool says its name and whether it's on, and Link opens its field inside the toolbar.
  • A picture goes in with an empty alt (a decoration) until you give it one with the editor's own commands; mentions are written as "@Name" in the text, so they read the same out loud.

Motion

  • Select text and the Floating Toolbar fades in over it, then glides to each new selection (0.32 s); while you drag a selection out it waits, and comes when you let go. Link widens the bar into its field while the other tools step back.
  • The / and @ menus open at the caret with a short fade and grow (0.2 s), over the caret when there's no room under it. One highlight glides between the items with the pointer or the arrow keys, and the menu's height follows what matches as you type (0.24 s).
  • A picture shows the moment it's chosen, breathing softly while it uploads, then settles at full strength; a failed upload takes it back out.
  • Smooth tweens on [0.4, 0, 0.2, 1], never springs. With reduced motion everything is set at once.