Getting StartedInstallationSupportChangelogGithubFrameworksAngularVueReactDemosFoundationThemesInternationalizationTypographyIconsLayoutGetting StartedBlockInlineGridComponentsAccordionAlertAlert GroupBadgeBreadcrumbButtonButton GroupButton ExpandButton HandleButton IconButton Icon GroupButton SortCardCheckboxColorData GridDateDialogDividerDrawerDropdownFileFormsForm InteractionsForm ValidationHeaderInputMenuMonthNavPaginationPasswordProgress BarProgress CircleRadioRangeSearchSelectShellSwitchTabsTagTextareaTimeToastTooltipData GridGetting StartedFooterPlaceholderAsyncResponsiveScroll HeightPaginationBordersHoverColumn AlignmentColumn WidthColumn FixedColumn StickyColumn VisibilityRow HeaderRow Multi SelectRow Single SelectRow HeightRow ActionRow Action BulkRow StickyRow StripeRow FixedRow SortRow Groups

The button group component is used to group together related buttons and present them as a single visual unit. Each button in the group should have a clear and descriptive label that communicates its purpose. The group should be labeled if the relationship between the buttons is not immediately clear.

Example

onetwothree
code
<script type="module">
import '@blueprintui/components/include/button-group.js';
import '@blueprintui/components/include/button.js';
</script>

<bp-button-group>
<bp-button>one</bp-button>
<bp-button>two</bp-button>
<bp-button>three</bp-button>
</bp-button-group>

Selected

button onebutton twobutton three
code
<script type="module">
import '@blueprintui/components/include/button-group.js';
import '@blueprintui/components/include/button.js';
</script>

<bp-button-group>
<bp-button>button one</bp-button>
<bp-button selected>button two</bp-button>
<bp-button>button three</bp-button>
</bp-button-group>

Disabled

button onebutton twobutton three
code
<script type="module">
import '@blueprintui/components/include/button-group.js';
import '@blueprintui/components/include/button.js';
</script>

<bp-button-group>
<bp-button>button one</bp-button>
<bp-button>button two</bp-button>
<bp-button disabled>button three</bp-button>
</bp-button-group>

Install

NPM

// npm package
import '@blueprintui/components/include/button-group.js';

CDN

<script type="module">
import 'https://cdn.jsdelivr.net/npm/@blueprintui/components/include/button-group.js/+esm';
</script>

Accessibility

  • Use clear, descriptive labels for each button that communicates its purpose.
  • Use aria-label or aria-labelledby to label the group if the relationship between the buttons is not immediately clear.
  • Provide a way for keyboard users to navigate through the buttons, such as by using the tab key.

bp-button-group

Properties

NameTypesDescription
action'primary' | 'outline' | 'flat'

Attributes

NameTypesDescription
action'primary' | 'outline' | 'flat'

Slots

NameTypesDescription
defaultbutton content

bp-button

Properties

NameTypesDescription
action'primary' | 'outline' | 'flat'
status'accent' | 'success' | 'warning' | 'danger'
pressedboolean
expandedboolean
readonlyboolean
disabledboolean
type'button' | 'submit'
namestring
valuestring
formHTMLFormElement
formActionstring
formEnctypestring
formMethodstring
formNoValidateboolean
formTargetstring
labelsNodeListOf
validationMessagestring
validityValidityState
willValidateboolean
checkValidityany
reportValidityany
setCustomValidityany
formAssociatedboolean

Attributes

NameTypesDescription
action'primary' | 'outline' | 'flat'
status'accent' | 'success' | 'warning' | 'danger'
pressedboolean
expandedboolean
readonlyboolean
disabledboolean
type'button' | 'submit'
namestring
valuestring

CSS Properties

NameTypesDescription
--background
--color
--border
--padding
--min-width
--font-size
--line-height
--text-align

Slots

NameTypesDescription
defaultbutton content