Base Typeahead @astryx-svelte/core v0.3.0 · Typeahead
Usage
Unstyled combobox engine providing input, search, keyboard navigation, and dropdown. No wrapper div, no border styling, no token rendering. Used by Typeahead and Tokenizer for custom compositions.tsimport { Typeahead } from '@astryx-svelte/core';
Best practices
| Guidance | Practices |
|---|---|
| Do | Use Typeahead or Tokenizer for standard fields; they wrap BaseTypeahead with the wrapper div, border styling, and token rendering it intentionally omits. |
| Do | Provide your own wrapper div with border and layout when composing directly, since BaseTypeahead renders no visual chrome of its own. |
| Do | Pass anchorRef pointing to your wrapper so the dropdown positions against your custom input chrome, not just the bare input element. |
| Don't | Expect a wrapper div, border, or token rendering. BaseTypeahead is an engine only; all visual chrome is the caller's responsibility. |
| Don't | Use BaseTypeahead when Typeahead or Tokenizer would suffice; the extra wrapper and styling work is only justified for truly custom compositions. |
Examples
Common configurations, variations, and states.BaseTypeahead — Custom Search Bar
BaseTypeahead embedded inside a custom-styled wrapper. The wrapper provides its own border and icon chrome; anchorRef positions the dropdown relative to it. Use this pattern when Typeahead's built-in field layout does not fit your composition.