On this page
@addTagHelper *, Webority.Ui.RazorVariants
Keep the split on the main action's fill, and use danger only when the main action destroys something.
Outline and danger
Every option
Every value of every prop, one cell each.
label
label: the main button's text, also the group's accessible nameitems
app-split-button-item image="...": an image before the item's textapp-split-button-item href="#reply": the item is a link (React: to)(default): no rows, the chevron opens an empty menuapp-split-button-item: the save menu, with a divider and a shortcutapp-split-button-item: the reply menu, two rows with iconsapp-split-button-item tone="danger": the danger menu, a row in the danger toneonClick
onClick: React only, a callback run when the main button is pressedhref
(default): no href, the main button is a buttonhref="#save": the main button is a linktype
type="button" (default)type="submit"type="reset"tone
tone="primary" (default)tone="success"tone="warning"tone="danger"tone="info"tone="neutral"variant
variant="solid" (default)variant="soft"variant="outline"variant="ghost"variant="link"variant="glass"size
size="sm"size="md" (default)size="lg"disabled
disabled="false" (default): both halves enableddisabled="true": both halves disabledloading
loading="false" (default): no spinnerloading="true": the spinner shows on the main button and both halves are disabledleft-icon
(default): no icon before the labelleft-icon="file-text": a library icon before the labelshortcut
(default): no key chipshortcut="D": a key chip after the label runs the main actionmenu-label
menu-label="More actions" (default): the accessible name of the chevronmenu-label="Actions": the chevron is named Actionsalign
align="end" (default): the menu lines up with the end edgealign="start": the menu lines up with the start edgelinkComponent
linkComponent: React only; Razor items take href, a plain linkclassName
className: React only; Razor takes a plain class attributeGuidance
What to do, and what to avoid.
Use it when
- A primary action with two or three close alternatives (save and close, reply all).
- A default the user can change without leaving the screen.
Reach for something else when
- Several equal actions. → AppButtonGroup
- A menu with no main action. → AppDropdown
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
12 props. The 4 most used come first.
Used on most screens 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| labeldefault - | string | - | The main button's text, also the group's accessible name. |
| tonedefault primary | primary | success | warning | danger | info | neutral | primary | Both halves share it. |
| variantdefault solid | solid | soft | outline | ghost | link | glass | solid | Both halves share it. |
| sizedefault md | sm | md | lg | md | The size of both halves. |
Less common 8 props
| Prop | Type | Default | Description |
|---|---|---|---|
| typedefault button | button | submit | reset | button | The main button's type. |
| hrefdefault - | string | - | Makes the main button a link. |
| disableddefault false | bool | false | Disables both halves. |
| loadingdefault false | bool | false | Shows the spinner on the main button and disables both halves. |
| left-icondefault - | string | - | The icon name before the main label. |
| shortcutdefault - | string | - | The key that runs the main action, drawn as a key chip after the label. |
| menu-labeldefault More actions | string | More actions | The accessible name of the chevron. |
| aligndefault end | start | end | end | Which edge the menu lines up with. |
Screen reader
3 notes- The two halves are one group (role group) named by label.
- The chevron is named by menuLabel; Enter or Space on it opens the menu, arrows move, Escape closes it and returns focus to the chevron.
- Disabled or loading disables both halves.