@lexical/a11y
Interfaces
AriaLiveRegionExtensionConfig
Defined in: packages/lexical-a11y/src/index.ts:459
Properties
owner
owner:
HTMLElement|null
Defined in: packages/lexical-a11y/src/index.ts:467
Owner element to append the live region to. null falls back to
document.body; an explicit element keeps the region in the same
accessibility subtree as the editor (shadow root or portaled overlay).
politeness
politeness:
AriaPoliteness
Defined in: packages/lexical-a11y/src/index.ts:461
AriaPoliteness for the mounted region.
EditorModeAnnounceExtensionConfig
Defined in: packages/lexical-a11y/src/index.ts:631
Properties
disabled
disabled:
boolean
Defined in: packages/lexical-a11y/src/index.ts:641
When true, editable / read-only transitions are not announced. Toggle
at runtime via the output signal. Default false. Announcements are
transition-based (like the initial mount, which is silent), so toggling
disabled back to false while the editor is already read-only does not
re-announce the current mode — the next setEditable transition does.
editable
editable:
string
Defined in: packages/lexical-a11y/src/index.ts:633
Message announced when the editor becomes editable.
readOnly
readOnly:
string
Defined in: packages/lexical-a11y/src/index.ts:635
Message announced when the editor becomes read-only.
FocusManagerOptions
Defined in: packages/lexical-a11y/src/index.ts:375
Properties
toolbarItemSelector?
optionaltoolbarItemSelector?:string
Defined in: packages/lexical-a11y/src/index.ts:382
Selector used to find the toolbar's first focusable item when
activating via the shortcut. Defaults to non-disabled direct-child
buttons (the same scope used by registerRovingTabIndex), so the
active roving item naturally receives focus.
FocusTrapOptions
Defined in: packages/lexical-a11y/src/index.ts:100
Properties
allowOutside?
optionalallowOutside?: (target) =>boolean
Defined in: packages/lexical-a11y/src/index.ts:119
Predicate that exempts an element from the pull-back. When it
returns true for event.target, the focusin handler lets focus
stay outside the container. Useful for portaled panels (e.g.
autocomplete popups) that live outside the trap container yet
logically belong to it.
Parameters
target
HTMLElement
Returns
boolean
initialFocus?
optionalinitialFocus?:FocusTrapInitialFocus
Defined in: packages/lexical-a11y/src/index.ts:111
Where to land focus when the trap activates:
'firstFocusable'(default): focus the first focusable descendant.'container': focus the container itself. The container must satisfytabIndex >= -1; callers typically settabIndex={-1}to keep it out of the natural Tab order while remaining programmatically focusable. Use for dialogs whose first focusable is a dismiss/close action so the user lands on the dialog body and screen readers announce the dialog label before any control.
HistoryAnnounceExtensionConfig
Defined in: packages/lexical-a11y/src/index.ts:576
Properties
disabled
disabled:
boolean
Defined in: packages/lexical-a11y/src/index.ts:583
When true, undo / redo are not announced. Toggle at runtime via the
output signal. Default false.
redone
redone:
string
Defined in: packages/lexical-a11y/src/index.ts:580
Message announced after a redo.
undone
undone:
string
Defined in: packages/lexical-a11y/src/index.ts:578
Message announced after an undo.
RovingTabIndexOptions
Defined in: packages/lexical-a11y/src/index.ts:232
Properties
itemSelector?
optionalitemSelector?:string
Defined in: packages/lexical-a11y/src/index.ts:245
Selector for the group's roving items. The default matches direct-child
non-disabled buttons. Pass a custom selector to include other focusables
or to scope to a marker attribute (e.g. [data-roving-item]).
orientation?
optionalorientation?:RovingOrientation
Defined in: packages/lexical-a11y/src/index.ts:239
Which arrow keys move focus.
horizontal(default): ArrowLeft / ArrowRightvertical: ArrowUp / ArrowDownboth: any arrow key
Type Aliases
AriaLiveRegion
AriaLiveRegion =
NamedSignalsOutput<AriaLiveRegionExtensionConfig> &object
Defined in: packages/lexical-a11y/src/index.ts:477
Public output of AriaLiveRegionExtension. The politeness and
owner config values are exposed as runtime-tunable signals — setting
politeness updates the mounted region's aria-live, setting owner
re-mounts the region — alongside a stable announce sink that is valid for
the editor's lifetime (callers never see the region element or its disposal).
Type Declaration
announce
announce: (
message) =>void
Write a message into the editor's live region. Announcing the same
string back-to-back appends a zero-width space so screen readers
register the change and re-announce. A no-op until a region is mounted
(the editor has a root element, or an owner is configured).
Parameters
message
string
Returns
void
AriaPoliteness
AriaPoliteness =
"polite"|"assertive"
Defined in: packages/lexical-a11y/src/index.ts:34
ContainerRegistry
ContainerRegistry<
Options> =RefCountedRegistry<HTMLElement,Options>
Defined in: packages/lexical-a11y/src/index.ts:685
The public output of the focus-trap, roving-tabindex and focus-manager
extensions: register a container (reference counted) and get back an
idempotent disposer. Callers register through this method instead of a
mutable map and never see the container bookkeeping. It is the core
RefCountedRegistry keyed by HTMLElement.
Each extension creates the registry in build (where the editor is
available for the per-container activation) and disposes it on register
teardown via RefCountedRegistry.dispose.
Type Parameters
Options
Options
FocusTrapInitialFocus
FocusTrapInitialFocus =
"firstFocusable"|"container"
Defined in: packages/lexical-a11y/src/index.ts:98
RovingOrientation
RovingOrientation =
"horizontal"|"vertical"|"both"
Defined in: packages/lexical-a11y/src/index.ts:230
Variables
AriaLiveRegionExtension
constAriaLiveRegionExtension:LexicalExtension<AriaLiveRegionExtensionConfig,"@lexical/a11y/AriaLiveRegion",AriaLiveRegion,Signal<string>>
Defined in: packages/lexical-a11y/src/index.ts:506
Platform-independent extension that owns a single aria-live region for
the editor and exposes a stable AriaLiveRegion sink as its output.
Other a11y extensions (HistoryAnnounceExtension,
EditorModeAnnounceExtension) depend on it and announce through
output.announce.
The sink writes to a private message signal created in init. The
politeness / owner config are exposed as signals (via namedSignals).
register tracks the editor's root element reactively and runs three
effects: one creates / disposes the region element as the root document (or
owner) changes, one applies the current politeness to the mounted region,
and one mirrors the current message into it. Buffering through signals
decouples the stable announce (from build) from the region element —
which comes and goes with the root — and creates the region in the editor's
own document (e.g. an iframe-portaled editor) rather than the top-level
document.
EditorModeAnnounceExtension
constEditorModeAnnounceExtension:LexicalExtension<EditorModeAnnounceExtensionConfig,"@lexical/a11y/EditorModeAnnounce",NamedSignalsOutput<EditorModeAnnounceExtensionConfig>,unknown>
Defined in: packages/lexical-a11y/src/index.ts:649
Platform-independent extension that announces
editor.setEditable(true|false) transitions through the
AriaLiveRegionExtension's shared sink.
FocusManagerExtension
constFocusManagerExtension:LexicalExtension<ExtensionConfigBase,"@lexical/a11y/FocusManager",ContainerRegistry<FocusManagerOptions>,unknown>
Defined in: packages/lexical-a11y/src/index.ts:722
Platform-independent extension that wires the editor-to-toolbar focus jump
(Alt+F10 / Escape return) on one or more toolbars. Register a toolbar
through the extension output (ContainerRegistry.register); the React
adapter is useLexicalFocusManagerRef from @lexical/react.
FocusTrapExtension
constFocusTrapExtension:LexicalExtension<ExtensionConfigBase,"@lexical/a11y/FocusTrap",ContainerRegistry<FocusTrapOptions>,unknown>
Defined in: packages/lexical-a11y/src/index.ts:696
Platform-independent extension that traps Tab / Shift+Tab focus inside one
or more containers. Register a container through the extension output
(ContainerRegistry.register); the React adapter is
useLexicalFocusTrapRef from @lexical/react.
HistoryAnnounceExtension
constHistoryAnnounceExtension:LexicalExtension<HistoryAnnounceExtensionConfig,"@lexical/a11y/HistoryAnnounce",NamedSignalsOutput<HistoryAnnounceExtensionConfig>,unknown>
Defined in: packages/lexical-a11y/src/index.ts:590
Platform-independent extension that announces undo / redo through the
AriaLiveRegionExtension's shared sink.
RovingTabIndexExtension
constRovingTabIndexExtension:LexicalExtension<ExtensionConfigBase,"@lexical/a11y/RovingTabIndex",ContainerRegistry<RovingTabIndexOptions>,unknown>
Defined in: packages/lexical-a11y/src/index.ts:709
Platform-independent extension that wires the WAI-ARIA roving-tabindex
pattern on one or more containers. Register a container through the
extension output (ContainerRegistry.register); the React adapter is
useLexicalRovingTabIndexRef from @lexical/react.