Skip to main content

ButtonGroup

scoped

ButtonGroup is used to group Button and Dropdown elements into more functional units, which will be automatically styled and arranged when inserted inside the element.

Basic usage

Add a wje-button-group element to the HTML with the desired attributes and include the desired Button or Dropdown elements inside it.

ButtonGroup shape

This example compares how grouped buttons behave with different shapes while still reading as one connected control.

ButtonGroup with Dropdown

This example combines a standard button and a dropdown inside one group. It is a common pattern for a primary action with secondary options.

Icons in ButtonGroup

This example focuses on icon usage inside a button group so you can check height, rhythm, and alignment across grouped controls.

Split buttons

ButtonGroup also allows you to display a split button with multiple functions.

Styling

ButtonGroup colors

This example compares semantic color variants across the whole button group so it is easier to judge how grouped actions read in different states.

Border color in ButtonGroup

This example shows outline color variants in a button group. It is useful when you want a lighter visual treatment without losing semantic meaning.

When to use

Use wje-button-group when you need a consistent WebJET-based implementation for this UI concern.

When not to use

Do not stretch the component beyond its responsibility; compose smaller primitives for edge cases.

Accessibility

Validate keyboard behavior, focus states, contrast, and meaningful labels for interactive elements.

Best Practices

  • Prefer component APIs over direct DOM manipulation.
  • Stick to design tokens and naming conventions.
  • Test components with realistic data before production rollout.

Attributes and Properties

active

DescriptionSets the "active" attribute to indicate the active state.
Attributeactive
Typeboolean|string|number
Defaultfalse

color

DescriptionRetrieves the current value of the 'color' attribute. If the 'color' attribute is not set, it defaults to 'primary'.
Attributecolor
Typestring
Defaultprimary

fill

DescriptionRetrieves the 'fill' attribute of the element. If the 'fill' attribute is not set, it returns the default value 'link'.
Attributefill
Typestring
Defaultlink

round

DescriptionReturns whether the element has the 'round' attribute.
Attributeround
Typestring
Defaultfalse

Events

No events available for this component.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
nativeThe component's native wrapper.
nativeThe component's native wrapper.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

NameDescription
defaultThe button group main content.