metonym / svelte-typeahead

Accessible, fuzzy search typeahead component
https://metonym.github.io/svelte-typeahead
MIT License
222 stars 18 forks source link

[question] Is it possible to have typeahead with no css at all? Headless typeahead? #51

Open fredguth opened 2 years ago

fredguth commented 2 years ago

I wasn't able to customize typeahead to remove its background and change the look and feel of the results.

https://svelte.dev/repl/e83817000b5b4aa7bd3a3f83b20256c8?version=3.49.0

I even tried to create a "surrogate" input to input the values, but wasn't able to get the list of results.

metonym commented 2 years ago

You might need to increase the CSS specifity. Also, data-svelte-typehead is set on the outermost div, not the input.

:global([data-svelte-typeahead] [data-svelte-search] input) {
  background:red;
}

It would be nice if this component was more easily themeable, especially using a Svelte API like style props.

metonym commented 2 years ago

I like the idea of a "headless" Typeahead where the logic is shipped standalone.