Log Filtering Toolbar

Log Filtering Toolbar

Enterprise
Workflow

Advanced filtering toolbar for searching and filtering audit logs by severity, category, and text with severity-tinted toggles, applied-filter tags and multi-select support.

Preview

Try filtering by different criteria

Severity:
Category:
Applied:errorAI

onFilterChange payload:

{
  "severity": [
    "error"
  ],
  "category": [
    "AI"
  ],
  "searchQuery": ""
}

Custom Categories

Toolbar with custom category and severity options

Severity:
Category:

Props

LogFilteringToolbar component API reference

PropTypeDefaultDescription
onFilterChange*(filters: LogFilters) => void—Callback when filters change
availableCategoriesstring[]['REQUEST', 'AI', 'ROUTE', 'APPROVAL', 'ERROR']List of category options
availableSeveritiesstring[]['info', 'warning', 'error', 'success']List of severity options
classNamestring—Additional CSS classes

LogFilters Type

PropTypeDefaultDescription
severitystring[]—Selected severity levels
categorystring[]—Selected categories
dateRange{ start: Date; end: Date }—Date range filter
searchQuerystring—Text search query

Usage

Import and implementation example

import { LogFilteringToolbar } from '@/components/ui/log-filtering-toolbar'
export default function Example() {
const [filters, setFilters] = useState({})
return (
<LogFilteringToolbar
onFilterChange={setFilters}
availableCategories={['REQUEST', 'AI', 'ROUTE', 'APPROVAL', 'ERROR']}
availableSeverities={['info', 'warning', 'error', 'success']}
/>
)
}
This block is self-contained (no UI component dependencies)

Features

Built-in functionality

  • Text search: Full-text search across log entries
  • Severity filtering: Color-coded toggle buttons for severity levels
  • Category filtering: Filter by log category or source
  • Multi-select: Combine multiple filters for precise results
  • Clear all: One-click reset for all active filters
  • Customizable: Define your own severity levels and categories

Accessibility

Accessibility considerations

ARIA Attributes

Filter buttons are native button elementsSearch input has proper input semanticsClear button is labeled

Keyboard Navigation

KeyAction
TabNavigate between search and filter buttons
Enter / SpaceToggle filter buttons

Notes

  • Severity colors have sufficient contrast
  • Selected state indicated by fill color change
  • Filter count communicated in button labels
  • Clear filters button only appears when filters are active