@sikt/sds-combobox
v2.0.1
Published
## Consume
Downloads
678
Readme
@sikt/sds-combobox
Consume
npm i -s @sikt/sds-{combobox,form}
React
With dynamic content
import { Combobox, ComboBoxItem } from "@sikt/sds-combobox";
import "@sikt/sds-form/dist/index.css";
import "@sikt/sds-combobox/dist/index.css";
<Combobox
label="..."
defaultItems={[
{ title: "foo", id: 1 },
{ title: "baz", id: 2 },
]}
>
{(item) => <ComboBoxItem>{item.title}</ComboBoxItem>}
</Combobox>;
With static content
<Combobox label="...">
<ComboBoxItem id="Foo">Foo</ComboBoxItem>
<ComboBoxItem id="Baz">Baz</ComboBoxItem>
</Combobox>
Additional information
For any additional details, troubleshooting, or advanced features, please consult the React Aria ComboBox documentation.
https://react-spectrum.adobe.com/react-aria/ComboBox.html
Stylesheets
Import stylesheet:
@import url("@sikt/sds-form");
@import url("@sikt/sds-combobox");