Named UI role recipes (panels, chrome, insets) for FastHTML applications — a stable abstraction layer over DaisyUI and Tailwind primitives.
Project description
cjm-fasthtml-design-system
Install
pip install cjm_fasthtml_design_system
Role in the Multi-Workflow Pipeline
This library sits between UI-bearing consumer libraries and the underlying styling primitives:
Consumers (page-centric libraries, host apps, demo apps)
↓ depend on
Layout primitives (cjm-fasthtml-app-core: page chrome, column+queue, toolbar)
↓ depend on
Design-system recipes (THIS LIBRARY: panels, chrome, insets, ...)
↓ depend on
Styling primitives (cjm-fasthtml-daisyui, cjm-fasthtml-tailwind: tokens)
Consumers import named roles (panels.dashboard_tile,
chrome.column_header) instead of reaching for styling tokens directly.
This makes coordinated styling changes a single-file edit in this
library rather than N-file edits across every consumer, and keeps the
role API stable across a potential future FastHTML-to-native port.
Design System Document
The multi-workflow design system is split between this library’s notebooks (codified conventions as running code) and a pointer-first Markdown document (cross-cutting content that cannot be codified):
- Codified conventions — the library is authoritative. V10 panel / chrome / inset variants are codified today as running code with CI-asserted test guards. Future conventions (V1 buttons, G6 icon sizes, G8 destructive-confirm, text-role tiers) will land here as additional notebooks.
- Non-codifiable content — the doc is authoritative. Principles
(P1–P12), the Refinement Procedure, open gaps, open questions,
priority tasks by workflow phase, and cross-library interaction /
layout / component directories live in
claude-docs/multi-workflow-design-system.md. The doc’s Conventions Directory references this library’s notebooks by convention ID.
Each codified convention maps to a notebook in nbs/:
| Convention | Notebook | Module | What it codifies |
|---|---|---|---|
| V10 Panel variants | nbs/panels.ipynb |
cjm_fasthtml_design_system.panels |
P1–P5 full-panel recipes |
| V10 Chrome variants | nbs/chrome.ipynb |
cjm_fasthtml_design_system.chrome |
C1–C2 column header/footer recipes |
| V10 Inset variants | nbs/insets.ipynb |
cjm_fasthtml_design_system.insets |
I1 opacity-modulated inset recipes |
The 2026-04-20 content-heavy inventory is preserved as a historical
snapshot at
claude-docs/multi-workflow-design-system-2026-04-23_11-53-14.md; the
pointer-first successor at claude-docs/multi-workflow-design-system.md
replaced it on 2026-04-23 as part of this library’s Phase 3 restructure.
See claude-docs/cjm-fasthtml-design-system-bootstrap-plan.md Appendix
C for the restructure rationale.
Usage
Every recipe module exports a module-level instance of a frozen dataclass. Consumers import the instance and use attribute access:
from fasthtml.common import Div
from cjm_fasthtml_design_system.panels import panels
from cjm_fasthtml_design_system.chrome import chrome
from cjm_fasthtml_design_system.insets import insets
from cjm_fasthtml_tailwind.core.base import combine_classes
from cjm_fasthtml_tailwind.utilities.sizing import w
from cjm_fasthtml_tailwind.utilities.spacing import m
# Stand-alone use
Div(..., cls=panels.structural_container)
# Composable with site-specific modifiers
Div(..., cls=combine_classes(w.full, m.t(4), panels.content_panel))
# Chrome sits inside a panel
Div(
Div('Header', cls=chrome.column_header),
Div('Body'),
Div('Status', cls=chrome.column_footer),
cls=panels.structural_container,
)
Why frozen dataclass: renaming a field is a breaking change announced in the type, which enforces namespace-as-public-contract discipline. Consumers can’t accidentally mutate roles at runtime. A native-platform port replaces the instantiation while keeping the class shape stable; consumer imports never move.
Why per-category modules: panels, chrome, and insets will evolve at different cadences. Keeping them separate means a change to one category doesn’t force re-export of the others.
Extending the Library
When a new convention accrues enough evidence to codify (e.g., G6
icon-size roles, V1 button-role codification, G8 destructive-confirm
composition — each currently tracked in the design-system doc’s Open
Gaps), add a new notebook under nbs/ following the V10 pattern:
- Create
nbs/<category>.ipynbwith#| default_exp <category>. - Define a frozen
XVariantsdataclass enumerating the roles. - Instantiate it at module scope as a singleton (e.g.,
x_variants = XVariants(...)). - Add attribute-level tests asserting each role contains its expected primitives.
- Update this index’s convention-to-notebook table and add a matching pointer row to the design-system doc’s Conventions Directory.
The recipe layer’s public contract is the set of dataclass class names and field names. Internal composition (which primitives each recipe combines) can evolve without breaking consumers as long as the field names stay stable. Notebook preambles should declare the convention ID and state the rationale directly — the design-system doc references the library, not vice versa.
Project Structure
nbs/
├── buttons.ipynb # Named button-role recipes for content-action affordances. Each role maps a semantic intent (primary call-to-action at a given surface scope, alternative path, soft dismissal, soft utility, item removal, destructive-but-cancellable, destructive irreversible) to a pre-composed CSS class string consumers apply via `Button(..., cls=buttons.X)`.
├── chrome.ipynb # Named chrome-role recipes for header and footer bands that accompany a content panel. Chrome is a `base_200` fill + rounded-corners band with intrinsic padding — no border of its own. When placed as a page-level sibling of a panel, the panel's border handles the between-surfaces separator; chrome's fill + radius read it as a self-contained sibling surface against the page's `base_100`.
├── icons.ipynb # Named icon-size-role recipes for the `lucide_icon(name, size=...)` factory. Each role maps a structural placement context (text-labeled button, ghost-styled standalone trigger, section-header decoration, empty-state illustration, etc.) to a size value the consumer passes through to `lucide_icon`. Two sizing strategies coexist in the catalog: fixed numeric (icon owns its absolute size) and container-fill (`"full"`, parent button's intrinsic padding owns the size).
├── insets.ipynb # Named inset-role recipes for opacity-modulated low-emphasis regions *inside* a panel. Insets never stand alone — they're sub-regions that need visual grouping without adding a second panel border.
├── panels.ipynb # Named panel-role recipes for full content containers with `border_radius.box`. Each role composes a specific set of DaisyUI and Tailwind primitives and exposes a stable attribute-access API for consumers.
└── text_tiers.ipynb # Named text-emphasis-tier recipes for opacity-modulated `text_dui.base_content` patterns. Each role maps an emphasis level (secondary, tertiary, muted, subtle) to a pre-composed CSS class string consumers apply via `Span(..., cls=text_tiers.X)` or compose into larger class lists. The catalog encodes the emphasis hierarchy observed across ~160 production sites; the roles compose orthogonally with `font_size`, `text_align`, `font_style.italic`, etc., which stay outside the catalog.
Total: 6 notebooks
Module Dependencies
graph LR
buttons[buttons<br/>Button Roles]
chrome[chrome<br/>Chrome Variants]
icons[icons<br/>Icon Size Roles]
insets[insets<br/>Inset Variants]
panels[panels<br/>Panel Variants]
text_tiers[text_tiers<br/>Text Tier Roles]
No cross-module dependencies detected.
CLI Reference
No CLI commands found in this project.
Module Overview
Detailed documentation for each module in the project:
Button Roles (buttons.ipynb)
Named button-role recipes for content-action affordances. Each role maps a semantic intent (primary call-to-action at a given surface scope, alternative path, soft dismissal, soft utility, item removal, destructive-but-cancellable, destructive irreversible) to a pre-composed CSS class string consumers apply via
Button(..., cls=buttons.X).
Import
from cjm_fasthtml_design_system.buttons import (
buttons,
ButtonRoles
)
Classes
class ButtonRoles:
"Named button-role recipes (V1). Each field is a pre-composed CSS class string."
Chrome Variants (chrome.ipynb)
Named chrome-role recipes for header and footer bands that accompany a content panel. Chrome is a
base_200fill + rounded-corners band with intrinsic padding — no border of its own. When placed as a page-level sibling of a panel, the panel’s border handles the between-surfaces separator; chrome’s fill + radius read it as a self-contained sibling surface against the page’sbase_100.
Import
from cjm_fasthtml_design_system.chrome import (
chrome,
ChromeVariants
)
Classes
class ChromeVariants:
"Named chrome-role recipes (V10). Header/footer bands with base_200 fill and rounded corners (no own border)."
Icon Size Roles (icons.ipynb)
Named icon-size-role recipes for the
lucide_icon(name, size=...)factory. Each role maps a structural placement context (text-labeled button, ghost-styled standalone trigger, section-header decoration, empty-state illustration, etc.) to a size value the consumer passes through tolucide_icon. Two sizing strategies coexist in the catalog: fixed numeric (icon owns its absolute size) and container-fill ("full", parent button’s intrinsic padding owns the size).
Import
from cjm_fasthtml_design_system.icons import (
IconSize,
icons,
IconRoles
)
Classes
class IconRoles:
"Named icon-size-role recipes (V11). Each field maps a structural placement to a size value passed to `lucide_icon(name, size=...)`."
Inset Variants (insets.ipynb)
Named inset-role recipes for opacity-modulated low-emphasis regions inside a panel. Insets never stand alone — they’re sub-regions that need visual grouping without adding a second panel border.
Import
from cjm_fasthtml_design_system.insets import (
insets,
InsetVariants
)
Classes
class InsetVariants:
"Named inset-role recipes (V10). Opacity-modulated low-emphasis regions inside a panel."
Panel Variants (panels.ipynb)
Named panel-role recipes for full content containers with
border_radius.box. Each role composes a specific set of DaisyUI and Tailwind primitives and exposes a stable attribute-access API for consumers.
Import
from cjm_fasthtml_design_system.panels import (
panels,
PanelVariants
)
Classes
class PanelVariants:
"Named panel-role recipes (V10). Each field is a pre-composed CSS class string."
Text Tier Roles (text_tiers.ipynb)
Named text-emphasis-tier recipes for opacity-modulated
text_dui.base_contentpatterns. Each role maps an emphasis level (secondary, tertiary, muted, subtle) to a pre-composed CSS class string consumers apply viaSpan(..., cls=text_tiers.X)or compose into larger class lists. The catalog encodes the emphasis hierarchy observed across ~160 production sites; the roles compose orthogonally withfont_size,text_align,font_style.italic, etc., which stay outside the catalog.
Import
from cjm_fasthtml_design_system.text_tiers import (
text_tiers,
TextTierRoles
)
Classes
class TextTierRoles:
"Named text-emphasis-tier recipes (V13). Each field is a pre-composed CSS class string applying opacity modulation to `text_dui.base_content`."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cjm_fasthtml_design_system-0.0.9.tar.gz.
File metadata
- Download URL: cjm_fasthtml_design_system-0.0.9.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d10dd560289f78ee729c33154d6fa7c9e209ee1f07c1be0016afe94e1d4bfb6f
|
|
| MD5 |
83d40faafd1fe530a845a2499104f69e
|
|
| BLAKE2b-256 |
b9de21d29ba717ece4177c2ee36dbd573b25891959c407db80ed726d79094dbd
|
File details
Details for the file cjm_fasthtml_design_system-0.0.9-py3-none-any.whl.
File metadata
- Download URL: cjm_fasthtml_design_system-0.0.9-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65338774e233bb34f00ba6f4b8da654b4a5f03f8319a648ed13ceabc80c939ac
|
|
| MD5 |
522777bfbd16db210cd989ade3246529
|
|
| BLAKE2b-256 |
00a5db9bf6e78da624bca863e64f94ca79fa874a9b67b9f9c2a8bef91956252a
|