Split Button
One primary action plus a menu of close variants. The first menu item must match the visible label.
Sizes and variants
Hesoyam sizes are small, medium, large. Variants are default and secondary. sm / lg still map through.
Last action: —
1
<SplitButton
2
menu-button-label="Select save method"
3
:button-props="{ size: 'small', variant: 'default', onClick: () => run('Save') }"
4
:menu-props="{ width: 264 }"
5
>
6
Save
7
<template #menuItems>
8
<SplitButtonMenuItem
9
title="Save"
10
description="Save changes"
11
:menu-item-props="{ onClick: () => run('Save') }"
12
/>
13
<SplitButtonMenuItem
14
title="Save + Redeploy"
15
description="Save changes and create a new production deployment"
16
:menu-item-props="{ onClick: () => run('Save + Redeploy') }"
17
/>
18
</template>
19
</SplitButton>
Menu alignment
bottom-start (default) lines up under the primary. bottom-end when the control sits on the right edge.
Icon
Slot an icon on each menu item. Keep the glyph at 16px.
1
<SplitButton
2
menu-button-label="Copy page"
3
:button-props="{ size: 'small', variant: 'secondary' }"
4
:menu-props="{ width: 240 }"
5
>
6
Copy page
7
<template #menuItems>
8
<SplitButtonMenuItem
9
title="Open in v0"
10
description="Open this page in v0"
11
>
12
<template #icon>
13
<Icon :icon="SparklesIcon" :size="16" />
14
</template>
15
</SplitButtonMenuItem>
16
</template>
17
</SplitButton>
Title with icon
The title slot can hold a glyph plus the verb. Description stays plain text.
Disabled
Best practices
- Use a Split Button when one action is the default and 1–4 close variants sit next to it. Unrelated actions belong in a Menu.
- Repeat the primary action as the first menu item. The visible label and that title must match exactly.
- Stay on
defaultorsecondary. Destructive work does not hide behind the chevron.secondarymaps to the buttonoutlinealias internally. - Title Case every item. Verb + noun: Deploy to Production, Promote to Production. Put danger at the bottom.
menu-button-labelis required. It becomes the chevron'saria-label— the only name a screen reader hears for that button. Write a sentence: More deploy options.- Prefer the
#menuItemsslot. Themenu-itemsprop accepts VNodes when a parent builds the list in script.