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§

view

Structs§

Autocomplete
A Yew.rs Component with highly configurable auto completion capabilites
Props
Properties of the Autocomplete component

Enums§

Msg
Internal messages of the Autocomplete component

Type Aliases§

ItemResolver
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
ItemResolverResult
The async result of the ItemResolver