Multi-Select Across Different Filters
Demonstration of maintaining selection state when switching between filters
💡
Use Case: You need to delete/export multiple items from different filter states.
- Select items from "Active Users" filter
- Switch to "Archived Users" filter
- Select more items from archived list
- Your previous selections are preserved
- View all selected items in the selection panel
Key Features:
- Compact Summary Bar: Shows selection count and actions without pushing content down
- Expandable Details: Click "Show Details" to see full list of selected items
- Visual Indicators: Selected rows highlighted in current table view
- Filter Badges: Shows count of selections per filter tab
- Cross-Filter Selection: Selections preserved when switching between filters
Filter by Status
Active Users 3 items
| Actions | Name | Status | Last Login | ||
|---|---|---|---|---|---|
|
|
John Doe | john@example.com | Active | 2025-10-13 | |
|
|
Jane Smith | jane@example.com | Active | 2025-10-12 | |
|
|
Mike Johnson | mike@example.com | Active | 2025-10-11 |
Implementation Notes
Visual Pattern Components
-
Selection Summary Bar
- Appears between filters and data table when items are selected
- Shows selection count and bulk action buttons (Delete, Export, Clear)
- "Show Details" button to expand full list (collapsed by default)
- Uses
pa-alert pa-alert--primaryfor visual consistency
-
Selection Details Table (Expandable)
- Hidden by default, user can expand via "Show Details" button
- Shows full table of all selected items from all filters
- Includes "Source Filter" column showing where each item was selected
- Individual remove buttons per row for granular control
-
Filter Tab Badges
- Each filter tab shows count of selected items from that filter
- Updates in real-time as selections change
-
Row Highlighting
- Selected rows have distinct background via
pa-table__row--selected - Checkboxes remain checked when switching filters
- Selected rows have distinct background via
-
Bulk Selection Controls
- "Select All Visible" — checks all rows in current filter view
- "Deselect All Visible" — unchecks visible rows (preserves hidden selections)
- Header checkbox with indeterminate state support
LiveView Implementation
This demo uses server-side state management via LiveView assigns:
- Selection stored as a Map keyed by item ID with item data and source filter
- Filter switching preserves all selections across filter states
- All UI updates happen via standard LiveView event handling
⚠️
Note: For large datasets, consider using LiveView streams and
paginated selection tracking to avoid loading all items into memory.