← All Components
<mth-bulk-action-bar>
Contextual selection toolbar (<mth-bulk-action-bar>) with Intl.PluralRules count formatting, select-all/clear triggers, and RTL-aware RovingFocusController.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-bulk-action-bar>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/admin/bulk-action-bar"></script>
<mth-bulk-action-bar selected-count="0" total-count="0"></mth-bulk-action-bar>import '@methane-ui/admin/bulk-action-bar';
import '@methane-ui/react';
export function Example() {
return <mth-bulk-action-bar selected-count="0" total-count="0"></mth-bulk-action-bar>;
}<script setup lang="ts">
import '@methane-ui/admin/bulk-action-bar';
</script>
<template>
<mth-bulk-action-bar selected-count="0" total-count="0"></mth-bulk-action-bar>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/admin/bulk-action-bar';
import { MthBulkActionBarDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthBulkActionBarDirective],
template: `<mth-bulk-action-bar selected-count="0" total-count="0"></mth-bulk-action-bar>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/admin/bulk-action-bar';
import MthBulkActionBar from '@methane-ui/svelte/MthBulkActionBar.svelte';
</script>
<MthBulkActionBar selected-count="0" total-count="0"></MthBulkActionBar>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
selectedCount | selected-count | number | 0 | Number of currently selected rows/items. |
totalCount | total-count | number | 0 | Total available item count for select-all state. |
actions | — | ReadonlyArray<unknown> | — | Bulk action buttons rendered in the toolbar. |
showWhenEmpty | show-when-empty | boolean | false | Keeps the toolbar visible when selectedCount is 0. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-select-all | { totalCount: number } | Emitted when select-all is clicked. |
mth-clear-selection | Record<string, never> | Emitted when clear-selection is clicked. |
mth-action | { id: string; selectedCount: number } | Emitted when a bulk action button is clicked. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | bulk toolbar has focus | moves focus to next action button |
| ArrowLeft | rtl | bulk toolbar has focus in RTL | moves focus to next action button |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-bulk-action-bar.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(active). | Conformance suite |
| i18n | Routes 6 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |