On this page
@addTagHelper *, Webority.Ui.RazorA strip of tools
Use a toolbar for a strip of tools over a canvas, where the active tool expands to show its label.
Click across the tools
Momentary actions
Add commands beside the tools, after a divider, for actions that fire once and never stay selected.
Tools plus actions
Disabled tools
Disable one tool to keep it visible but unpickable, or disable the whole strip when nothing can be picked.
One tool off, then everything off
Every option
Every value of every prop, one cell each.
items
items: five tools
items: three tools
items: with a disabled tool
items: empty strip
actions
actions: none (default)
actions: two momentary buttons
value
value="select"
value="draw"
value="shape"
value="text"
value="comment"
defaultValue
value="select" (React: defaultValue)
value="draw" (React: defaultValue)
value="shape" (React: defaultValue)
value="text" (React: defaultValue)
value="comment" (React: defaultValue)
onChange
onChange (React only): fires with the picked tool; Razor posts the pick with the form
label
label: names the toolbar for screen readers
name
name: groups the radios and posts with a form
disabled
disabled: off (default)
disabled: whole strip off
className
class: extra class on the toolbar element (React: className)
Guidance
What to do, and what to avoid.
Use it when
- A work surface (canvas, editor, board) where the user picks the tool in hand.
- The set is small and icon-first, with one clearly active tool.
- Commands that belong beside the tools ride along as momentary actions.
Reach for something else when
- You are choosing a form value, such as view mode, period or theme. → AppSegmented
- The icons are row or record actions in a table or header. → AppActionIcon
- You want navigation shortcuts on a marketing page. → AppFloatingDock
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
5 props. The 3 most used come first.
Used on most screens 3 props
| Prop | Type | Default | Description |
|---|---|---|---|
| labeldefault - | string | - | Accessible name for the toolbar. |
| valuedefault - | string | - | The active tool's value (controlled). |
| disableddefault false | bool | false | Disables the whole toolbar. |
Less common 2 props
| Prop | Type | Default | Description |
|---|---|---|---|
| (children)default - | app-toolbar-item | - | The tools, left to right. One child element per tool. |
| namedefault generated | string | generated | Field name grouping the radios, and what posts in a form. Defaults to a generated one. |
Screen reader
3 notes- The strip has role toolbar, named by the label prop, and aria-disabled when the whole toolbar is disabled.
- Tools are real radio inputs inside labels, so arrow keys move between them, the strip is one tab stop and screen readers announce the choice.
- Momentary actions are buttons named by their title, and the expand and collapse motion honours reduced motion.