[yew-devel] [PATCH yew-widget-toolkit v2 1/2] number: add tooltip to number field

Dominik Csapak d.csapak at proxmox.com
Thu Oct 9 13:51:36 CEST 2025



On 10/9/25 1:24 PM, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
> ---
>   src/widget/form/number.rs | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/src/widget/form/number.rs b/src/widget/form/number.rs
> index 80f7f6c..ad1a3cd 100644
> --- a/src/widget/form/number.rs
> +++ b/src/widget/form/number.rs
> @@ -368,6 +368,11 @@ pub struct Number<T: NumberTypeInfo> {
>       #[builder_cb(IntoEventCallback, into_event_callback, (String, Option<T>))]
>       #[prop_or_default]
>       pub on_input: Option<Callback<(String, Option<T>)>>,
> +
> +    /// The tooltip.
> +    #[prop_or_default]
> +    #[builder(IntoPropValue, into_prop_value)]
> +    pub tip: Option<AttrValue>,
>   }
>   
>   impl<T: NumberTypeInfo> Default for Number<T> {


please correct me if I'm wrong, but just adding the tip to the 
properties alone wouldn't do anything on its own.

You have to at least use it in the 'view' method, e.g. like this:


---
  let mut input_container: Tooltip = Tooltip::empty()
      .with_std_props(&props.std_props)
      .listeners(list: &props.listeners)
      .tip(props.tip.clone())
---




More information about the yew-devel mailing list