On this page

Split button

Install, props and the parts Split button is built from.

Install

Run these in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/button.json
npx shadcn-vue@latest add https://beehexa.design/r/button-group.json
npx shadcn-vue@latest add https://beehexa.design/r/dropdown-menu.json

Use

<script setup lang="ts">
import { ChevronDown } from '@lucide/vue'
import { Button } from '@/components/ui/button'
import { ButtonGroup } from '@/components/ui/button-group'
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
</script>

<template>
  <ButtonGroup aria-label="Run sync">
    <Button>Run now</Button>
    <DropdownMenu>
      <DropdownMenuTrigger as-child>
        <Button size="icon" aria-label="More ways to run"><ChevronDown /></Button>
      </DropdownMenuTrigger>
      <DropdownMenuContent align="end">
        <DropdownMenuItem>Run in test mode</DropdownMenuItem>
        <DropdownMenuItem>Run for one store</DropdownMenuItem>
        <DropdownMenuItem>Schedule…</DropdownMenuItem>
      </DropdownMenuContent>
    </DropdownMenu>
  </ButtonGroup>
</template>

Props

Prop Values Notes
ButtonGroup aria-label string Names the action, such as “Run sync”
Menu half aria-label string Its own name, such as “More ways to run”
Both halves variant The same Button variant Primary or Default

Built on

No component of its own, as in shadcn-vue: a joined ButtonGroup with a Button and an icon-only Button that opens a Dropdown menu.