@reach-ui-fork/listbox
v0.18.1
Published
Accessible React listbox input.
Downloads
68
Readme
@reach-ui-fork/listbox
An accessible listbox for custom select inputs.
import * as React from "react";
import { Listbox, ListboxOption } from "@reach-ui-fork/listbox";
import "@reach-ui-fork/listbox/styles.css";
function Example(props) {
let [value, setValue] = React.useState("default");
return (
<Listbox value={value} onChange={(value) => setValue(value)}>
<ListboxOption value="default">🌮 Choose a taco</ListboxOption>
<hr />
<ListboxOption value="asada" valueText="Carne Asada">
🌮 Carne Asada
</ListboxOption>
<ListboxOption value="pollo" valueText="Pollo">
🌮 Pollo
</ListboxOption>
<ListboxOption value="pastor" valueText="Pastor">
🌮 Pastor
</ListboxOption>
<ListboxOption value="lengua" valueText="Lengua">
🌮 Lengua
</ListboxOption>
</Listbox>
);
}