#[derive(BasecoatProps)]
{
// Attributes available to this derive:
#[prop]
}
Expand description
#[derive(BasecoatProps)] generates a builder for component prop structs.
§Field attributes
#[prop(default)]— field usesDefault::default()if not provided in builder.#[prop(default = expr)]— field usesexprif not provided.#[prop(into)]— builder setter acceptsimpl Into<FieldType>.#[prop(optional)]— field isOption<T>; missing →None.#[prop(extend)]— marks theAttrMapcatch-all field (at most one per struct).
§Builder design choice
We use a runtime-panic builder for v0.1. A typestate builder would require one
phantom-type parameter per required field and substantially more generated code.
For a UI component library where every field is either optional or has a default,
the extra complexity of typestate adds no practical safety benefit. If a required
field (no default/optional) is omitted, build() panics with a clear message.
§Hydration helper
A const __BASECOAT_EXTEND_FIELD: Option<&'static str> associated constant is
emitted on the props struct so the rsx! macro (phase 2c) can discover at compile
time where to push unknown HTML attributes.