Skip to Content
API Referenceeditor-react-ui

@stesura/editor-react-ui

The UI primitives the editor’s own toolbar, menus and dialogs are built from. Use them in a UI extension so its controls match the built-in ones. The package also re-exports the base components (Button, DropdownMenu, Popover, Tooltip, Tabs with TabsList, TabsTrigger and TabsContent, …) and the icons. The hooks that drive these controls are in @stesura/editor-react.

Toolbar

Layout pieces for custom toolbar groups and tabs. See Create New Items.

Toolbar

The toolbar parts as one namespace: Toolbar.Content, Toolbar.Group, Toolbar.Divider, Toolbar.Wrapper.

NameTypeDefault
WrapperNamedExoticComponent<ToolbarWrapperProps & RefAttributes<HTMLDivElement>>
DividerNamedExoticComponent<{ height?: string; } & Omit<HTMLProps<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>
GroupNamedExoticComponent<ToolbarGroupProps & RefAttributes<HTMLDivElement>>
ContentNamedExoticComponent<Omit<HTMLProps<HTMLDivElement>, "ref" | "label"> & { compact?: boolean; viewportClassName?: string; label: string; panel?: { id: string; labelledBy: string; }; } & RefAttributes<...>>

ToolbarContent

The ribbon body: a horizontally scrolling role="toolbar" with roving arrow-key focus across its items.

Parameters:
NameTypeDefault
propsOmit<HTMLProps<HTMLDivElement>, "ref" | "label"> & { compact?: boolean; viewportClassName?: string; label: string; panel?: { id: string; labelledBy: string; }; } & RefAttributes<...>
Returns:
ReactNode

ToolbarGroup

A ribbon group: its items on top, the label underneath, and an optional settings button (onExpand) beside the label, like Word’s dialog launchers.

Parameters:
NameTypeDefault
propsToolbarGroupProps & RefAttributes<HTMLDivElement>
Returns:
ReactNode

ToolbarDivider

Vertical separator between toolbar groups.

Parameters:
NameTypeDefault
props{ height?: string; } & Omit<HTMLProps<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>
Returns:
ReactNode

ToolbarWrapper

Plain row of toolbar items, without the ribbon’s scroll area or roving focus.

Parameters:
NameTypeDefault
propsToolbarWrapperProps & RefAttributes<HTMLDivElement>
Returns:
ReactNode

A dropdown’s contents as data (items), or a component that renders them (custom).

NameTypeDefault
kind"custom" | "items"

One entry of a MenuDef: an action, a checkbox, a separator or a submenu.

NameTypeDefault
kind"action" | "separator" | "checkbox" | "submenu"
idstring

ToolbarMenuContent

A dropdown’s content element with a MenuDef’s items in it. Place inside a DropdownMenu.

Parameters:
NameTypeDefault
__0ToolbarMenuProps
Returns:
Element

ToolbarMenuItems

Renders a MenuDef’s items, for a dropdown whose content element you supply.

Parameters:
NameTypeDefault
__0{ menu: MenuDef; depth?: number; }
Returns:
Element

useRovingToolbar

WAI-ARIA roving tabindex for a toolbar: the whole container is one Tab stop and arrows move between every control inside it, across group boundaries.

Stops are discovered automatically, so a new control is keyboard-reachable by default instead of only when someone remembers to tag it. Text fields keep their arrows until the caret reaches an edge, then hand over.

Parameters:
NameTypeDefault
__0{ orientation?: RovingOrientation; enterOnMount?: boolean; }
Returns:
{ containerRef: (node: HTMLDivElement | null) => void; handleKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void; }

Buttons

EditorButton

Small icon toolbar button with a tooltip, which also becomes its aria-label.

Parameters:
NameTypeDefault
propsOptimisticButtonProps & Omit<ButtonWithTooltipProps, "tooltipContent" | "tooltipShortcut"> & { tooltip?: string; tooltipContent?: string; tooltipShortcut?: string; }
Returns:
ReactNode

EditorButtonProps

Props of EditorButton. isActive renders it pressed; with optimistic (default) the pressed state flips on click, before the editor state catches up.

NameTypeDefault
isActiveboolean
optimisticboolean
format"sm" | "icon"
translate"yes" | "no" | undefined
type"reset" | "submit" | "button" | undefined
valuestring | number | readonly string[] | undefined
idstring | undefined
childrenReactNode
hiddenboolean | undefined
keyKey | null | undefined
refRef<HTMLButtonElement> | undefined

Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).

