CSS Split Button

A primary action joined to a caret segment for extra options.

  • split
  • dropdown
  • group
  • caret
  • actions
HTML
<div class="btn-split">
  <button type="button">Save draft</button>
  <button type="button" aria-label="More save options">
    <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
  </button>
</div>
CSS
.btn-split {
  display: inline-flex;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.btn-split button {
  display: inline-grid;
  place-items: center;
  padding: 12px 18px;
  border: 0;
  background: #0f766e;
  color: #fff;
  font: 600 15px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-split button:first-child {
  border-radius: 10px 0 0 10px;
}

.btn-split button:last-child {
  padding-inline: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0 10px 10px 0;
}

.btn-split button:hover {
  background: #115e59;
}

.btn-split button:focus-visible {
  position: relative;
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

About this CSS Split Button

This CSS Split Button is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, CSS Grid and Flexbox. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #0f766e
  • #fff
  • #115e59

How to use this split button

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .btn-split class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback