Bulk Action Bar
Interactive selected-items action bar for tables and resource lists with selected count, clear action, disabled state, and bulk action events.
Overview
The Bulk Action Bar component is a core building block of the Byteion design system, providing a robust, accessibility-compliant interface for its specific UI capabilities.
Why this exists
This component provides a reusable, accessible primitive for bulk-action-bar use cases within the Byteion design system.
Mental model
Think of this component as a building block. Compose it with other Byteion primitives to build complex interfaces.
When to use
When not to use
Basic example
The following example demonstrates standard usage, fully compliant with Byteion's token-first approach.
1. DEFAULT / INLINE VARIANT (Best for tables & lists)
2. FLOATING / COMPACT VARIANT (Best for cards, grids, mobile)
import { BulkActionBar, Button } from '@byteion/react';
export default function BulkActionBarDemo() {
const selectedIds = ['ord_128', 'ord_129', 'ord_130'];
return (
<BulkActionBar
selectedIds={selectedIds}
label="orders"
onAction={(action, ids) => console.log(action, ids)}
onClear={() => console.log('clear selection')}
>
<Button size="sm" variant="ghost" tone="neutral" data-bi-bulk-action="archive">Archive</Button>
<Button size="sm" variant="ghost" tone="neutral" data-bi-bulk-clear>Clear</Button>
</BulkActionBar>
);
}
<script setup lang="ts">
import { BulkActionBar, Button } from '@byteion/vue';
const selectedIds = ['ord_128', 'ord_129', 'ord_130'];
</script>
<template>
<BulkActionBar
:selected-ids="selectedIds"
label="orders"
@action="(action, ids) => console.log(action, ids)"
@clear="console.log('clear selection')"
>
<Button size="sm" variant="ghost" tone="neutral" data-bi-bulk-action="archive">Archive</Button>
<Button size="sm" variant="ghost" tone="neutral" data-bi-bulk-clear>Clear</Button>
</BulkActionBar>
</template>
Variants
Each variant communicates a different meaning. Choose based on priority, not aesthetics.
Single default variant.
Sizes
Size should match the importance and context of the component.
- md — md size.
States
This component reacts seamlessly to the following interaction and data states:
- default — Resting appearance before interaction.
- active — Currently selected or in use.
- disabled — Non-interactive — grayed out, cursor not-allowed.
Anatomy
Usage guidelines
- Follow the design system tokens.
- Maintain consistent spacing.
Do and Don't
Do
- Follow accessibility guidelines.
- Maintain visual hierarchy.
Don't
- Do not hardcode colors.
- Do not nest interactive elements.
Accessibility
This component follows standard ARIA patterns for its role. Keyboard interaction matches the native HTML element behavior.
Role:region
ARIA Attributes
aria-labelaria-livearia-disabled
Keyboard Navigation
- Tab to actions
- Enter or Space to trigger action
Customization
Override visual appearance by modifying variables.css or Tailwind utility classes.
Compose with React cva()
Use the exportedcva() +cn() utilities to compose your own variant on top of the Byteion tokens.
import { cva, cn, type VariantProps } from '@byteion/react';
const myBulkActionBar = cva('base classes…', {
variants: {
accent: { soft:'border-primary-200', loud:'border-primary-500' },
},
defaultVariants: { accent:'soft' },
});
type Props = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof myBulkActionBar>;
Compose with Vue cva()
Use the exportedcva() +cn() utilities inside standard Vue setup blocks.
<script setup lang="ts">
import { computed, useAttrs } from 'vue';
import { cva, type VariantProps } from '@byteion/vue';
interface Props { accent?:'soft' |'loud' }
const props = withDefaults(defineProps<Props>(), { accent:'soft' });
const attrs = useAttrs();
const myBulkActionBar = cva('base classes…', {
variants: { accent: { soft:'border-primary-200', loud:'border-primary-500' } },
});
const cls = computed(() => myBulkActionBar({ accent: props.accent, class: attrs.class as string | undefined }));
</script>
Runtime events
Byteion keeps framework APIs idiomatic: HTML uses DOM custom events, React uses callback props, and Vue uses emitted events / v-model updates.
HTML / JS events
bi:bulk-action-bar:actionbi:bulk-action-bar:clearbyteion:bulk-actionbyteion:bulk-clear
React callbacks
onAction(action: string, selectedIds: string[]) => voidonClear() => void
Vue emits
actionaction: string, selectedIds: string[]clear[]
Remote / AJAX
This component does not implement Byteion JS remote loading. Use normal HTML form submission, framework state, or your application data layer around it.
API Reference
No custom data attributes required. Uses standard HTML attributes.
HTML Data Attributes
No custom data attributes required.
React Props · BulkActionBarProps
Extracted directly fromreact/src/components/BulkActionBar.tsx.
export interface BulkActionBarProps extends HTMLAttributes<HTMLDivElement> {
selectedCount?: number;
selectedIds?: string[];
label?: string;
variant?: 'default' | 'floating';
onAction?: (action: string, selectedIds: string[]) => void;
onClear?: () => void;
}
Vue Props · BulkActionBarProps
Extracted directly fromvue/src/components/BulkActionBar.vue.
export interface BulkActionBarProps {
selectedCount?: number;
selectedIds?: string[];
label?: string;
variant?: 'default' | 'floating';
}
Developer tips
Common mistakes
Production usage tips
data-bi-* attributes instead of styling hooks.
Premium examples
Advanced patterns available in Byteion Pro:
Related components
Unlock Premium Patterns
Get access to copy-paste ready Pro blocks, SaaS templates, and advanced data-tables built with this component.
Explore Pro Components