25 Tailwind CSS Button Groups
14 / 25

All 25 in 25 Tailwind CSS Button Groups

  1. 01Tailwind Split Button with Anchor-Positioned Popover Dropdown (No JS)
  2. 02Tailwind Segmented Control with Motion-Path Comet Indicator
  3. 03Tailwind Toggle Button Group with View Transitions Morphing Highlight
  4. 04Tailwind Pricing Toggle — Monthly / Yearly Billing Switch (No JS)
  5. 05Tailwind Segmented Control with Sliding Thumb (iOS Style)
  6. 06Tailwind Split Button Dropdown with Native Details Menu (Save Options)
  7. 07Tailwind Icon Button Group Toolbar with Tooltips (Rich Text Editor)
  8. 08Tailwind Pill Filter Button Group with Sliding Indicator (Anchor Positioning)
  9. 09Tailwind Toggle Button Group for Text Alignment (Radio Inputs, Live Preview)
  10. 10Tailwind Web3 Connect Wallet Button Grid (Wallet Sign-In Modal)
  11. 11Tailwind AI Model Selector Button Group (LLM Model Picker with Badges)
  12. 12Tailwind Liquid Metal Segmented Control (Animated Chrome Thumb)
  13. 13Tailwind Tab Button Group with Subgrid Underline Indicator
  14. 14Tailwind Multi-Select Chip Buttons (Tag Filter Checkboxes with Count)
  15. 15Tailwind Animated Split Button Deploy Menu (Staggered Dropdown Reveal)
  16. 16Tailwind Radio Button Group with Conic Fill Animation (Export Format Picker)
  17. 17Tailwind Retro LED Pixel Button Group (Dot-Matrix Display Buttons)
  18. 18Tailwind Hold-to-Confirm Button Group with Gradient Progress (Press and Hold)
  19. 19Tailwind Holographic Icon Segmented Control (Grid / List View Switcher)
  20. 20Tailwind 3D Vertical Button Group with Hover Depth (Perspective Stack)
  21. 21Tailwind Floating Action Button with Radial Speed Dial Menu (No JS)
  22. 22Tailwind Glitch Effect Button Group (Cyberpunk RGB-Split Audio Filter)
  23. 23Tailwind Animated Gradient Border Pill Buttons (Rotating Conic Ring)
  24. 24Tailwind Button Group with Ripple Click Effect (Radar Shockwave Feedback)
  25. 25Tailwind Button Group with Cursor-Following Spotlight Glow (Date Range Presets)
Pure TailwindMIT licensed

Tailwind Multi-Select Chip Buttons (Tag Filter Checkboxes with Count)

Toggleable tag chips on hidden checkboxes, lit up with an acid-green neon glow when selected. Two genuinely useful additions run on pure HTML and CSS: a live “3 selected” count drawn with a CSS counter (checked:[counter-increment:tbg14] → after:content-[counter(tbg14)]), and a Clear button that is simply type="reset" on the surrounding form.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="tbg-14 w-full min-h-svh grid place-items-center bg-tbg14-bg bg-[radial-gradient(120%_120%_at_50%_0%,var(--color-tbg14-glow),transparent_70%)] px-5 py-14 font-tbg14-sans text-tbg14-ink" aria-label="Multi-select chip buttons demo">
  <form class="grid w-full max-w-[36rem] gap-4 [counter-reset:tbg14]" onsubmit="return false">
    <fieldset class="grid gap-4">
      <legend class="mb-4 ml-0.5 font-tbg14-mono text-xs font-bold uppercase tracking-[0.14em] text-tbg14-acid">Stack — select all that apply</legend>
      <div class="flex flex-wrap gap-3">
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="ts" class="sr-only checked:[counter-increment:tbg14]" checked>TypeScript</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="rust" class="sr-only checked:[counter-increment:tbg14]">Rust</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="webgpu" class="sr-only checked:[counter-increment:tbg14]" checked>WebGPU</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="edge" class="sr-only checked:[counter-increment:tbg14]">Edge Functions</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="vector" class="sr-only checked:[counter-increment:tbg14]">Vector DB</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="wasm" class="sr-only checked:[counter-increment:tbg14]" checked>WASM</label>
      </div>
    </fieldset>
    <div class="flex items-center justify-between gap-4 border-t border-tbg14-line pt-4">
      <p aria-hidden="true" class="font-tbg14-mono text-[13px] text-tbg14-mut"><span class="font-bold text-tbg14-acid after:content-[counter(tbg14)]"></span> selected</p>
      <button type="reset" class="min-h-11 cursor-pointer rounded-full px-4 text-[14px] font-semibold text-tbg14-mut transition hover:bg-white/6 hover:text-tbg14-ink focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-white">Reset</button>
    </div>
  </form>