disabledboolean | undefined
formstring | undefined
formActionstring | ((formData: FormData) => void | Promise<void>) | undefined
formEncTypestring | undefined
formMethodstring | undefined
formNoValidateboolean | undefined
formTargetstring | undefined
namestring | undefined
size"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined
suppressContentEditableWarningboolean | undefined
suppressHydrationWarningboolean | undefined
accessKeystring | undefined
autoCapitalize"none" | (string & {}) | "off" | "on" | "sentences" | "words" | "characters" | undefined
autoFocusboolean | undefined
classNamestring | ((state: ButtonState) => string | undefined) | undefined

CSS class applied to the element, or a function that returns a class based on the component’s state.

contentEditable"inherit" | Booleanish | "plaintext-only" | undefined
contextMenustring | undefined
dirstring | undefined
draggableBooleanish | undefined
enterKeyHint"search" | "next" | "previous" | "enter" | "done" | "go" | "send" | undefined
langstring | undefined
noncestring | undefined
slotstring | undefined
spellCheckBooleanish | undefined
styleCSSProperties | ((state: ButtonState) => CSSProperties | undefined) | undefined

Style applied to the element, or a function that returns a style object based on the component’s state.

tabIndexnumber | undefined
titlestring | undefined
radioGroupstring | undefined
roleAriaRole | undefined
aboutstring | undefined
contentstring | undefined
datatypestring | undefined
inlistany
prefixstring | undefined
propertystring | undefined
relstring | undefined
resourcestring | undefined
revstring | undefined
typeofstring | undefined
vocabstring | undefined
autoCorrectstring | undefined
autoSavestring | undefined
itemPropstring | undefined
itemScopeboolean | undefined
itemTypestring | undefined
itemIDstring | undefined
itemRefstring | undefined
resultsnumber | undefined
securitystring | undefined
unselectable"off" | "on" | undefined
popover"" | "hint" | "auto" | "manual" | undefined
popoverTargetAction"toggle" | "show" | "hide" | undefined
popoverTargetstring | undefined
inertboolean | undefined
inputMode"none" | "url" | "text" | "search" | "decimal" | "tel" | "email" | "numeric" | undefined

Hints at the type of data that might be entered by the user while editing the element or its contents

isstring | undefined

Specify that a standard HTML element should behave like a defined custom built-in element

exportpartsstring | undefined
partstring | undefined
twstring | undefined

Specify styles using Tailwind CSS classes. This feature is currently experimental. If style prop is also specified, styles generated with tw prop will be overridden.

Example:

  • tw='w-full h-full bg-blue-200'
  • tw='text-9xl'
  • tw='text-[80px]'
aria-activedescendantstring | undefined

Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.

aria-atomicBooleanish | undefined

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

aria-autocomplete"none" | "inline" | "list" | "both" | undefined

Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for an input and specifies how predictions would be presented if they are made.

aria-braillelabelstring | undefined

Defines a string value that labels the current element, which is intended to be converted into Braille.

aria-brailleroledescriptionstring | undefined

Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.

aria-busyBooleanish | undefined
aria-checkedboolean | "true" | "false" | "mixed" | undefined

Indicates the current “checked” state of checkboxes, radio buttons, and other widgets.

aria-colcountnumber | undefined

Defines the total number of columns in a table, grid, or treegrid.

aria-colindexnumber | undefined

Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid.

aria-colindextextstring | undefined

Defines a human readable text alternative of aria-colindex.

aria-colspannumber | undefined

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.

aria-controlsstring | undefined

Identifies the element (or elements) whose contents or presence are controlled by the current element.

aria-currentboolean | "date" | "step" | "page" | "true" | "false" | "time" | "location" | undefined

Indicates the element that represents the current item within a container or set of related elements.

aria-describedbystring | undefined

Identifies the element (or elements) that describes the object.

aria-descriptionstring | undefined

Defines a string value that describes or annotates the current element.

aria-detailsstring | undefined

Identifies the element that provides a detailed, extended description for the object.

aria-disabledBooleanish | undefined

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.

aria-dropeffect"none" | "copy" | "link" | "execute" | "move" | "popup" | undefined

Indicates what functions can be performed when a dragged object is released on the drop target. Deprecated: in ARIA 1.1

aria-errormessagestring | undefined

Identifies the element that provides an error message for the object.

aria-expandedBooleanish | undefined

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

aria-flowtostring | undefined

Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.

aria-grabbedBooleanish | undefined

Indicates an element’s “grabbed” state in a drag-and-drop operation. Deprecated: in ARIA 1.1

aria-haspopupboolean | "true" | "false" | "dialog" | "menu" | "listbox" | "tree" | "grid" | undefined

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

