smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Svelte · Forms and controls

SearchInput

A search input with built-in functionality.

Public export

typescript
import { SearchInput } from '@happyvertical/smrt-svelte/forms';
Import path
@happyvertical/smrt-svelte/forms
Props
12
Props described
12 of 12
Bindable state
0
Callback events
3
Verified release
0.62.10

Props

NameTypeRequiredDescription
valuestringNoCurrent search value
placeholderstringNoPlaceholder text
debouncenumberNoDebounce delay in ms (0 for no debounce)
loadingbooleanNoShow loading indicator
disabledbooleanNoWhether the input is disabled
size'sm' | 'md' | 'lg'NoSize variant
idstringNoID for the input element
namestringNoName attribute
ariaLabelstringNoARIA label
onsearch(value: string) => voidNoCallback when value changes (after debounce)
oninput(value: string) => voidNoCallback for immediate value changes
onsubmit(value: string) => voidNoCallback when Enter is pressed

Bindable state

This component has no bindable public state.

Callback events

  • onsearch(value: string) => void
  • oninput(value: string) => void
  • onsubmit(value: string) => void

Examples and explanation