5 unstable releases
0.3.1 | Dec 4, 2023 |
---|---|
0.3.0 | Nov 25, 2023 |
0.2.0 | Jul 5, 2023 |
0.1.1 | Jun 7, 2023 |
0.1.0 | Jun 6, 2023 |
#484 in WebAssembly
41 downloads per month
39KB
917 lines
yew-autocomplete
A highly configurable auto completion component for yew.rs.
A minimal example that showcases the main building blocks:
use yew::prelude::*;
use yew_autocomplete::{view::Bulma, Autocomplete, ItemResolver, ItemResolverResult};
use yew_commons::FnProp;
let onchange = |_: Vec<String>| ();
let resolve_items: ItemResolver<String> =
FnProp::from(|_: String| -> ItemResolverResult<String> {
Box::pin(async { Ok(Vec::<String>::new()) })
});
html! {
<Autocomplete<String>
{resolve_items}
{onchange}
auto = false
>
<Bulma<String> />
</Autocomplete<String>>
};
lib.rs
:
This crate provides a highly configurable auto-completion component
A minimal example that showcases the main building blocks:
use yew::prelude::*;
use yew_autocomplete::{view::Bulma, Autocomplete, ItemResolver, ItemResolverResult};
use yew_commons::FnProp;
let onchange = |_: Vec<String>| ();
let resolve_items: ItemResolver<String> =
FnProp::from(|_: String| -> ItemResolverResult<String> {
Box::pin(async { Ok(Vec::<String>::new()) })
});
html! {
<Autocomplete<String>
{resolve_items}
{onchange}
auto = false
>
<Bulma<String> />
</Autocomplete<String>>
};
Dependencies
~11–20MB
~276K SLoC