Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Blocks
  2. Floating Toolbar
  3. API and Development

Floating Toolbar

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import FloatingToolbar, FloatingToolbarPlacement from @prepared911/ui/blocks/floating-toolbar. See props.ts for the props and schema.ts for the declaration (inputs and variants).
PropTypeDefault
labelLocalizedMessagerequired
actionsreadonly FloatingToolbarAction[]required
placementFloatingToolbarPlacementBlockEndCenter
inset4 | 8 | 1616
minimizedbooleanuncontrolled
defaultMinimizedbooleanfalse
onMinimizedChange(minimized: boolean, details: FloatingToolbarMinimizeDetails) => voidnone
minimizeLabelLocalizedMessage (name and tooltip of the X control)required
moreLabelLocalizedMessagerequired
moreIconGlyphnone (text)
classNamestringnone
refRef<HTMLDivElement> (the role="toolbar" element)none
idstring (the placement layer)none
Actions
FieldCommandToggle
idrequiredrequired
labelrequired LocalizedMessagerequired LocalizedMessage
iconoptional Glyphoptional Glyph
disabledoptionaloptional
pinnedoptional, default falseoptional, default false
intentoptional ButtonIntentnot allowed
onActionrequired () => voidnot allowed
pressednot allowedrequired boolean
onPressedChangenot allowedrequired (pressed: boolean) => void
Placement
FloatingToolbarPlacement: BlockEndCenter, BlockEndStart, BlockEndEnd, BlockStartCenter, BlockStartStart, BlockStartEnd. The toolbar is always a horizontal row, so there is no inline-edge placement (FT-14).
Minimize control
The control is an icon-only Button that shows the X glyph, named and described by minimizeLabel. There is no icon prop to replace the glyph (FT-12).
Props
NameTypeDefaultDescription
actionsreadonly FloatingToolbarAction[]—The call-taking actions in display order. Each one is a labelled Button in the bar, or a row in the overflow menu when the bar has no room for it.
labelLocalizedMessage—Accessible name of the toolbar (role="toolbar"), such as "Call actions".
minimizeLabelLocalizedMessage—Name of the minimize control. The control is an icon-only Button that shows the X glyph; this is its accessible name and its tooltip.
moreLabelLocalizedMessage—Name of the overflow control, which opens the menu of actions the bar has no room for.
classNamestring—Classes appended to the placement layer.
defaultMinimizedbooleanfalseInitial minimized state when uncontrolled.
idstring—Id of the placement layer.
insetToolbarInset16Space between the workspace edge and the toolbar, as a space-token step: 4, 8, or 16. The default clears a classic scrollbar gutter on a scroll region that fills the workspace.
minimizedboolean—Controlled minimized state. When true the toolbar animates out, is inert and hidden, and the host offers the way back, normally an item in its Dock. Pair with onMinimizedChange; without it the toolbar keeps its own state and nothing but the host can restore it.
moreIconGlyph—Glyph of the overflow control. With it the control is an icon-only Button named by moreLabel; without it the control shows moreLabel as text.
onMinimizedChange((minimized: boolean, details: FloatingToolbarMinimizeDetails) => void)—Called when the minimize control is pressed, with true and the pressing event and control in the details. Restoring is the host's call: it sets minimized back to false when its Dock item is pressed, so the toolbar never calls this with false. Cancel the details to keep the toolbar in place. @param minimized - The requested state @param details - Change metadata
placementFloatingToolbarPlacementFloatingToolbarPlacement.BlockEndCenterBlock edge (top or bottom) and alignment inside the workspace. The toolbar is positioned by layout, never by coordinates, and is always a horizontal row.
refRef<HTMLDivElement>—Ref to the role="toolbar" element.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Floating Toolbar / Usage
Next
Floating Toolbar / Accessibility
On this page
Actions
Placement
Minimize control
Props
Storybook