aria-hiddenBooleanish | undefined

Indicates whether the element is exposed to an accessibility API.

aria-invalidboolean | "true" | "false" | "grammar" | "spelling" | undefined

Indicates the entered value does not conform to the format expected by the application.

aria-keyshortcutsstring | undefined

Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.

aria-labelstring | undefined

Defines a string value that labels the current element.

aria-labelledbystring | undefined

Identifies the element (or elements) that labels the current element.

aria-levelnumber | undefined

Defines the hierarchical level of an element within a structure.

aria-live"off" | "assertive" | "polite" | undefined

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

aria-modalBooleanish | undefined

Indicates whether an element is modal when displayed.

aria-multilineBooleanish | undefined

Indicates whether a text box accepts multiple lines of input or only a single line.

aria-multiselectableBooleanish | undefined

Indicates that the user may select more than one item from the current selectable descendants.

aria-orientation"horizontal" | "vertical" | undefined

Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.

aria-ownsstring | undefined

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.

aria-placeholderstring | undefined

Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

aria-posinsetnumber | undefined

Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

aria-pressedboolean | "true" | "false" | "mixed" | undefined

Indicates the current “pressed” state of toggle buttons.

aria-readonlyBooleanish | undefined

Indicates that the element is not editable, but is otherwise operable.

aria-relevant"text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

aria-requiredBooleanish | undefined

Indicates that user input is required on the element before a form may be submitted.

aria-roledescriptionstring | undefined

Defines a human-readable, author-localized description for the role of an element.

aria-rowcountnumber | undefined

Defines the total number of rows in a table, grid, or treegrid.

aria-rowindexnumber | undefined

Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid.

aria-rowindextextstring | undefined

Defines a human readable text alternative of aria-rowindex.

aria-rowspannumber | undefined

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

aria-selectedBooleanish | undefined

Indicates the current “selected” state of various widgets.

aria-setsizenumber | undefined

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

aria-sort"none" | "other" | "ascending" | "descending" | undefined

Indicates if items in a table or grid are sorted in ascending or descending order.

aria-valuemaxnumber | undefined

Defines the maximum allowed value for a range widget.

aria-valueminnumber | undefined

Defines the minimum allowed value for a range widget.

aria-valuenownumber | undefined

Defines the current value for a range widget.

aria-valuetextstring | undefined

Defines the human readable text alternative of aria-valuenow for a range widget.

