Component
Split Button Dropdown
Split buttons with dropdown menu trigger
- Component
- Tailwind
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/buttons/split-button/dropdown/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Buttons/split-button/dropdown Tailwind/Components/Buttons/split-button/dropdown <!-- Split Button Dropdown - Primary -->
<div class="relative inline-flex rounded-md shadow-sm" role="group">
<button class="px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-l-lg hover:bg-indigo-700 focus:z-10 focus:ring-2 focus:ring-indigo-500">
Action
</button>
<button class="px-2 py-2 text-sm font-medium text-white bg-indigo-600 border-l border-indigo-700 rounded-r-lg hover:bg-indigo-700 focus:z-10 focus:ring-2 focus:ring-indigo-500">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
</svg>
</button>
</div>
<!-- Split Button Dropdown - Outline -->
<div class="relative inline-flex rounded-md shadow-sm" role="group">
<button class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-l-lg hover:bg-gray-50 focus:z-10 focus:ring-2 focus:ring-blue-500">
Share
</button>
<button class="px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-l-0 border-gray-300 rounded-r-lg hover:bg-gray-50 focus:z-10 focus:ring-2 focus:ring-blue-500">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"/>
</svg>
</button>
</div> # Split Button Dropdown
Split button with a primary action and dropdown trigger.
## Preview
Open `preview.html` for a standalone demonstration.
## Features
- Split primary + menu trigger
- Dropdown panel
- Focus-visible states
## Usage
```bash
npx devsnips add Tailwind/Components/Buttons/split-button/dropdown
```
Copy from `code.html`. Wire menu open/close behavior as needed (inline script or your own state).
## Customization
- Button and menu surface colors, spacing, radius
## Accessibility
- Both segments should be keyboard reachable
- Menu should follow disclosure / menu keyboard patterns
## Dependencies
- Tailwind CSS; small JS if the markup includes a toggle script
## File Structure
- `code.html` · `preview.html` · `metadata.json` · `README.md` 23 lines UTF-8 · LF · Spaces: 2
Continue browsing