Button group
Visually joins related buttons and names the group.
Example
<focsd-button-group label="Pagination"> <focsd-button>Previous</focsd-button> <focsd-button>Next</focsd-button></focsd-button-group>Usage
Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.
<script type="module"> import '@focsd-dev/components/focsd-button-group.js';</script>
<focsd-button-group label="Pagination">…</focsd-button-group>import { ButtonGroup } from '@focsd-dev/react';
export function Example() { return <ButtonGroup label="Pagination">…</ButtonGroup>;}<script setup>import '@focsd-dev/components/focsd-button-group.js';</script>
<template> <focsd-button-group label="Pagination">…</focsd-button-group></template>// Add CUSTOM_ELEMENTS_SCHEMA to the component's schemas, then:import '@focsd-dev/components/focsd-button-group.js';
// template<focsd-button-group label="Pagination">…</focsd-button-group><script> import '@focsd-dev/components/focsd-button-group.js';</script>
<focsd-button-group label="Pagination">…</focsd-button-group>API
Attributes
| Attribute | Property | Type | Default |
|---|---|---|---|
label | label | string | — |
Slots
| Slot | Description |
|---|---|
(default) | Default content. |
CSS parts
Style the inside of the component with ::part(), for example focsd-button-group::part(group).
| Part | Description |
|---|---|
group | The group element. |
Accessibility
- A
role="group"witharia-label; each button stays its own tab stop. - For a single tab stop with arrow keys, use a toolbar instead.
Ask the docs
Hi, what are you building?
Ask about any component, theming, forms or frameworks. I answer with the right component, a snippet and a link to its docs.