Pathfinderby Commenda
Components

Search

Query entry for tables, pages, and global document search.

Installation

Import the component in your screen:

Example.tsx
import { Search } from '@commenda/pathfinder/search';

Load the stylesheet once in your app root, after host styles:

Example.tsx
import '@commenda/pathfinder/styles.css';

Pathfinder ships precompiled CSS; no Tailwind setup is required. In Next.js App Router, put interactive state and callbacks in a client component. See installation for the workspace setup.

API reference

PropTypeBehavior
variant"fixed"|"expandable"|"global"fixed; heights 28/28/40px
loadingConfigObjectView fieldsSpinner replaces search icon
shortcutConfigObjectView fieldsOpt-in scoped shortcut; ignores typing targets
onSearch(query: string) => voidEnter submission; ignored during IME composition
labelConditionalstringVisible field label. Supply an accessible name when it is omitted.
hideLabelbooleanVisually hide the label while preserving its accessible name.
aria-labelConditionalstringAccessible name when the field has no visible label.
requiredConditionalbooleanMark the field as required. See validation guidance for the component.
labelConfigObjectView fields · 2 shapesChoose either optionalLabel or help, never both. never excludes the other field.
descriptionstringSupporting guidance associated with the field.
errorConfigObjectView fieldsValidation message and when it becomes visible.
disableConfigDisableConfigView fieldsDisabled state with an optional explanation.
valueConditionalstring—
onValueChangeConditional(value: string) => void—
defaultValuestring—
loadingConfigObject fields
FieldTypeRequirement
isLoadingbooleanRequired
labelstringOptional
shortcutConfigObject fields
FieldTypeRequirement
keystringRequired
labelstringRequired
scopeIdstringRequired
labelConfigObject fields

Choose one of these 2 shapes. Do not combine fields excluded by the selected shape.

Option 1

FieldTypeRequirement
optionalLabelstringRequired

Do not supply: help.

Option 2

FieldTypeRequirement
helpstringRequired

Do not supply: optionalLabel.

errorConfigObject fields
FieldTypeRequirement
messagestringRequired
reveal"after-blur" | "immediate"Optional
disableConfigObject fields
FieldTypeRequirement
isDisabledbooleanRequired
reasonstringOptional

Supports Input’s shared field presentation and native search-input attributes. Use hideLabel where the surrounding toolbar supplies visual context; an accessible label is still required.

Keyboard and request behavior

Application code handles debounce and requests; onValueChange is immediate. onSearch is Enter submission, not each keystroke. Escape clears the query, then blurs a fixed/global input or collapses expandable search and restores trigger focus. The clear button clears and folds expandable search. Loading is application-owned.

A result overlay handles Escape first through onKeyDown and preventDefault; the field then retains its query. Search result navigation is a documented composition, separate from selecting a saved value. Do not implement a second global shortcut listener on every instance: shortcutConfig binds only to the specified scope element and ignores editing targets.

Variants

States

Searching
Search is unavailable while importing.

Results

Read selection and search rules for source provenance, API ownership, and constraints.

Design rules

Figma guidance and reviewed implementation decisions for this component. Rule IDs remain stable for source comments and AI references.

Source rules

RuleFigma sourceContract
SEARCH-001636:31822Fixed/expandable 28px; expandable opens to 220px; global 40px/max720.
SEARCH-002637:32230, 637:32236Expandable in table toolbar; result counts belong in table range text.
SEARCH-003637:32193, 637:1779Escape closes results, clears, then blurs/collapses. Clear folds expandable search.

Sources: Search, Select, MultiSelect. The supplied Select node 182:1182 is its dimensions frame; 180:1177 is the actual component set.

Accessibility and forms

Labels, descriptions, error reveal, and disable reasons follow the shared field contract. Single selection serializes one ID; multiple selection serializes repeated names. Trigger refs and form reset work for both primitive paths. Searchable popups provide an explicitly named query input. Load more and retry are keyboard-accessible buttons outside the option list.

Tag remove buttons are siblings of the trigger, never nested inside it. Long selected labels remain available through tooltips. Search result compositions must handle overlay Escape before field clear/collapse through preventDefault.

Flags, chevrons, and clear/remove icons sit in explicit square flex containers with both axes centered. Do not rely on inline SVG baseline alignment or compensate with pixel offsets. The selected value, tags, and trailing controls share the field’s vertical center. Row Checkbox instances are inert visual indicators; the option owns selection and accessibility semantics.

On this page