docs/components/input/SearchInput

SearchInput

Input with search icon and clear button.

import { SearchInput } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#More Examples

With Placeholder

<SearchInput placeholder="Search files..." />

With Shortcut

<SearchInput placeholder="Search" shortcut="⌘K" />

#Props

PropTypeDefaultDescription
valuestringControlled input value.
placeholderstring'Search...'Placeholder text.
shortcutstringKeyboard shortcut hint displayed when empty.
onSearch(value: string) => voidCallback when Enter key is pressed.
onChange(value: string) => voidCallback when input value changes.
onClear() => voidCallback when clear button is clicked.
classstringAdditional CSS classes.
autofocusbooleanfalseAuto-focus the input on mount.
disabledbooleanfalseDisable the input.
unstyledbooleanfalseRemove all default styling classes.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-bg-primary
  • --sk-bg-secondary
  • --sk-border-subtle
  • --sk-duration-fast
  • --sk-font-size-base
  • --sk-height-md
  • --sk-radius-md
  • --sk-space-sm
  • --sk-text-muted
  • --sk-text-primary