0.0.4 • Published 7 months ago

qwik-select-fixed v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

qwik-select

A select/autocomplete component for Qwik apps.

You can use the built-in unstyled component or build your own UI component with the core hook.

  • Single select
  • Multi-select
  • Typeahead
  • Async support (dynamically fetching data)
  • Zero dependencies

Installation

  npm install qwik-select

Usage

import { component$, useStyles$, useStore } from "@builder.io/qwik";
import { Select } from "qwik-select";
import styles from "qwik-select/style.css?inline";

export default component$(() => {
  const state = useStore({
    items: ["One", "Two", "Three", "Four", "Five"],
    selectedItem: undefined,
  });

  useStyles$(styles);
  return (
    <div>
      <Select
        options={state.items}
        value={state.selectedItem}
        onSelect$={(it) => (state.selectedItem = it)}
        onClear$={() => (state.selectedItem = undefined)}
      />
    </div>
  );
});

See the documentation for more examples.

Acknowledgements

License

MIT

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago