Button Group
Group multiple buttons together on a single line or in vertical/block layouts. Includes split buttons, toggle buttons (radio/checkbox), icon-only groups, disabled states, and a JS API for programmatic control.
Basic Button Group
Outline Button Group
Mixed Color Group
Icon Button Groups
Compose groups from icon-only buttons for toolbars (text formatting, alignment, pagination).
Mixed Content (Text + Icon)
Sizes
Use .lp-btn-group-xs, .lp-btn-group-sm, .lp-btn-group-lg, or .lp-btn-group-xl. The group corners track the child button radius automatically (--lp-btn-border-radius).
Icon Group Sizes
Square icon-only groups scale uniformly; outer corners still round to match the button radius.
Vertical Group
Block (Full-Width) Group
Block Group Variants
Block groups work with every color variant and size. Combine with .lp-btn-group-sm / .lp-btn-group-lg.
Toggle Buttons (Radio)
Click to toggle. Only one can be active at a time (radio behavior).
Toggle Buttons (Checkbox)
Click to toggle. Multiple can be active at the same time (checkbox behavior).
Contextual Toggle Buttons
Each button can carry its own contextual color — useful for priority/severity pickers.
Toggle Buttons (Custom On/Off Variants)
Declare both states directly in markup with data-lp-btn-off and data-lp-btn-on on the <label>. Accepts any solid (primary, success, …) or outline (outline-primary, …) color name. No JS needed — CSS swaps the variant as the input toggles.
Heart / favorite (outline-danger → danger)
Radio group (outline-secondary → success)
Per-button variants (each option picks its own on-color)
Checkbox group (ghost-like off → info on)
Toggle Button Sizes
Vertical Toggle Group
Disabled States
Disable a single button or the whole group.
Enforced Selection
Add data-lp-component="button-group" and data-lp-enforce-selection="true" to prevent the user from deselecting the last active option.
JavaScript API
Control a group programmatically via the ButtonGroup class. Listen for lp:button-group:change for every state change.
value: []
Split Button
Combine an action button with a dropdown toggle. Click the button to perform the primary action; click the arrow to show options.
Split Button Variants
Split buttons work with any color or outline variant.
Button Dropdown
A single button that opens a dropdown menu when clicked.
Dropdown Direction & Alignment
Mix .lp-dropdown-up (on the container, flip upward) with .lp-dropdown-end / .lp-dropdown-start (on the menu, align right/left). Default is down + start.
Dropdown Inside a Card
Cards clip overflow by default, which would cut off any dropdown menu opened inside them. Adding .lp-card-overflow-visible on the card (including this demo card itself) lets the menu paint beyond the card boundary.
CSS Class & API Reference
Button Group Base
| Class / API | Description |
|---|---|
.lp-btn-group |
Container for grouped buttons |
Layouts
| Class / API | Description |
|---|---|
.lp-btn-group-vertical |
Stack buttons vertically |
.lp-btn-group-block |
Full-width buttons (flex: 1) |
Sizes
| Class / API | Description |
|---|---|
.lp-btn-group-xs |
Extra-small button group |
.lp-btn-group-sm |
Small button group |
.lp-btn-group-lg |
Large button group |
.lp-btn-group-xl |
Extra-large button group |
Radius
| Class / API | Description |
|---|---|
--lp-btn-border-radius |
CSS variable inherited from child .lp-btn — outer group corners track this value automatically |
Toggle Buttons
| Class / API | Description |
|---|---|
.lp-btn-check |
Hidden radio/checkbox input (with label) |
<input type="radio"> |
For radio (one selected) behavior |
<input type="checkbox"> |
For checkbox (multi-select) behavior |
data-lp-btn-off="<variant>" |
Variant applied to the label while input is unchecked (e.g. outline-primary) |
data-lp-btn-on="<variant>" |
Variant applied to the label while input is checked (e.g. success, danger) |
Split Button
| Class / API | Description |
|---|---|
.lp-btn-group > .lp-btn + .lp-dropdown |
Button + Dropdown in a group |
.lp-dropdown |
Wrapper for dropdown toggle button |
Dropdowns
| Class / API | Description |
|---|---|
.lp-dropdown |
Container for dropdown trigger + menu |
.lp-dropdown-menu |
Menu popup (shown on click/hover) |
.lp-dropdown-item |
Individual menu item (link or action) |
.lp-dropdown-divider |
Visual separator in menu |
.lp-dropdown-up |
Open menu upward |
.lp-dropdown-start |
Align menu to the left (default) |
.lp-dropdown-end |
Align menu to the right |
JavaScript API
| Class / API | Description |
|---|---|
data-lp-component="button-group" |
Attribute that auto-inits ButtonGroup on a .lp-btn-group |
data-lp-enforce-selection |
Prevent deselecting the last active item (checkbox / button modes) |
getValue() |
Returns current value (single value for radio, array for checkbox/button) |
setValue(value) |
Programmatically set the selection |
toggle(value) |
Flip a single item (checkbox/button only) |
selectAll() / deselectAll() |
Check/uncheck every item (checkbox/button only) |
disable() / enable() |
Toggle disabled on every button and input |
disableButton(value) / enableButton(value) |
Per-item disable/enable |
lp:button-group:change |
Event fired on any change, detail = { value, source } |
lp:button-group:select |
Fired when an item becomes active, detail = { value } |
lp:button-group:deselect |
Fired when an item becomes inactive, detail = { value } |