</section>
@import "tailwindcss";

@theme {
  --color-tbg14-bg: #050703;
  --color-tbg14-glow: #10170b;
  --color-tbg14-ink: #e6f2da;
  --color-tbg14-mut: #9eae92;
  --color-tbg14-mut: oklch(0.73 0.04 135);
  --color-tbg14-line: #253019;
  --color-tbg14-ring: #4a5c36;
  --color-tbg14-hover: #4a5f2f;
  --color-tbg14-on: #0a1204;
  --color-tbg14-acid: #b6f23a;
  --color-tbg14-acid: oklch(0.89 0.22 128);
  --shadow-tbg14-glow: 0 0 0 1px var(--color-tbg14-acid), 0 0 22px -2px var(--color-tbg14-acid), 0 0 46px 2px color-mix(in oklab, var(--color-tbg14-acid) 45%, transparent);
  --font-tbg14-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-tbg14-mono: 'Space Mono', ui-monospace, monospace;
}
/* Root rule: the full-bleed contract, restated so the stage is sized before the browser build compiles. */

.tbg-14 {
  width: 100%;
  min-height: 100svh;
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

Compiles in the browser — perfect for a CodePen or a quick test, not for production.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tbg14-bg: #050703;
  --color-tbg14-glow: #10170b;
  --color-tbg14-ink: #e6f2da;
  --color-tbg14-mut: #9eae92;
  --color-tbg14-mut: oklch(0.73 0.04 135);
  --color-tbg14-line: #253019;
  --color-tbg14-ring: #4a5c36;
  --color-tbg14-hover: #4a5f2f;
  --color-tbg14-on: #0a1204;
  --color-tbg14-acid: #b6f23a;
  --color-tbg14-acid: oklch(0.89 0.22 128);
  --shadow-tbg14-glow: 0 0 0 1px var(--color-tbg14-acid), 0 0 22px -2px var(--color-tbg14-acid), 0 0 46px 2px color-mix(in oklab, var(--color-tbg14-acid) 45%, transparent);
  --font-tbg14-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-tbg14-mono: 'Space Mono', ui-monospace, monospace;
}
/* Root rule: the full-bleed contract, restated so the stage is sized before the browser build compiles. */

.tbg-14 {
  width: 100%;
  min-height: 100svh;
}
3Fonts used by this demooptional — skip if you have your own type stack
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400..700&family=Space+Mono:wght@400;700&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • input:checked + .btn-14__chip and its ::before dot became has-checked: and has-checked:before: on a label that wraps its checkbox.
  • The triple-layer glow moved into a --shadow-tbg14-glow token, so has-checked:shadow-tbg14-glow stays readable.
  • UI upgrade: a live selected count (CSS counter) and a Reset button (native form reset) — both zero-JS.
  • Accessibility fix: the chips sit in a <fieldset> with a real <legend>, and muted chip text rose from #8a9a7e to oklch(0.73) (8:1).
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Multi-Select Chip Buttons (Tag Filter Checkboxes with Count)
Source: https://codefronts.com/components/tailwind-css-button-groups/tailwind-multi-select-chip-buttons/

