Tab strip
- β / β
- Move focus to the previous / next tab
- Home / End
- Jump to the first / last tab
- Enter / Space
- Activate the focused tab
- Double-click
- Minimize / restore the ribbon
The ribbon follows the WAI-ARIA tab + toolbar pattern with Office-style shortcuts. Click anywhere in the ribbon first to put focus inside it.
data-key-tip="X" Screen-reader users also hear announcements (aria-live="polite") for ribbon minimize / restore, contextual-tab show / hide, and overflow-group collapse / expand transitions.
Copy-paste starting points for the most common ribbon shapes. The ribbon and every item are Vue components: v-model:active-tab-id and v-model:minimized on <BsRibbon>, v-model:pressed / :value / :color / :checked / :selected-value on the value items.
<BsRibbon v-model:active-tab-id="activeTab" v-model:minimized="minimized"> <BsRibbonTab tab-id="home" label="Home"> <BsRibbonGroup group-id="clipboard" label="Clipboard" dialog-launcher="Clipboard Dialog"> <BsRibbonButton item-id="paste" label="Paste" icon="π" size="large" tooltip="Paste (Ctrl+V)" @item-click="onPaste" /> <BsRibbonButton item-id="cut" label="Cut" icon="βοΈ" size="small" @item-click="onCut" /> <BsRibbonButton item-id="copy" label="Copy" icon="π" size="small" @item-click="onCopy" /> </BsRibbonGroup> </BsRibbonTab></BsRibbon>v-model:minimized two-way binds the minimize state β Ctrl+F1 and double-clicking a tab will update your signal.
<BsRibbonSplitButton :item-id="pasteMode.id" :label="pasteMode.label" :icon="pasteMode.icon" size="large" @main-action="onPaste"> <BsRibbonMenuItem item-id="paste" label="Paste" icon="π" @menu-select="onPasteModeSelect" /> <BsRibbonMenuItem item-id="paste-values" label="Paste Values" icon="123" @menu-select="onPasteModeSelect" /> <BsRibbonMenuSeparator /> <BsRibbonMenuItem item-id="paste-special" label="Paste Specialβ¦" @menu-select="onPasteSpecial" /></BsRibbonSplitButton> The split-button never mutates its own label / icon. Implement the "last-used" pattern in your component by updating pasteMode inside onPasteModeSelect.
[(ngModel)]<!-- Vue: bind the prop + listen for the matching event. boldOn / fontFamily / fontColor are refs(). --><BsRibbonToggleButton item-id="bold" label="Bold" icon="B" size="small" v-model:pressed="boldOn" /><BsRibbonComboBox item-id="font-family" label="Font Family" size="medium" :options="fontFamilyOptions" v-model:value="fontFamily" /><BsRibbonColorPicker item-id="font-color" label="Font Color" size="small" v-model:color="fontColor" /> Every value-bearing wrapper (toggle-button, check-box, combo-box, color-picker, group-button) implements ControlValueAccessor so it works with both template-driven (ngModel) and reactive forms (formControl).
<BsRibbonContextualTabSet label="Picture Tools" color="#F2C744" :visible="pictureSelected"> <BsRibbonTab tab-id="picture-format" label="Format"> <BsRibbonGroup group-id="picture-styles" label="Picture Styles"> β¦ </BsRibbonGroup> </BsRibbonTab></BsRibbonContextualTabSet> Toggling :visible on the set adds or removes its tabs; the ribbon announces "Picture Tools, contextual, now available / hidden" via the live region.
<BsQuickAccessToolbar aria-label="Quick Access Toolbar" :touch-mode="touchMode"> <BsRibbonButton item-id="save" label="Save" icon="πΎ" size="small" @item-click="onSave" /> <BsRibbonButton item-id="undo" label="Undo" icon="βΆ" size="small" @item-click="onUndo" /></BsQuickAccessToolbar><BsRibbon β¦> β¦ </BsRibbon> The QAT is deliberately rendered as a sibling β two top-level role="toolbar" regions keep the a11y tree flat. Persistence of pinned commands is up to your app.
<!-- .excel { --bs-ribbon-accent: #217346; } --><BsRibbon version="office-2016" class="excel" color-scheme="auto" touch-mode="auto"> β¦</BsRibbon>version picks one of office-2007 / 2010 / 2013 / 2016. The --bs-ribbon-accent custom property, set on the ribbon or any ancestor, drives the brand colour (Word #2B579A, Excel #217346, etc.). colorScheme="auto" follows prefers-color-scheme and ancestor data-bs-theme="dark".
<!-- Any element works as an icon: an SVG, an icon-font <i>, an image. It is sized from the size the item renders at. --><BsRibbonButton item-id="save" label="Save" size="large" @item-click="onSave"> <template #iconTemplate><i class="bi bi-save"></i></template></BsRibbonButton><BsRibbonButton item-id="copy" label="Copy" size="small" @item-click="onCopy"> <template #iconTemplate><svg viewBox="0 0 16 16">β¦</svg></template></BsRibbonButton> Every item takes an #iconTemplate slot alongside the icon string prop. The element is sized from the size the item renders at, so it follows the ribbon as groups collapse. The icon string remains the fallback β consumers can mix-and-match.