Crate yew_autocomplete
source ·Expand description
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>>
};
Modules
Structs
- A Yew.rs Component with highly configurable auto completion capabilites
- Properties of the Autocomplete component
Enums
- Internal messages of the Autocomplete component
Type Aliases
- An async function that can be passed as a Prop, that takes the current value of the
Autocomplete
input and returns a Vec of Ts - The async result of the
ItemResolver