dangerouslySetInnerHTML{ __html: string | TrustedHTML; } | undefined
onCopy((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCopyCapture((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCut((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCutCapture((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onPaste((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onPasteCapture((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCompositionEnd((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionEndCapture((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionStart((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionStartCapture((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionUpdate((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionUpdateCapture((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onFocus((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onFocusCapture((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onBlur((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onBlurCapture((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onChange((event: BaseUIEvent<ChangeEvent<HTMLButtonElement, Element>>) => void) | undefined
onChangeCapture((event: BaseUIEvent<ChangeEvent<HTMLButtonElement, Element>>) => void) | undefined
onBeforeInput((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onBeforeInputCapture((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onInput((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onInputCapture((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onReset((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onResetCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSubmit((event: BaseUIEvent<SubmitEvent<HTMLButtonElement>>) => void) | undefined
onSubmitCapture((event: BaseUIEvent<SubmitEvent<HTMLButtonElement>>) => void) | undefined
onInvalid((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onInvalidCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoad((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onError((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onErrorCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onKeyDown((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onKeyDownCapture((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onKeyPress((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined

Deprecated: Use onKeyUp or onKeyDown instead

onKeyPressCapture((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined

Deprecated: Use onKeyUpCapture or onKeyDownCapture instead

onKeyUp((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onKeyUpCapture((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onAbort((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onAbortCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlay((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlayCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlayThrough((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlayThroughCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onDurationChange((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onDurationChangeCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEmptied((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEmptiedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEncrypted((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEncryptedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEnded((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEndedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedData((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedDataCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedMetadata((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedMetadataCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadStart((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadStartCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPause((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPauseCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlay((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlayCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlaying((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlayingCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onProgress((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onProgressCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onRateChange((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onRateChangeCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeeked((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeekedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeeking((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeekingCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onStalled((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onStalledCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSuspend((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSuspendCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onTimeUpdate((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onTimeUpdateCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onVolumeChange((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onVolumeChangeCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onWaiting((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onWaitingCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onAuxClick((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onAuxClickCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onClick((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onClickCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onContextMenu((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onContextMenuCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onDoubleClick((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onDoubleClickCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onDrag((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEnd((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEndCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEnter((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEnterCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragExit((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragExitCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragLeave((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragLeaveCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragOver((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragOverCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragStart((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragStartCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDrop((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDropCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onMouseDown((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseDownCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseEnter((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseLeave((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseMove((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseMoveCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOut((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOutCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOver((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOverCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseUp((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseUpCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onSelect((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSelectCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onTouchCancel((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchCancelCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchEnd((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchEndCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchMove((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchMoveCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchStart((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchStartCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onPointerDown((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerDownCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerMove((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerMoveCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerUp((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerUpCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerCancel((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerCancelCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerEnter((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerLeave((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOver((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOverCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOut((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOutCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onGotPointerCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onGotPointerCaptureCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onLostPointerCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onLostPointerCaptureCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onScroll((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onScrollCapture((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onScrollEnd((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onScrollEndCapture((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onWheel((event: BaseUIEvent<WheelEvent<HTMLButtonElement>>) => void) | undefined
onWheelCapture((event: BaseUIEvent<WheelEvent<HTMLButtonElement>>) => void) | undefined
onAnimationStart((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationStartCapture((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationEnd((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationEndCapture((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationIteration((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationIterationCapture((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onToggle((event: BaseUIEvent<ToggleEvent<HTMLButtonElement>>) => void) | undefined
onBeforeToggle((event: BaseUIEvent<ToggleEvent<HTMLButtonElement>>) => void) | undefined
onTransitionCancel((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionCancelCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionEnd((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionEndCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionRun((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionRunCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionStart((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionStartCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
variant"default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined
focusableWhenDisabledboolean | undefined

Whether the button should be focusable when disabled.

false
nativeButtonboolean | undefined

Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).

true
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState> | undefined

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

tooltipClassNamestring
tooltipOptionsTooltipProps
tooltipDelaynumber
tooltipContentOptionsTooltipContentProps
tooltipstring

Tooltip text. Also becomes the button’s aria-label.

tooltipContentstring

Deprecated: Use tooltip instead.

tooltipShortcutstring

Shown beside the tooltip text — inert without tooltip, which names the button.

EditorButtonLarge

Tall ribbon button: icon on top, text label underneath, like Word’s large buttons.

Parameters:
NameTypeDefault
propsEditorButtonLargeProps
Returns:
ReactNode

EditorButtonLargeProps

The button is icon-only unless text is given, so one of the two naming channels has to be present — a nameless variant is a type error, not a runtime surprise.

NameTypeDefault
isActiveboolean
optimisticboolean
format"sm" | "icon"
focusableWhenDisabledboolean | undefined

Whether the button should be focusable when disabled.

false
nativeButtonboolean | undefined

Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).

true
translate"yes" | "no" | undefined
type"reset" | "submit" | "button" | undefined
valuestring | number | readonly string[] | undefined
idstring | undefined
childrenReactNode
hiddenboolean | undefined
keyKey | null | undefined
refRef<HTMLButtonElement> | undefined

Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).

disabledboolean | undefined
formstring | undefined
formActionstring | ((formData: FormData) => void | Promise<void>) | undefined
formEncTypestring | undefined
formMethodstring | undefined
formNoValidateboolean | undefined
formTargetstring | undefined
namestring | undefined
suppressContentEditableWarningboolean | undefined
suppressHydrationWarningboolean | undefined
accessKeystring | undefined
autoCapitalize"none" | (string & {}) | "off" | "on" | "sentences" | "words" | "characters" | undefined
autoFocusboolean | undefined
contentEditable"inherit" | Booleanish | "plaintext-only" | undefined
contextMenustring | undefined
dirstring | undefined
draggableBooleanish | undefined
enterKeyHint"search" | "next" | "previous" | "enter" | "done" | "go" | "send" | undefined
langstring | undefined
noncestring | undefined
slotstring | undefined
spellCheckBooleanish | undefined
tabIndexnumber | undefined
titlestring | undefined
radioGroupstring | undefined
roleAriaRole | undefined
aboutstring | undefined
contentstring | undefined
datatypestring | undefined
inlistany
prefixstring | undefined
propertystring | undefined
relstring | undefined
resourcestring | undefined
revstring | undefined
typeofstring | undefined
vocabstring | undefined
autoCorrectstring | undefined
autoSavestring | undefined
itemPropstring | undefined
itemScopeboolean | undefined
itemTypestring | undefined
itemIDstring | undefined
itemRefstring | undefined
resultsnumber | undefined
securitystring | undefined
unselectable"off" | "on" | undefined
popover"" | "hint" | "auto" | "manual" | undefined
popoverTargetAction"toggle" | "show" | "hide" | undefined
popoverTargetstring | undefined
inertboolean | undefined
inputMode"none" | "url" | "text" | "search" | "decimal" | "tel" | "email" | "numeric" | undefined

Hints at the type of data that might be entered by the user while editing the element or its contents

isstring | undefined

Specify that a standard HTML element should behave like a defined custom built-in element

exportpartsstring | undefined
partstring | undefined
twstring | undefined

Specify styles using Tailwind CSS classes. This feature is currently experimental. If style prop is also specified, styles generated with tw prop will be overridden.

Example:

  • tw='w-full h-full bg-blue-200'
  • tw='text-9xl'
  • tw='text-[80px]'
aria-activedescendantstring | undefined

Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.

aria-atomicBooleanish | undefined

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

aria-autocomplete"none" | "inline" | "list" | "both" | undefined

Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for an input and specifies how predictions would be presented if they are made.

aria-braillelabelstring | undefined

Defines a string value that labels the current element, which is intended to be converted into Braille.

aria-brailleroledescriptionstring | undefined

Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.

aria-busyBooleanish | undefined
aria-checkedboolean | "true" | "false" | "mixed" | undefined

Indicates the current “checked” state of checkboxes, radio buttons, and other widgets.

aria-colcountnumber | undefined

Defines the total number of columns in a table, grid, or treegrid.

aria-colindexnumber | undefined

Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid.

aria-colindextextstring | undefined

Defines a human readable text alternative of aria-colindex.

aria-colspannumber | undefined

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.

aria-controlsstring | undefined

Identifies the element (or elements) whose contents or presence are controlled by the current element.

aria-currentboolean | "date" | "step" | "page" | "true" | "false" | "time" | "location" | undefined

Indicates the element that represents the current item within a container or set of related elements.

aria-describedbystring | undefined

Identifies the element (or elements) that describes the object.

aria-descriptionstring | undefined

Defines a string value that describes or annotates the current element.

aria-detailsstring | undefined

Identifies the element that provides a detailed, extended description for the object.

aria-disabledBooleanish | undefined

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.

aria-dropeffect"none" | "copy" | "link" | "execute" | "move" | "popup" | undefined

Indicates what functions can be performed when a dragged object is released on the drop target. Deprecated: in ARIA 1.1

aria-errormessagestring | undefined

Identifies the element that provides an error message for the object.

aria-expandedBooleanish | undefined

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

aria-flowtostring | undefined

Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.

aria-grabbedBooleanish | undefined

Indicates an element’s “grabbed” state in a drag-and-drop operation. Deprecated: in ARIA 1.1

aria-haspopupboolean | "true" | "false" | "dialog" | "menu" | "listbox" | "tree" | "grid" | undefined

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

aria-hiddenBooleanish | undefined

Indicates whether the element is exposed to an accessibility API.

aria-invalidboolean | "true" | "false" | "grammar" | "spelling" | undefined

Indicates the entered value does not conform to the format expected by the application.

aria-keyshortcutsstring | undefined

Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.

aria-labelstring | undefined

Defines a string value that labels the current element.

aria-labelledbystring | undefined

Identifies the element (or elements) that labels the current element.

aria-levelnumber | undefined

Defines the hierarchical level of an element within a structure.

aria-live"off" | "assertive" | "polite" | undefined

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

aria-modalBooleanish | undefined

Indicates whether an element is modal when displayed.

aria-multilineBooleanish | undefined

Indicates whether a text box accepts multiple lines of input or only a single line.

aria-multiselectableBooleanish | undefined

Indicates that the user may select more than one item from the current selectable descendants.

aria-orientation"horizontal" | "vertical" | undefined

Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.

aria-ownsstring | undefined

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.

aria-placeholderstring | undefined

Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

aria-posinsetnumber | undefined

Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

aria-pressedboolean | "true" | "false" | "mixed" | undefined

Indicates the current “pressed” state of toggle buttons.

aria-readonlyBooleanish | undefined

Indicates that the element is not editable, but is otherwise operable.

aria-relevant"text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

aria-requiredBooleanish | undefined

Indicates that user input is required on the element before a form may be submitted.

aria-roledescriptionstring | undefined

Defines a human-readable, author-localized description for the role of an element.

aria-rowcountnumber | undefined

Defines the total number of rows in a table, grid, or treegrid.

aria-rowindexnumber | undefined

Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid.

aria-rowindextextstring | undefined

Defines a human readable text alternative of aria-rowindex.

aria-rowspannumber | undefined

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

aria-selectedBooleanish | undefined

Indicates the current “selected” state of various widgets.

aria-setsizenumber | undefined

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

aria-sort"none" | "other" | "ascending" | "descending" | undefined

Indicates if items in a table or grid are sorted in ascending or descending order.

aria-valuemaxnumber | undefined

Defines the maximum allowed value for a range widget.

aria-valueminnumber | undefined

Defines the minimum allowed value for a range widget.

aria-valuenownumber | undefined

Defines the current value for a range widget.

aria-valuetextstring | undefined

Defines the human readable text alternative of aria-valuenow for a range widget.

dangerouslySetInnerHTML{ __html: string | TrustedHTML; } | undefined
onCopy((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCopyCapture((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCut((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCutCapture((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onPaste((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onPasteCapture((event: BaseUIEvent<ClipboardEvent<HTMLButtonElement>>) => void) | undefined
onCompositionEnd((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionEndCapture((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionStart((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionStartCapture((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionUpdate((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onCompositionUpdateCapture((event: BaseUIEvent<CompositionEvent<HTMLButtonElement>>) => void) | undefined
onFocus((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onFocusCapture((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onBlur((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onBlurCapture((event: BaseUIEvent<FocusEvent<HTMLButtonElement, Element>>) => void) | undefined
onChange((event: BaseUIEvent<ChangeEvent<HTMLButtonElement, Element>>) => void) | undefined
onChangeCapture((event: BaseUIEvent<ChangeEvent<HTMLButtonElement, Element>>) => void) | undefined
onBeforeInput((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onBeforeInputCapture((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onInput((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onInputCapture((event: BaseUIEvent<InputEvent<HTMLButtonElement>>) => void) | undefined
onReset((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onResetCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSubmit((event: BaseUIEvent<SubmitEvent<HTMLButtonElement>>) => void) | undefined
onSubmitCapture((event: BaseUIEvent<SubmitEvent<HTMLButtonElement>>) => void) | undefined
onInvalid((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onInvalidCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoad((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onError((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onErrorCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onKeyDown((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onKeyDownCapture((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onKeyPress((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined

Deprecated: Use onKeyUp or onKeyDown instead

onKeyPressCapture((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined

Deprecated: Use onKeyUpCapture or onKeyDownCapture instead

onKeyUp((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onKeyUpCapture((event: BaseUIEvent<KeyboardEvent<HTMLButtonElement>>) => void) | undefined
onAbort((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onAbortCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlay((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlayCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlayThrough((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onCanPlayThroughCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onDurationChange((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onDurationChangeCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEmptied((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEmptiedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEncrypted((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEncryptedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEnded((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onEndedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedData((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedDataCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedMetadata((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadedMetadataCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadStart((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onLoadStartCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPause((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPauseCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlay((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlayCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlaying((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onPlayingCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onProgress((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onProgressCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onRateChange((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onRateChangeCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeeked((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeekedCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeeking((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSeekingCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onStalled((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onStalledCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSuspend((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSuspendCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onTimeUpdate((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onTimeUpdateCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onVolumeChange((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onVolumeChangeCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onWaiting((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onWaitingCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onAuxClick((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onAuxClickCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onClick((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onClickCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onContextMenu((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onContextMenuCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onDoubleClick((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onDoubleClickCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onDrag((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEnd((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEndCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEnter((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragEnterCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragExit((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragExitCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragLeave((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragLeaveCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragOver((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragOverCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragStart((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDragStartCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDrop((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onDropCapture((event: BaseUIEvent<DragEvent<HTMLButtonElement>>) => void) | undefined
onMouseDown((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseDownCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseEnter((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseLeave((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseMove((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseMoveCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOut((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOutCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOver((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseOverCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseUp((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onMouseUpCapture((event: BaseUIEvent<MouseEvent<HTMLButtonElement, MouseEvent>>) => void) | undefined
onSelect((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onSelectCapture((event: BaseUIEvent<SyntheticEvent<HTMLButtonElement, Event>>) => void) | undefined
onTouchCancel((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchCancelCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchEnd((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchEndCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchMove((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchMoveCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchStart((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onTouchStartCapture((event: BaseUIEvent<TouchEvent<HTMLButtonElement>>) => void) | undefined
onPointerDown((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerDownCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerMove((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerMoveCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerUp((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerUpCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerCancel((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerCancelCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerEnter((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerLeave((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOver((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOverCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOut((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onPointerOutCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onGotPointerCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onGotPointerCaptureCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onLostPointerCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onLostPointerCaptureCapture((event: BaseUIEvent<PointerEvent<HTMLButtonElement>>) => void) | undefined
onScroll((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onScrollCapture((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onScrollEnd((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onScrollEndCapture((event: BaseUIEvent<UIEvent<HTMLButtonElement, UIEvent>>) => void) | undefined
onWheel((event: BaseUIEvent<WheelEvent<HTMLButtonElement>>) => void) | undefined
onWheelCapture((event: BaseUIEvent<WheelEvent<HTMLButtonElement>>) => void) | undefined
onAnimationStart((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationStartCapture((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationEnd((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationEndCapture((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationIteration((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onAnimationIterationCapture((event: BaseUIEvent<AnimationEvent<HTMLButtonElement>>) => void) | undefined
onToggle((event: BaseUIEvent<ToggleEvent<HTMLButtonElement>>) => void) | undefined
onBeforeToggle((event: BaseUIEvent<ToggleEvent<HTMLButtonElement>>) => void) | undefined
onTransitionCancel((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionCancelCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionEnd((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionEndCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionRun((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionRunCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionStart((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
onTransitionStartCapture((event: BaseUIEvent<TransitionEvent<HTMLButtonElement>>) => void) | undefined
classNamestring | ((state: ButtonState) => string | undefined) | undefined

CSS class applied to the element, or a function that returns a class based on the component’s state.

renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState> | undefined

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

styleCSSProperties | ((state: ButtonState) => CSSProperties | undefined) | undefined

Style applied to the element, or a function that returns a style object based on the component’s state.

size"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined
variant"default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined
tooltipstring

Explanatory hover text. The label below the icon already names the button, so this is for state the label can’t carry — why it is locked, what it will do. Omit it for the ordinary case.

tooltipShortcutstring

A keyboard shortcut, in the tooltip after tooltip or, without one, the label (as Word shows it).

textstring | undefined

EditorButtonLargeDropdown

EditorButtonLarge that opens a dropdown; buttonContent is the icon and children the menu content.

Parameters:
NameTypeDefault
propsEditorButtonLargeProps & { buttonContent: ReactNode; }
Returns:
ReactNode

EditorSplitButton

Split button: the primary half applies the action (onClick), the chevron opens children as a dropdown. Arrow Down on either half opens it too.

Parameters:
NameTypeDefault
propsButtonHTMLAttributes<HTMLButtonElement> & SplitButtonProps & OptimisticButtonProps & { ...; }
Returns:
ReactNode

EditorSplitButtonLarge

Tall split button, as Word’s Shading and Borders: the icon half applies the action (onClick), the label half below opens children as a dropdown. Arrow Down on the icon half opens it too. Same geometry as EditorButtonLarge.

Parameters:
NameTypeDefault
props{ text: string; moreOptionsLabel: string; icon: ReactNode; children: ReactNode; disabled?: boolean; isActive?: boolean; onClick: () => void; onOpenChange?: (open: boolean) => void; }
Returns:
ReactNode

Color picker

ColorPicker

Swatch grid with recent colors, a reset row and a fine picker behind “More”. The host owns the recent list (recentColors, addRecentColor) and every label.

Parameters:
NameTypeDefault
propsColorPickerBaseProps & { options?: ColorPickerOptions; recentColors: string[]; addRecentColor: (color: string) => void; labels: ColorPickerLabels; theme?: ColorPickerTheme; }
Returns:
ReactNode

ColorPickerLabels

Every user-visible string the picker renders. This package carries no i18n dependency on purpose, so the whole set arrives from the consumer and a missing one is a type error rather than shipped English.

NameTypeDefault
palettestring

Names the main swatch grid.

recentColorsstring

Names the recently-used swatch grid.

highlightColorsstring

Names the highlight swatch grid.

moreColorsstring

Opens the fine picker.

backstring

Returns from the fine picker to the swatch grid.

applystring

Commits the fine picker’s value.

nonestring

The reset entry. “Automatic” reads better than “None” where the value falls back to a computed default.

hexstring

Names the hex field.

rgbstring

Names the RGB field group.

redstring
greenstring
bluestring
useStyleSheetValuestring

Drops direct formatting back to the stylesheet value.

ColorPickerTheme

Word’s theme grid and Standard Colors, in place of the default palette. currentRef selects by ref, so a themed value stays selected after a theme switch changes its hex.

NameTypeDefault
swatchesreadonly (readonly ThemeSwatch[])[]
currentRefstring | null
labelsColorPickerThemeLabels

ColorPickerThemeLabels

The theme section’s strings, from the consumer like the rest.

NameTypeDefault
themeColorsstring

Heads the theme grid.

standardColorsstring

Heads Word’s ten standard colours.

namesRecord<ThemeSwatchColumn, string>

Each grid column’s name (“Accent 1”).

lighter(percent: number) => string

A variant’s suffix: “Lighter 80%”, “Darker 25%”.

darker(percent: number) => string

Dialogs

Use the parts as you would Dialog’s; on compact viewports the same tree renders as a bottom drawer.

ResponsiveDialog

Dialog on desktop, bottom drawer on compact viewports; its parts mirror Dialog’s one for one.

Parameters:
NameTypeDefault
__0ResponsiveDialogProps
Returns:
Element

ResponsiveDialogTrigger

Opens the surrounding ResponsiveDialog.

Parameters:
NameTypeDefault
__0DialogTrigger.Props<unknown> & DrawerTrigger.Props<unknown>
Returns:
Element

ResponsiveDialogContent

The dialog or drawer popup, with a close button labelled by closeLabel.

Parameters:
NameTypeDefault
__0ResponsiveDialogContentProps
Returns:
Element

ResponsiveDialogHeader

Header block for the title.

Parameters:
NameTypeDefault
__0DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
Returns:
Element

ResponsiveDialogTitle

The dialog’s title, which also names it for assistive technology.

Parameters:
NameTypeDefault
__0DialogTitleProps & DrawerTitleProps
Returns:
Element

ResponsiveDialogFooter

Footer row for the dialog’s actions.

Parameters:
NameTypeDefault
__0DialogFooterProps
Returns:
Element

useIsCompactLayout

True on phone-sized viewports.

Every compact-layout decision in the editor reads this, so the breakpoint lives in exactly one place. It sits in this package rather than editor-react so ResponsiveDialog can share it without an illegal dependency; editor-react re-exports it from its own hooks barrel.

Server renders and the first client paint report false (the wide layout); it corrects on hydration.

Parameters:
This function does not accept any parameters.
Returns:
boolean

Whether the viewport is narrower than the compact breakpoint.

Context menus

Items for a ContextMenuExtension element. See Customizing the Menus.

EditorContextMenu

Context-menu item with an optional leading icon and trailing shortcut hint, in the platform’s notation.

Parameters:
NameTypeDefault
props{ children: ReactNode; icon?: ReactNode; shortcut?: string; inset?: boolean; } & MenuItemProps
Returns:
ReactNode

Fields

UnitNumberField

The visual half of UnitNumberPicker: a unit-suffixed text input with a preset dropdown, controlled by its TEXT rather than by a number.

Split out for forms that validate what the user typed — "", “abc”, a value past its bound — which a number-controlled field cannot express, since the value that would carry the error is the one that fails to parse.

Parameters:
NameTypeDefault
propsUnitNumberFieldProps
Returns:
ReactNode

UnitNumberPicker

A px-valued number input shown in the user’s display unit. Commits on Enter and on picking a preset, always; on blur only after an edit, so tabbing through doesn’t pin the shown (often inherited) value. Unparseable text reverts on blur. null (mixed, or nothing to show) renders blank.

Forms that must SHOW why an entry is rejected use UnitNumberField directly and own the text themselves — the value carrying the error is exactly the one this component refuses to commit.

Parameters:
NameTypeDefault
props{ id?: string; value: number | null; onValueChange: (pxValue: number) => void; unit: DisplayUnit; className?: string; disabled?: boolean; presets?: number[]; presetsLabel: string; "aria-label"?: string; "aria-labelledby"?: string; }
Returns:
ReactNode

InfoTooltip

An info icon that shows children in a tooltip, for help text that would otherwise sit under a label. Focusable, and the text is its accessible name, so keyboard and screen-reader users get it without hovering.

Parameters:
NameTypeDefault
props{ children: string; className?: string; }
Returns:
ReactNode

Panels

useRowLeave

Fades a panel list row out and collapses it before it goes, as the checker panels’ Ignore does.

A list row that fades and collapses before it goes (panels.css, stesura-panel-row-leave). leave() starts it and onLeft runs once at its end: at once under reduced motion or when nothing animates (a hidden panel, overridden CSS), and after a timeout if animationend never comes. Put bind (a ref callback), className and onAnimationEnd on the row; give it a single child.

Parameters:
NameTypeDefault
onLeft() => void
Returns:
{ leaving: boolean; leave: () => void; bind: (el: HTMLElement | null) => (() => void) | undefined; className: string | undefined; onAnimationEnd: ((event: AnimationEvent<HTMLElement>) => void) | undefined; }
Last updated on