Toggleable tag chips on hidden checkboxes, lit up with an acid-green neon glow when selected. Two genuinely useful additions run on pure HTML and CSS: a live “3 selected” count drawn with a CSS counter (checked:[counter-increment:tbg14] → after:content-[counter(tbg14)]), and a Clear button that is simply type="reset" on the surrounding form.
## HTML
```html
<section class="tbg-14 w-full min-h-svh grid place-items-center bg-tbg14-bg bg-[radial-gradient(120%_120%_at_50%_0%,var(--color-tbg14-glow),transparent_70%)] px-5 py-14 font-tbg14-sans text-tbg14-ink" aria-label="Multi-select chip buttons demo">
  <form class="grid w-full max-w-[36rem] gap-4 [counter-reset:tbg14]" onsubmit="return false">
    <fieldset class="grid gap-4">
      <legend class="mb-4 ml-0.5 font-tbg14-mono text-xs font-bold uppercase tracking-[0.14em] text-tbg14-acid">Stack — select all that apply</legend>
      <div class="flex flex-wrap gap-3">
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="ts" class="sr-only checked:[counter-increment:tbg14]" checked>TypeScript</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="rust" class="sr-only checked:[counter-increment:tbg14]">Rust</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="webgpu" class="sr-only checked:[counter-increment:tbg14]" checked>WebGPU</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="edge" class="sr-only checked:[counter-increment:tbg14]">Edge Functions</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="vector" class="sr-only checked:[counter-increment:tbg14]">Vector DB</label>
        <label class="flex min-h-11 cursor-pointer items-center gap-2 rounded-full border-[1.5px] border-tbg14-line bg-white/3 px-4.5 text-[14.5px] font-semibold text-tbg14-mut transition-[color,border-color,background-color,box-shadow] duration-200 before:size-3.5 before:flex-none before:rounded-full before:border-2 before:border-tbg14-ring before:transition before:content-[''] hover:border-tbg14-hover hover:text-tbg14-ink has-checked:border-tbg14-acid has-checked:bg-tbg14-acid has-checked:text-tbg14-on has-checked:shadow-tbg14-glow has-checked:before:border-tbg14-on has-checked:before:bg-tbg14-on has-checked:before:shadow-[inset_0_0_0_2px_var(--color-tbg14-acid)] has-focus-visible:outline-3 has-focus-visible:outline-offset-3 has-focus-visible:outline-white motion-reduce:transition-none"><input type="checkbox" name="stack" value="wasm" class="sr-only checked:[counter-increment:tbg14]" checked>WASM</label>
      </div>
    </fieldset>
    <div class="flex items-center justify-between gap-4 border-t border-tbg14-line pt-4">
      <p aria-hidden="true" class="font-tbg14-mono text-[13px] text-tbg14-mut"><span class="font-bold text-tbg14-acid after:content-[counter(tbg14)]"></span> selected</p>
      <button type="reset" class="min-h-11 cursor-pointer rounded-full px-4 text-[14px] font-semibold text-tbg14-mut transition hover:bg-white/6 hover:text-tbg14-ink focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-white">Reset</button>
    </div>
  </form>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tbg14-bg: #050703;
  --color-tbg14-glow: #10170b;
  --color-tbg14-ink: #e6f2da;
  --color-tbg14-mut: #9eae92;
  --color-tbg14-mut: oklch(0.73 0.04 135);
  --color-tbg14-line: #253019;
  --color-tbg14-ring: #4a5c36;
  --color-tbg14-hover: #4a5f2f;
  --color-tbg14-on: #0a1204;
  --color-tbg14-acid: #b6f23a;
  --color-tbg14-acid: oklch(0.89 0.22 128);
  --shadow-tbg14-glow: 0 0 0 1px var(--color-tbg14-acid), 0 0 22px -2px var(--color-tbg14-acid), 0 0 46px 2px color-mix(in oklab, var(--color-tbg14-acid) 45%, transparent);
  --font-tbg14-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-tbg14-mono: 'Space Mono', ui-monospace, monospace;
}
/* Root rule: the full-bleed contract, restated so the stage is sized before the browser build compiles. */

.tbg-14 {
  width: 100%;
  min-height: 100svh;
}
```

How this works

CSS can count. Each checked checkbox increments a counter; a span after the chips prints it:

<form class="[counter-reset:tbg14]">
  <input type="checkbox" class="sr-only checked:[counter-increment:tbg14]">
  …
  <span class="after:content-[counter(tbg14)]"></span> selected

Reset is free. A form's reset button restores every checkbox to its initial checked attribute — set none as checked in markup if Clear should empty everything.

Make it yours

  • Different glow colour: edit --color-tbg14-acid; the shadow token derives from it.
  • Single-select: switch checkboxes to radios with one name (drop the counter).
  • Submit filters: give each checkbox name and value and add a submit button.

Gotchas — read before shipping

  • Counter output is generated content, which screen readers may not announce — the checkboxes themselves carry the state.
  • type="reset" restores the initial state, not “none”, if any box starts checked.
  • Neon glows lower contrast at the edges; the chip text itself stays dark on solid acid.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

CSS counters and form reset are universal; Tailwind v4 sets the floor.

Techniques used in this demo

Search CodeFronts

Loading…