Search Input

Search input with icon, clear button, keyboard shortcut badge, and built-in debounce.

InputTypeDefaultDescription
placeholderstring'Search...'Placeholder text
disabledbooleanfalseDisabled state
shortcutstring''Keyboard shortcut badge text
debounceMsnumber300Debounce delay in ms
valuestring''Two-way bound value
OutputTypeDescription
searchstringDebounced search event

Import & Usage

typescript
import { Component, signal } from '@angular/core';
import { NgOatSearchInput } from '@letsprogram/ng-oat';

@Component({
  selector: 'app-example',
  imports: [NgOatSearchInput],
  template: `
    <ng-oat-search-input
      placeholder="Search docs..."
      shortcut="โŒ˜K"
      [debounceMs]="300"
      [(value)]="query"
      (search)="onSearch($event)" />
  `,
})
export class ExampleComponent {
  query = signal('');
  onSearch(term: string) {
    console.log('Search:', term);
  }
}

Basic

Query: "" ยท Last search: ""

html
<ng-oat-search-input [(value)]="query" (search)="onSearch($event)" />

With Keyboard Shortcut

โŒ˜K
html
<ng-oat-search-input placeholder="Search docs..." shortcut="โŒ˜K" />

Custom Debounce

Last debounced: ""

html
<ng-oat-search-input
  placeholder="Slow debounce (1s)..."
  [debounceMs]="1000"
  (search)="onSearch($event)"
/>

Disabled

html
<ng-oat-search-input [disabled]="true" placeholder="Search disabled" />