Officina UI
Components

SearchFilter

Debounced search box preset for filtering tables and lists by free text.

SearchFilter is a thin wrapper around SearchInput purpose-built for filter bars: it reports every keystroke through onChange (so the input stays responsive) while also exposing a separate onDebouncedChange you can wire to an actual query or API call, avoiding a request per keystroke.

Example

Preview
  • Ada Lovelace
    Enterprise
  • Grace Hopper
    Pro
  • Radia Perlman
    Pro
import { SearchFilter } from '@officina/ui';
import { useState } from 'react';

function CustomersFilterBar() {
  const [value, setValue] = useState('');
  return (
    <SearchFilter
      value={value}
      onChange={setValue}
      onDebouncedChange={(query) => console.log('fetch with', query)}
      debounceMs={300}
      placeholder="Search customers"
    />
  );
}

API

PropTypeDefaultDescription
onChange*(value: string) => void—Called on every keystroke with the raw input value.
value*string—Current search text (controlled).
debounceMsnumber—Debounce window in ms for `onDebouncedChange`.
onDebouncedChange(value: string) => void—Called with the value after `debounceMs` of inactivity.
placeholderstring—Placeholder text for the search input.

On this page