AppSearch
A search box — a leading magnifier, a placeholder, and one-click clear — for filtering a list or table.
<app-search name="q" placeholder="Search members…"></app-search><app-search> is the one search box. It pairs a leading magnifier with a text field and a one-click clear, so filtering a list or table looks and behaves the same everywhere — never an <app-input> with a magnifier bolted on.
Its look comes entirely from the shared @webority/theme, so the Razor <app-search> and the React <AppSearch> render identically — a search box is a search box on every Webority surface.
Playground
Every attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the field above it.
Basic
A search field with a leading icon, a placeholder, and a one-click clear to reset the query.
Show code
<app-search name="q" placeholder="Search members…"></app-search>
Sizes
size takes sm or lg (md is the default), matching AppInput so a search box lines up with the controls around it.
Show code
<app-search name="q" size="sm" placeholder="Small" /> <app-search name="q" placeholder="Medium (default)" /> <app-search name="q" size="lg" placeholder="Large" />
Loading
Set loading to swap the leading magnifier for a spinner while a search is in flight — for debounced or server-backed search.
Show code
<app-search name="q" loading="true" placeholder="Type to search…" />
Filtering a list
The common job: filter the rows below as the user types. Derive the filtered set from the query — the clear button resets straight back to the full list.
- Navneet Singh
- Kanchan Sharma
- Ramshankar Verma
- Akshat Gupta
- Priya Nair
Show code
<app-search name="q" placeholder="Search members…"></app-search> <!-- render the filtered rows below -->
When to use
Use it when
- The user narrows a list, table, or set of cards by typing a few characters.
- You want a consistent search affordance — magnifier + clear — above a collection.
- The match is a simple contains-filter over data already on screen.
Reach for something else when
- It is an ordinary text value in a form. → AppInput
- The user types to find one item from a large or remote list. → AppAutocomplete
- The user picks from a fixed, known set of options. → AppSelect
Best practices
Every option
The whole surface of the component, one cell per value — sizes, every combination of loading/disabled/populated, and the icon-size attribute a normal example never touches.
size — including the default
(default)
size="sm"
size="lg"
state — empty, populated, loading, disabled
(empty) — clear hiddenvalue="acme" — clear visibleloading — spinner replaces the icondisabled — clear suppressed even with a valuedisabled + loadingicon-size
icon-size="14"
icon-size="18" (default)
icon-size="24"
edge cases
long value — overflows the fixed-width field
class — extra class on the wrapper
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| name | string | — | Field name the search input posts under. |
| placeholder | string | Search… | Placeholder that names what is being searched. |
| value | string | — | Pre-filled query, e.g. when restoring a filter from the URL. |
| aria-label | string | — | Accessible name for the field — set it, as there is usually no visible label. |
| icon-size | int | 18 | Leading glyph size in px (React iconSize). |
| size | string | — | Control size: sm / lg. Omit for the default (md). |
| loading | bool | false | Swap the leading magnifier for a spinner while a search is in flight. |
| disabled | bool | false | Disables the field and hides the clear button. |