Skip to main content
spaday-fluent logo, Fluent 2 mark inside a browser window

Typed Fluent UI web components and browser assets for spaday.

Build Status codecov License PyPI

Preview of Fluent components in spaday rendering a sprint hub

Overview

from spaday import SetField, element, serve
from spaday_fluent import FluentBadge, FluentButton

page = element("div").child(
    FluentButton(appearance="primary").text("Approve").on("click", SetField("state", "approved")),
    FluentBadge(color="brand").bind("textContent", "state"),
)
serve(page, packages=["fluent"], store={"state": "pending"})

Every element of @fluentui/web-components has a typed class generated from its Custom Elements Manifest, so props, events and slots are checked when you author the tree; enum props such as appearance carry their choices. Installing the package does not inject assets; select it with packages=["fluent"] or pass the exported package descriptor.

Generic controls

Eleven of the 13 generic controls in spaday.ui render as Fluent elements when a page selects this package. Fluent Web Components 3.1.3 has no number or date control, so NumberInput and DateInput use spaday's marked native fallback. The mapping is exported as DESIGN; the shared conformance page checks every control, value updates, visible radio labels, validation state, and dialog behavior in a browser.

Theming

Fluent's design tokens are CSS custom properties. The stylesheet carries Fluent's light and dark themes and maps spaday's --spa-* shell palette onto them, so restyling Fluent restyles the shell and every other spaday component package with it. TOKENS lists the Fluent tokens wired to the palette, each settable through css():

App().css(colorBrandBackground="#0C4253")

The dark theme follows spaday's page mode: a wa-dark class on the root (for example App(...).bind_root_class("wa-dark", "dark")) or on any island switches it, and wa-light flips a nested island back. A theme applied with Fluent's own setTheme() takes precedence.

Sharing Fluent with your own library

Fluent registers global custom element names, so a second copy on the page throws from customElements.define. The package serves Fluent's modules under their own bare specifiers — @fluentui/web-components, @fluentui/web-components/button.js and the rest of its exports — along with @microsoft/fast-element, which a library extending Fluent's classes has to share, and @fluentui/tokens, through the page's import map. A library built on Fluent that leaves those imports out of its bundle (external: ["@fluentui/web-components", "@microsoft/fast-element"] with esbuild) gets this copy, and nothing registers twice.

Browser examples

Both run Python locally through Pyodide; no install or server is required.

Run examples locally

python -m pip install -e ".[examples]"
python -m spaday_fluent.example
python -m spaday_fluent.gallery

Open http://127.0.0.1:8024 for the standard sprint-command-center app or http://127.0.0.1:8025 for the component gallery. The standard app includes a task board streamed from Python, endpoint-backed task creation and completion, live activity and presence, bound forms, tabs, overlays, and shared dark-theme state. The gallery includes every generated Fluent component and a highlighted Python snippet for each component family.

Both pass the local package descriptor directly, so they do not install or resolve the integration from GitHub.

Metadata

Release files for spaday-fluent 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spaday-fluent 0.2.0
File Size Uploaded
spaday_fluent-0.2.0.tar.gz 593.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spaday-fluent 0.2.0
File Interpreter ABI Platform
spaday_fluent-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / spaday_fluent-0.2.0.tar.gz

Download URL spaday_fluent-0.2.0.tar.gz
Size 593.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a02af6001053b48fc0a84794f18f148d45f661deae58bf0fc027e7199407fece
BLAKE2b-256 checksum
How to use checksums
d55a58d8700c2be13305ac82c7c8105d3a060e068a769b10e25bd2584d6c36cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / spaday_fluent-0.2.0-py3-none-any.whl

Download URL spaday_fluent-0.2.0-py3-none-any.whl
Size 733.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
744305602e3709d4a8ab236d8e6eb3529065494abb5a4c5e8958b7344e385b53
BLAKE2b-256 checksum
How to use checksums
5e65dd724565f0d79e32a05378da8571acbb99112ef1e1b9b1655fc98b9a6338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page