MiHCM
primitives/@mihcm/ui·v0.21.0·stable

SearchField

Sugar wrapper around Input that ships the magnifier glyph, a clear button, and role="search". Universal across web and native.

In context

Large workspace search with shortcut hint, live directory filter, help-center scoped search, and a noClear command bar.

Workspace search

Large search with helper meta and shortcut hint.

Searching for "payroll april"…

Directory

5 of 5 people

Yashi EL
Yashi EL
People Ops Lead
Marcus Reid
Marcus Reid
Senior Engineer
Priya Anand
Priya Anand
Engineering Manager
Jordan Diaz
Jordan Diaz
Recruiter
Noah Smith
Noah Smith
CS Lead

Help center

Scoped search returns matching articles only.

How payroll runs workPayroll

Command bar

`noClear` removes the inline reset affordance.

Without the clear button, the field reads as a command surface rather than a list filter.
import { useState } from 'react';
import { SearchField } from '@mihcm/ui/SearchField';
 
const [query, setQuery] = useState('');
 
<SearchField
  value={query}
  onValueChange={setQuery}
  placeholder="Search anything…"
/>

Employee lookup (MiHCM Security)

<SearchField
  value={query}
  onValueChange={setQuery}
  placeholder="Search by name, email, or employee number…"
  className="w-full"
/>

With shortcut hint

<SearchField
  value={query}
  onValueChange={setQuery}
  size="sm"
  placeholder="Search docs…"
  trailingSlot={
    <kbd className="rounded border border-border px-1.5 text-[10px] text-muted-foreground">
      ⌘K
    </kbd>
  }
/>

Debounced filter

import { useEffect, useState } from 'react';
import { SearchField } from '@mihcm/ui/SearchField';
 
const [value, setValue] = useState('');
 
useEffect(() => {
  const id = setTimeout(() => onSearch(value), 300);
  return () => clearTimeout(id);
}, [value, onSearch]);
 
<SearchField value={value} onValueChange={setValue} />