Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

RTEToolbar

  • Stable
  • WCAG 2.2 evidence
  • RTL
  • Web · iOS · Android

The formatting bar of a rich-text editor. Built on React Aria useToolbar (role toolbar) with a roving tab index: the bar is a single tab stop, Left and Right arrows move between tools (mirrored in right-to-left locales), Home and End jump to the first and last tool, and Tab leaves the bar from wherever focus is; coming back restores the last focused tool (WCAG 2.1.1, 2.4.3, 4.1.2). Disabled tools are skipped. On the web the tools wrap onto a second row in narrow containers instead of scrolling sideways (1.4.10). The library ships no editor engine: compose the tools and wire their state to your editor. Consumer duties: the toolbar name, tool names and shortcut hints.

import { RTEToolbar } from "@nexera-ui/react";
Loading example…
6
examples
8
props
3
live controls
3
platforms
5
WCAG criteria
1
block uses it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
children
platform
isDisabled
Generated code
import { RTEToolbar } from "@nexera-ui/react";

<RTEToolbar />

Examples 5

The same examples as Storybook, rendered live. Open Code to copy one.

Compact

Figma Type=Compact.

Loading example…

Platforms

Figma RTE toolbar Mobile: the keyboard accessory bar on iOS (bg/sunken, 50 pt tools) and Android (bg/surface, 52 dp tools). One row; tools that do not fit scroll inside the bar.

Loading example…

Disabled

isDisabled (as inside a disabled RichTextEditor): every tool is disabled and the bar turns bg/sunken.

Loading example…

Right to left

Right-to-left: the tools run from the right, the arrow keys are mirrored, and Undo / Redo icons flip.

Loading example…

In editor

A realistic composed editor with a plain contenteditable element (the toolbar above a plain contenteditable element, tools wired to the selection).

Loading example…

Props 8

Press "Try it" on a card to load that prop into the playground.

8 props shown

children*Nexera
ReactNode

The tools, in reading order: RTETool, RTEToolSelect and RTEToolbarDivider between groups. To push trailing tools to the end, give the first of them className="ms-auto". Any other focusable control (an IconButton, a link) joins the arrow-key navigation too.

Default –
typeNexera
"full" | "compact"

Which Figma tool set this toolbar reproduces. full: undo / redo, block type, inline marks, blocks, alignment, inserts and clear formatting (the toolbar of RichTextEditor); compact: bold, italic, strikethrough, lists, link and mention. The tools are composed by you, so the value only sets data-type: Figma has no visual difference between the two besides the tools and the frame width.

Default full
platformNexera
"web" | "ios" | "android"

Platform look. iOS and Android render the keyboard accessory bar: one row of 50 pt / 52 dp tools that scrolls sideways when they do not fit. The tools inside follow it. Defaults to the NexeraProvider platform.

Default "web"
isDisabledNexera
boolean

Disables every tool (for example while the editor is disabled); the bar turns bg/sunken. Defaults to the enclosing RichTextEditor's isDisabled.

Default false
classNameNexera
string

Extra classes, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style.

Default –
aria-labelNexera
string

Accessible name ("Formatting", "Text formatting"). Translate it. Accessible name; aria-labelledby wins when both are set.

Default –
aria-labelledbyNexera
string

Id(s) of element(s) that name the toolbar; wins over aria-label. Id(s) of the visible element(s) that name the toolbar.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

4 direct · 1 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.10ReflowLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
Usage
<RTEToolbar className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components