A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
<nve-button-group>
<nve-icon-button selected icon-name="copy"></nve-icon-button>
<nve-icon-button icon-name="add-comment"></nve-icon-button>
<nve-icon-button icon-name="download"></nve-icon-button>
</nve-button-group>
Installation
<script type="module">
import '@nvidia-elements/core/button-group/define.js';
</script>
<nve-button-group>
<nve-icon-button selected icon-name="copy"></nve-icon-button>
<nve-icon-button icon-name="add-comment"></nve-icon-button>
<nve-icon-button icon-name="download"></nve-icon-button>
</nve-button-group>
nve api.get nve-button-group
Split
The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.
Interaction Description emphasis Shows the interaction targets emphasis or highlighting primary actions. destructive Shows the interaction targets destructive actions such as deleting or removing.
Split button groups with different interaction styles for primary actions with dropdown alternatives.
<div nve-layout="row gap:sm">
<nve-button-group>
<nve-button>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down"></nve-icon-button>
</nve-button-group>
<nve-button-group interaction="emphasis">
<nve-button>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down"></nve-icon-button>
</nve-button-group>
<nve-button-group interaction="destructive">
<nve-button>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down"></nve-icon-button>
</nve-button-group>
</div>
Split Rounded
Split button groups with rounded container styling for softer visual appearance and modern aesthetics.
<div nve-layout="row gap:sm">
<nve-button-group container="rounded">
<nve-button>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down"></nve-icon-button>
</nve-button-group>
<nve-button-group container="rounded" interaction="emphasis">
<nve-button>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down"></nve-icon-button>
</nve-button-group>
<nve-button-group container="rounded" interaction="destructive">
<nve-button>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down"></nve-icon-button>
</nve-button-group>
</div>
Container
Demonstrates different container styles to accommodate visual weight and context.
Container Description flat Element has white space bounds but reduced visual container. rounded
Standard
Basic button group for organizing related actions into a unified control with connected visual appearance.
<nve-button-group>
<nve-icon-button selected icon-name="copy"></nve-icon-button>
<nve-icon-button icon-name="add-comment"></nve-icon-button>
<nve-icon-button icon-name="download"></nve-icon-button>
</nve-button-group>
Flat
Demonstrates different container styles to accommodate visual weight and context.
Container Description flat Element has white space bounds but reduced visual container. rounded
Button group with flat container styling for minimal visual appearance and reduced emphasis.
<nve-button-group container="flat">
<nve-icon-button pressed icon-name="split-vertical"></nve-icon-button>
<nve-icon-button icon-name="split-horizontal"></nve-icon-button>
<nve-icon-button icon-name="split-none"></nve-icon-button>
</nve-button-group>
Rounded
Demonstrates different container styles to accommodate visual weight and context.
Container Description flat Element has white space bounds but reduced visual container. rounded
Rounded button group with single selection for segmented controls and filter options with pill-style buttons.
<nve-button-group container="rounded" behavior-select="single">
<nve-button pressed>All Time</nve-button>
<nve-button>30 Days</nve-button>
<nve-button>90 Days</nve-button>
</nve-button-group>
Rounded Icon
Rounded button group with icon buttons for compact view switchers and mode toggles.
<nve-button-group container="rounded" behavior-select="single">
<nve-icon-button icon-name="table"></nve-icon-button>
<nve-icon-button icon-name="image"></nve-icon-button>
</nve-button-group>
Selection
By default the button group is stateless. Add the behavior-select attribute and set to single or multi to enable stateful selction handling.
BehaviorSelect Description single multi
Single Select
Button group with single selection behavior for mutually exclusive options like view modes or formatting.
<nve-button-group behavior-select="single">
<nve-icon-button pressed container="flat" icon-name="bars-3-bottom-left"></nve-icon-button>
<nve-icon-button container="flat" icon-name="bars-3-bottom-right"></nve-icon-button>
<nve-icon-button container="flat" icon-name="bars-4"></nve-icon-button>
</nve-button-group>
Multi Select
Button group with multi-selection behavior for toggling many options simultaneously like text formatting.
<nve-button-group behavior-select="multi">
<nve-icon-button pressed container="flat" icon-name="bold" size="sm"></nve-icon-button>
<nve-icon-button container="flat" icon-name="italic" size="sm"></nve-icon-button>
<nve-icon-button pressed container="flat" icon-name="strikethrough" size="sm"></nve-icon-button>
</nve-button-group>
Disabled
Button group in disabled state for indicating unavailable actions or read-only contexts.
<nve-button-group container="rounded">
<nve-button disabled>button</nve-button>
<nve-divider orientation="vertical"></nve-divider>
<nve-icon-button icon-name="caret" size="sm" direction="down" disabled></nve-icon-button>
</nve-button-group>
Orientation
Controls the directional flow of the element's layout and interaction pattern.
Orientation Description horizontal Element orients horizontally with left-to-right flow. vertical Element orients vertically with top-to-bottom flow.
Button group with vertical orientation for sidebars, toolbars, or vertical navigation contexts.
<nve-button-group orientation="vertical">
<nve-icon-button icon-name="copy"></nve-icon-button>
<nve-icon-button icon-name="add-comment"></nve-icon-button>
<nve-icon-button icon-name="download"></nve-icon-button>
</nve-button-group>
Release Status
All elements and features go through 3 phases of stability, pre-release, beta and stable.
pre-release
Docs Preview
API Documentation
Fully Themeable
beta
Robust unit test coverages
Passed API Review
Passed Designer VQA Review
Included in library package
stable
No known outstanding AA WCAG issues
No known outstanding performance issues
Adapts to different screen/container sizes
No breaking API changes for at least 90 days