| Crates.io | yew-limput |
| lib.rs | yew-limput |
| version | 0.4.0 |
| created_at | 2025-03-22 17:09:39.847843+00 |
| updated_at | 2025-03-24 20:22:09.467651+00 |
| description | A yew component that provides an html input with real-time value filtering |
| homepage | |
| repository | https://github.com/sbruton/yew-limput |
| max_upload_size | |
| id | 1601968 |
| size | 39,209 |
General Text Input Constraints
use std::rc::Rc;
use yew::prelude::*;
use yew_limput::{LimitedTextInput, input_filter};
#[function_component]
fn Example() -> Html {
let filter = input_filter!(|c: &char| c.is_uppercase());
html! { <LimitedTextInput {filter} max_len={12} /> }
}
TOTP Code Input
LimitedNumericInput is the same as using LimitedTextInput with the filter |c: &char| c.is_ascii_digit()
use std::rc::Rc;
use yew::prelude::*;
use yew_limput::LimitedNumericInput;
#[function_component]
fn Example() -> Html {
let on_max_len = Callback::from(|code: String| {
unimplemented!("totp code processing");
});
html! { <LimitedNumericInput class="totp" max_len={6} {on_max_len} /> }
}