#web-frontend #webasm #web

macro yew-autoprops

proc-macro to automatically derive Properties structs from args for Yew components

7 releases (4 breaking)

0.5.0 Mar 16, 2026
0.4.1 Dec 4, 2023
0.3.0 Oct 30, 2023
0.2.2 May 22, 2023
0.1.0 May 21, 2023

#1500 in WebAssembly

Download history 554/week @ 2026-02-18 1058/week @ 2026-02-25 1364/week @ 2026-03-04 818/week @ 2026-03-11 452/week @ 2026-03-18 733/week @ 2026-03-25 1409/week @ 2026-04-01 726/week @ 2026-04-08 687/week @ 2026-04-15 339/week @ 2026-04-22 67/week @ 2026-04-29 404/week @ 2026-05-06 342/week @ 2026-05-13 249/week @ 2026-05-20 125/week @ 2026-05-27 636/week @ 2026-06-03

1,356 downloads per month

MIT/Apache

17KB
249 lines

yew-autoprops

Crate Info API Docs

proc-macro to automatically derive Properties structs from args for Yew components

No more extra one-off Props structs!

Examples

use yew_autoprops::autoprops;
use yew::prelude::*;

#[autoprops]
#[component]
fn CoolComponent(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
    html! {
        <div class={classes!(hidden.then_some("hidden"))}>
            <p>{ smth }</p>
        </div>
    }
}
use yew_autoprops::autoprops;
use yew::prelude::*;

#[autoprops(CoolComponentProps)]
#[component(CoolComponent)]
fn cool_component(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
    html! {
        <div class={classes!(hidden.then_some("hidden"))}>
            <p>{ smth }</p>
        </div>
    }
}

Dependencies

~96–440KB
~11K SLoC