metonym / svelte-typeahead

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

Change or hide "Label" #59

Closed stukennedy closed 2 years ago

stukennedy commented 2 years ago

Currently "Label" seems to be hard coded and fixed as it is not exposed as a prop on the svelte-typeahead, only on the svelte-search component.

Can't figure out how to hide it or change it.

metonym commented 2 years ago

$$restProps are forwarded to svelte-search, which allows customization of the label text through the label prop. You can also set hideLabel to true to visually hide the label. I would recommend setting a label even if visually hiding the label for accessibility.

Svelte REPL

<Typeahead
  label="U.S. States"
  hideLabel
  {data}
  {extract}
/>
metonym commented 2 years ago

I've updated the docs with examples.