Bridge Training
Rich Text

Toolbar Buttons

Composable toolbar buttons for the RichEditor.

Toolbar buttons are passed as children of RichEditor.Toolbar. They must be rendered inside a RichEditor.Root (they use Plate's editor context internally).

MarkToolbarButton

Toggle bold/italic marks.

import { MarkToolbarButton } from '@workspace/rich-text/components/mark-toolbar-button';

<MarkToolbarButton nodeType="bold" tooltip="Bold (Cmd+B)">B</MarkToolbarButton>
<MarkToolbarButton nodeType="italic" tooltip="Italic (Cmd+I)">I</MarkToolbarButton>
PropTypeDescription
nodeTypestringMark type: 'bold' or 'italic'
clearstring | string[]Other mark types to clear when applying this mark
tooltipstringTooltip text
childrenReactNodeButton label

ListToolbarButton

Toggle ordered/bulleted lists.

import { ListToolbarButton } from '@workspace/rich-text/components/list-toolbar-button';

<ListToolbarButton listType="ordered" />
<ListToolbarButton listType="bulleted" />
PropTypeDescription
listType'ordered' | 'bulleted'List type (preferred over nodeType)
nodeTypestringRaw Plate node type (advanced)

SuitSymbolButton

Insert bridge suit symbols.

import { SuitSymbolButton } from '@workspace/rich-text/plugins/suit/suit-symbol-button';

<SuitSymbolButton suit="S" />  {/* Spade */}
<SuitSymbolButton suit="H" />  {/* Heart */}
<SuitSymbolButton suit="D" />  {/* Diamond */}
<SuitSymbolButton suit="C" />  {/* Club */}
PropTypeDescription
suit'S' | 'H' | 'D' | 'C'Suit to insert
displayCharstringOverride the display character (defaults to Unicode suit glyph)
modeEditorModeDisplay mode (default: 'default')
disabledbooleanDisable the button

Each button shows the suit glyph with its color and the keyboard shortcut (\S, \H, \D, \C).

IndentToolbarButton

Indent or outdent list items.

import { IndentToolbarButton } from '@workspace/rich-text/components/list-toolbar-button';

<IndentToolbarButton />            {/* Indent */}
<IndentToolbarButton reverse />    {/* Outdent */}
PropTypeDescription
reversebooleanWhen true, outdents instead of indenting (default: false)

Full Toolbar Example

const SUITS = ['S', 'H', 'D', 'C'] as const;

<RichEditor.Toolbar>
  <MarkToolbarButton nodeType="bold">B</MarkToolbarButton>
  <MarkToolbarButton nodeType="italic">I</MarkToolbarButton>
  <ListToolbarButton listType="ordered" />
  <ListToolbarButton listType="bulleted" />
  {SUITS.map((suit) => (
    <SuitSymbolButton key={suit} suit={suit} />
  ))}
</RichEditor.Toolbar>

On this page