Split Button

A split button with a main action and a separate secondary trigger for menus and options.

Installation

Adds the component and everything it depends on to your project.

npx shadcn add https://ui.beste.co/component/r-base/button5

New here? Read the installation guide.

Usage

The import and the props worth knowing about, in one place.

import { Button5 } from "@/components/beste/component/button5";
import Link from "next/link";

// Compose the MAIN segment with the render prop: your Link becomes the main
// control and the label stays as its children. The secondary segment is
// always a button (e.g. to open a menu).
<Button5
  label="Download"
  render={<Link href="/download" />}
  onSecondaryClick={() => console.log("choose platform")}
/>

<Button5
  label="Deploy now"
  onClick={() => console.log("deploy")}
  secondaryLabel="Deployment options"
  onSecondaryClick={() => console.log("open options")}
/>

Playground

Turn the props on the right; the snippet under them is what you would write to get what you see.

Usage
import { Button5 } from "@/components/beste/component/button5";

<Button5
  label="Deploy now"
  secondaryLabel="Deployment options"
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
label*stringMain action label
asChildbooleanCompose the MAIN segment shadcn-style (radix asChild): your element (e.g. a router Link) becomes the main control and the label is injected as its children. Pass the element without children of its own.
childrenReact.ReactElementThe element to render for the main segment when `asChild` is set
hrefstringFallback link for the main segment: renders a plain `<a>`. Prefer `asChild` with your framework's Link component.
onClickReact.MouseEventHandler<HTMLButtonElement>Main action click handler (used when there is no href and no asChild)
secondaryIconLucideIconIcon of the secondary segment (defaults to ChevronDown)
secondaryLabelstringAccessible name of the secondary segment
onSecondaryClickReact.MouseEventHandler<HTMLButtonElement>Secondary segment click handler (e.g. open a menu)
tone"dark" | "primary" | "outline"Surface tone: solid dark (default), primary, or bordered outline
classNamestringAdditional classes merged onto the root

More Button components

View all Button

Underline Arrow Button

A minimal text button with an animated underline and arrow for lightweight calls to action.

Magnetic Button

A magnetic button that is pulled toward the cursor on hover and springs back on leave.

Corner Brackets Button

A monospace button framed by corner brackets that spring outward on hover.

Icon Button

An accessible icon button with a required label, three sizes, and circle or square shape.

Soft Action Button

A compact, softly rounded action button with a solid accent, soft neutral, or hairline outline tone and an optional trailing icon.

Expanding Reveal Button

An expanding icon button that reveals its label on hover or focus for compact layouts.

Markdown version