API reference

Generated components

spaday_webawesome.components contains typed classes generated from WebAwesome’s committed Custom Elements Manifest. Class names follow the upstream tags: WaButton maps to <wa-button>, WaInput maps to <wa-input>, and so on. Constructor keyword arguments mirror manifest attributes.

All generated names are re-exported from spaday_webawesome.

from spaday_webawesome import WaButton

WaButton(variant="brand", size="small").text("Save")

Helpers

class spaday_webawesome.Tabs(*, active: str | None = None, placement: str | None = None, key: str | None = None, **props: Any)[source]

Bases: Component

A wa-tab-group built from labelled content panels.

Bind active two-way to keep application state synchronized with user tab selection.

tab(label: str, *content: Component | dict | str, name: str | None = None) → Tabs[source]

Add linked wa-tab and wa-tab-panel children.

class spaday_webawesome.FormField(label: str | None = None, exclude: bool = False, control: Component | Callable[[str, Any, bool], Component] | None = None, group: Callable[[str, Column], Component] | None = None)[source]

Bases: object

Per-field overrides for form().

Attach one of two ways — co-located on the model with Annotated[T, FormField(...)], or at the call site with form(model, overrides={path: FormField(...)}) (the call-site one wins; path is the field name, or a dotted parent.child to reach a nested field). Use it to:

  • drop a field — exclude=True

  • relabel it — label="…"

  • replace its control — control= either a ready Component (two-way bound to the field on value for you — good for inputs/selects/radios), or a (field, annotation, required) -> Component factory you bind yourself (for anything else, e.g. a checked binding)

  • wrap a sub-model group — group= a (label, inner: Stack) -> Component factory; the default is an open wa-details (expand/collapse). Return a WaCard, a WaDrawer, or a collapsed WaDetails(summary=label) to present the nested section differently.

spaday_webawesome.form(model: Any, *, exclude: tuple = (), overrides: dict[str, FormField] | None = None) → Column[source]

A two-way-bound form for a validation schema.

model may be a pydantic model (class or instance), a TypeAdapter (so any type pydantic can validate — dataclasses, TypedDict, etc.), or a raw JSON Schema dict. Fields in exclude are skipped (by name, or dotted parent.child for a nested one). Per-field tweaks come from FormField — either Annotated on a pydantic model, or supplied/overridden here via overrides={path: FormField(...)} (which wins). A nested object becomes an expand/collapse wa-details section whose controls bind to parent.child paths.

The pydantic-model path keeps detail a JSON Schema can’t carry — Enum member names as option labels, and the exact Python annotation passed to a control factory. Via a TypeAdapter or a raw dict those degrade gracefully (enum options are labeled by their raw value; a factory’s annotation is a best-effort Python type — str/int/float/bool — or None).

Tabs.tab(label, *content, name=None) adds a linked <wa-tab> and <wa-tab-panel>. The default name is a slug of the label.

form(source, ...) accepts a pydantic model class, model instance, TypeAdapter, or JSON Schema mapping.

package

spaday_webawesome.package is a spaday.ComponentPackage named webawesome. Assets load in this order:

  1. css/webawesome.css

  2. cdn/index.js

The CSS maps WebAwesome theme colors onto core --spa-* shell tokens. The JavaScript bundle registers the full component catalog. package.components contains every generated component class; package.catalog returns their property, event, and slot schemas.

package.imports publishes WebAwesome’s own ES modules under its bare specifiers, which spaday emits as the page’s import map:

Specifier

Served from

@awesome.me/webawesome

vendor/@awesome.me/webawesome/dist/webawesome.js

@awesome.me/webawesome/dist/

vendor/@awesome.me/webawesome/dist/

The bundle imports the catalog through those specifiers too, so any other module on the page that imports them gets the same copy.