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.
ts
import { Typeahead } from '@astryx-svelte/core';

Best practices

GuidancePractices
DoUse Typeahead or Tokenizer for standard fields; they wrap BaseTypeahead with the wrapper div, border styling, and token rendering it intentionally omits.
DoProvide your own wrapper div with border and layout when composing directly, since BaseTypeahead renders no visual chrome of its own.
DoPass anchorRef pointing to your wrapper so the dropdown positions against your custom input chrome, not just the bare input element.
Don'tExpect a wrapper div, border, or token rendering. BaseTypeahead is an engine only; all visual chrome is the caller's responsibility.
Don'tUse 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.