The framework's tree
127 packages, read live. This page writes no name and no description: it calls `describe_package('bretzel')` and renders what comes back. A folder added tomorrow appears here without anyone touching this file.Two levels, and they complement each other
The folders marked “classified” ALSO have a table grouping their symbols by need — that is what `bretzel describe bretzel.state` returns. The others only have their arrangement, which is already the answer to “what is in there”.
The layout
- bretzelclassified
- cli
- componentsclassified
- coreclassified
- introspect
- lint
- probeclassified
- renderclassified
- runtimeclassified
- serverclassified
- stateclassified
- themeclassified
What the folder says about itself
bretzelBretzel — Server-Driven UI for Python.
1 module(s), 0 public symbol(s)
__main__.pypython -m bretzel — the bretzel command, wherever Python is.
bretzel.cliLayer 7 — the CLI. See bretzel.cli.main.Layer 7 — the CLI. See bretzel.cli.main.
The CLI creates and runs the minimal public skeleton, describes the
framework, judges application code and drives an app in a browser.
1 module(s), 2 public symbol(s)
main.pyCreate, run, describe, check, and probe a Bretzel application.
build_parser (function)
main (function)bretzel.cli.commandsCLI subcommands.
3 module(s), 7 public symbol(s)
features.pybretzel features and bretzel impact — the contracts, asked.
run_features (function)
run_impact (function)project.pyCreate and run the smallest complete Bretzel application.
create_project Create a self-contained starter project and return the written files.
run_project Import a Bretzel app and run it with development defaults.translations.pybretzel translations — the sentences a language still lacks.
calls Every t("…") of the app's modules: the sentence, its plural, where.
report Per language: the sentences its table lacks, the entries nobody calls.
run_translations (function)bretzel.componentsUser-facing components exposed through the ui namespace.
1 module(s), 1 public symbol(s)
color_shapes.pyWhat the component themes know and the Tailwind scanner does not.
dynamic_responsive_classes Return responsive classes that a graduated property may emit.bretzel.components.actionsButtons and links.
1 module(s), 5 public symbol(s)
_wiring.pyThe loading= wiring shared by Button and IconButton.
build_loading_spinner The button's spinner, built in __init__.
apply_loading_disabled bz-attr:disabled = (loading) || (disabled).
loading_leading_children The spinner ↔ leading icon mutex, in the children's order.
anchor_tag An href makes an action an ANCHOR — ui.button and ui.icon_button alike, one rule for both.
finish_anchor What changes once an action renders as an <a>.bretzel.components.actions.buttonRe-export the Button component.
2 module(s), 1 public symbol(s)
button.pyButton — Archetype 3 action component.
Button Action button with variant / size / color theming + named slots.theme.pyDefault Button theme.
bretzel.components.actions.icon_buttonicon_button component.
2 module(s), 1 public symbol(s)
icon_button.pyIconButton — square button whose only content is an icon.
IconButton Icon-only button. Pass the icon name positionally + an aria_label for screen readers.theme.pyDefault IconButton theme.
bretzel.components.actions.linklink component.
2 module(s), 1 public symbol(s)
link.pyLink — anchor with three visual variants and a11y disabled state.
Link Anchor element with semantic colour, three variants (hover / underline / text), and a11y-correct disabled state.theme.pyDefault Link theme.
bretzel.components.baseComponent authoring primitives — public API of the base layer.Component authoring primitives — public API of the base layer.
Component authors import from here ::
from bretzel.components.base import Component, reactive_prop, el
Anything not re-exported is internal to the framework.
24 module(s), 115 public symbol(s)
arguments.pyWhat a component's constructor does with its arguments: components it owns, bindings it accepts.
reject_attribute_component Refuse a Component on a parameter written into an HTML attribute.
component_role What a parameter does with a Component, read from its annotation.
component_roles The positional order of cls's constructor, and for every parameter that decides one: (role, annotation as written).
owned_parameters The parameters of cls that render the Component they receive.
shown The content to DISPLAY for name: its binding when it is bound — hand it to emit_text_slot / an Icon and the page follows it — else its resolved value.
has_content if value: for a displayed content — a binding counts as present.
is_displayed_content str | Component in the type: the parameter SHOWS something — a text or an icon — on the page. The convention the text-slot gate already holds (test_text_slot_contract_universal: a displayed text takes a Component, or refuses out loud), read here as a declaration.
derive_display_bindings Every DISPLAYED CONTENT is bindable — derived, never written.
refuse_an_undeclared_binding A ClientBinding (or ClientExpression) on a parameter that is not in BINDABLE_PROPS: raise, at construction.
undeclared_binding The refusal refuse_an_undeclared_binding raises, or None — returned rather than raised so owning_init can let the component's own refusal speak first.
adopt_owned_arguments Give cls's constructor the slot contract, read from its annotations: a Component passed to a parameter that RENDERS it leaves the parent it registered into; one passed to a parameter that takes a VALUE is refused; one passed to a parameter that POINTS at it stays where it is.
reject_sealed A SEALED prop passed at the call: we say so, with a sentence.attrs.pyKwargs splitting + attribute-name normalisation.
is_declared_raw_attr True when the kwarg is a declared raw HTML escape hatch.
ComponentDefinitionError Raised at class creation time when a component is malformed (e.g. EVENTS lists an event with no matching on_<event> parameter in __init__).
ComponentUsageError The one exception for a component the CALLER mis-uses: a value off its table, an unknown slot, an event it does not support, a call it cannot honour. It says what to write.
normalize_attr_name Convert a Python-friendly kwarg name to an HTML attribute name.
is_passthrough_attr True when the kwarg is a raw HTMX attribute that should pass through to the rendered element verbatim.
reject_dead_alpine_attr Raise when name carries an Alpine directive prefix.
split_kwargs Carve kwargs into the five buckets the Component constructor consumes.binding_discipline.pyType discipline for reactive_prop bindings.
is_scalar_type True when the annotation resolves to a scalar (or a union of scalars / None). Optional/Union with at least one non-scalar arm is treated as non-scalar.
validate_scalar_binding Raise ComponentUsageError when binding.value is a list / dict / tuple / set while the prop's declared type is scalar.callbacks.pyrender= escape hatches: what a callback builds, it must return.
call_render Call a render= escape hatch, and refuse one that built components and returned none of them. A callback that builds nothing and returns None stays an empty cell, on purpose.class_composition.pyHow a component composes its CSS classes from its theme.
merge_app_classes base + the app's addition, the app winning every conflict.
ClassComposition Mixed into Component.client_wiring.pyHow a component talks to the client: commands, bindings, the fields it names.
ClientWiring Mixed into Component.commands.pyThe imperative commands shared across component families.
ValueCommands .set(value) / .clear() of a component that carries a value.
IndexCommands .set(index) / .next() / .prev() of a bounded index.component.pyComponent — the single base class apps and component authors subclass.
Component Base class for every Bretzel component.composition.pyOperations on the rendered tree and on where a component sits in it.
unwrap_transparent (the real child, what gives it back its wrapper).
drop_tag_bound_attrs Remove from attrs what no longer means anything under tag.
zone_of_children The @refreshable render a child of parent belongs to: the zone itself under its section, the parent's own zone elsewhere, None outside any zone (a root that is not a component, a page).
parent_to_name_under The component a new one takes its id under: the one rendering, if nothing was opened since its render began; else the open parent.
render_in_its_zone render(component), what it reads going to the component's zone, and what it builds named under it (_MAKER).dismiss.pyThe client-side dismiss shared by the alert family.
split_icon_flag icon= of a feedback component: (the icon, suppress the automatic one).
close_handler_wired True if a close handler is wired on attrs — server (hx-trigger="close") or client (bz-on:close).
dismiss_local_scope The dismiss's client-local scope: bz-data="{open: true}" + bz-show="open" to set on the root. Keyed by bz-id; no FOUC pre-stamp (the initial open: true eval is truthy). Shared by Alert / Badge / Banner.
dismiss_button The × button — ONE emission for the whole framework.events.pyEvent handler dispatch for components (V3 wire).
HandlerError Raised when a component receives an event handler that the framework can't address (lambda, closure, non-callable / non-str) or can't emit (two server handlers on one element).
cross_check_events Verify that every event in cls.EVENTS has a matching on_<event> parameter in cls.__init__.
encode_handler_id Return the addressable id for handler.
client_event_attr Attribute name for a client-only handler : bz-on:<event>.
auto_busy Whether the runtime may show this component's triggers as busy (bretzel.runtime.protocol.DATA_BZ_BUSY, bridge.js) while their request is unanswered — the default.
action_attrs HTMX attribute set for one server-handled event (V3 wire).
item_action_attrs Route an on_* set on an INTERNAL ELEMENT, not on the root.
fields_of The hx-include that brings a component's fields — save a file input. Posted outside a multipart form, a file arrives as the text [object File] (the file itself travels by upload_url). The root, whole, when it holds none (htmx takes an element AND its fields); its other fields one by one when it does. A flat list: htmx splits hx-include on its commas — :is(a, b) is cut.
posts_its_files The root's OWN post carries its files, with or without a form around: multipart, every input under it — the file one included — and the token that signs its file fields, to place under the root.
carrier_attrs A hidden carrier for a component's SECOND (third…) server handler.
with_carriers The rendered root with its carriers — placed here, once, for every component: inside the root, or right after it when the root keeps no child. A carrier the component placed itself (the overlays) is left.
pending Return a client expression indicating whether an action is in flight.field_wiring.pyHow a field reaches its carriers: handlers, the hidden input, ARIA, and value changes.
change_emit_effect bz-effect body that fires change on a hidden input.
trigger_event The EVENT hx-trigger serves, without its modifiers.
retrigger Rename an hx-trigger's event while KEEPING its modifiers.
hidden_carrier_attrs The SKELETON of a value-carrying <input type="hidden">.
relocate_aria Move what ui.form_field stamped on a wrapper root onto focusable.
keep_own_name Keep an element's own name next to the label of its field.
relocate_handlers Move each event's handlers onto the element where it really fires, in place.
activate_keydown Enter / Space activate a NON-native element.
coerce_index The SSR value of a driven index — best effort, never an exception.focus.pyWhere a component takes the focus — one declaration, two readers.
accept_autofocus autofocus= checked at construction: a bool known on the server — a literal, or a server state's field (autofocus=form.in_error, a stamped bool) — on a component that has a place to put the focus.
stamp_autofocus node with the autofocus marker on the element carrying the component's id — the root when no element carries it.
FocusCommands .focus() / .blur() read from FOCUS_TARGET.metaclass.pyThe metaclass of every component, and the kwargs every component reserves.
nodes.pySmall helpers that build or adjust rendered nodes.
merge_attr Set value on attrs[name] per the precedence contract.
stamp_display_none Append display:none to an attrs dict's inline style.
is_stamped_hidden Whether stamp_display_none hid these attrs — its reader, so the format of the stamp lives in one place.
coerce_children Normalise what a render= escape hatch returned, into children.
reject_component Refuse a Component on a parameter that is NOT a slot.
el Tiny ergonomic wrapper around bretzel.core.tree.Element.overlay_wiring.pyWhat opens and floats: panels, their anchoring, focus, dismissal, open/close commands.
trigger_is_full_width True if any trigger fills its row.
expand_fit_wrapper Collapse an anchored overlay's inline-* w-fit h-fit default to a one-cell grid grid-cols-1 w-full. Strip the fit tokens too : Tailwind's w-full w-fit ordering is non-deterministic, so leaving w-fit in can still win and the full-width trigger collapses.
show_attrs data-open state for CSS-driven enter/leave animations.
closed_inert inert while closed: out of focus, pointer and assistive tech.
focus_trap_effect Panel bz-effect : trap focus while open, restore on close.
modal_root_effect Root bz-effect (modal overlays) : scroll lock + dispatch.
dispatch_root_effect Root bz-effect (anchored overlays) : open/close dispatch only.
changed_since_open_effect bz-effect: has the value moved since it was opened?
floating_placement Theme position + align → a $bz.helpers.floating placement.
anchored_panel_effect Panel bz-effect for anchored overlays.
anchored_trigger_wrapper Wrap a caller-supplied trigger for an anchored overlay.
anchored_panel A panel anchored to its trigger by $bz.helpers.floating.
anchored_dismiss_init Root bz-init for anchored overlays : Escape + click-outside.
imperative_listeners bz-on:bz-open/close/toggle — the imperative-API receivers.
install_open_close_toggle Install the write-only imperative API .open() / .close() / .toggle() as INSTANCE ATTRIBUTES on component.
teleport_to_body Wrap an overlay panel in a <template bz-teleport="body"> so the runtime projects it under <body> at init.
escape_init bz-init : Escape closes the overlay while it is open — the deepest open one only (escapeKey is handed $el, and the handler says it closed), so that Escape on a popover inside a drawer does not close both.page_checks.pyChecks run once a page's tree is built: what a component cannot judge alone.
register_sticky_bar Register a sticky bar for the placement pass.
check_sticky_bar_placement Judge the placement of sticky bars once the tree is built.
wire_sidebar_triggers Give each ui.sidebar_trigger the bar it drives.
check_sidebars_are_reachable A bar that can disappear must have a way back.reactive_prop.pyReactive props — the bridge between component kwargs and runtime attrs.
ReactivePropDescriptor Class-level descriptor for a reactive prop.
reactive_prop Declare a reactive prop on a Component subclass.
fill_defaults Give every reactive prop not set by the caller its default, in declaration order (a factory runs per instance).responsive.pyResponsive prop values — one {breakpoint: value} dialect, one parser.
responsive_classes Resolve value to a class string, honouring a breakpoint dict.
looks_like_a_breakpoint_dict Is this dict a scale of steps, or DATA?
reject_stray_breakpoints A step dict on a prop that is not graded: we SAY so.scope_wiring.pyThe client scope a component declares, and its server-side twins.
bool_attr A reactive attribute that must carry the STRING "true"/"false".
server_sync_marker _serverSync fragment for a component's bz-data object literal.
scope_literal The bz-data object literal of a component with a runtime slab.
outlet_target_attrs {"hx-target": "#outlet_<shell>"} for a link that names its region.
bound_wire_name The name a control bound to bound sends its field under — Delivery.mode / Delivery[paris].mode — or None when bound is no state field.
own_field The field a control sends on its own: its explicit name=, else the one its binding derives. Signed into its action's blob, it is the only field that action may write into a state without a form around it (bretzel.server.handlers.writable_fields).sizes.pyThe size scale, and how a sizes table is read.
is_size_keyed Is the table indexed by SIZE (and not by slot)?
size_vocabulary The values size= can take for this component theme.
icon_size_for The icon size that goes with this label — None when its text class is not in ICON_SIZE_ABOVE.testing.pyTest-only helpers for component authors.
render_isolated Open an isolated render context for unit tests.
panel_from_teleport Return an anchored overlay's panel from its teleport wrapper.theme_values.pyClosed values and theme lookups: a value off its table is refused, a colour reaches the root.
table_axes The (prop, table key) pairs whose value must be in a table.
refuse_a_value_off_the_table size= / variant= outside the table: raise, instead of keeping quiet.
declared_steps The steps of a sizes / variants table, THREE shapes.
theme_context (theme, slots, sizes, size, color) — render()'s preamble.
color_bridge_class The bridge class to set on the root, or None.
root_color_bridge The bridge class for the component's ROOT, or None.
refuse_unknown_color Raise if color has no bridge — so no steps.universals.pyThe passes every component node undergoes after its render().
finish_render The two passes EVERY component node must undergo after its render(), in order.
statically_hidden visible=False — literal, or a server state's stamped bool.
hide_with wrapper hides when inner, the node it wraps, is hidden.bretzel.components.chartsTier 8 — data visualisation.Tier 8 — data visualisation.
Server-rendered SVG charts. No external JS library is loaded — hover
tooltips and legend toggles ride $bz.charts.* scope factories
declared via bz-data on the chart wrapper. These are LIVE : the
runtime slab bretzel/components/charts/charts.js ships
tooltipScope / lineScope / scatterScope and the chart
components wire them (bz-data="$bz.charts.tooltipScope()" +
per-mark bz-on:mouseenter).
Public surface :
- Sparkline — inline trend indicator (single series, no axes).
- BarChart — categorical bars, single or multi-series.
- LineChart — continuous line, single or multi-series.
- PieChart — pie / donut.
- ScatterChart — continuous X/Y dots, independent series.
- Series — light dataclass for multi-series payloads.
- Reference — horizontal threshold line annotation.
- Stat — a key figure, its gauge drawn by its meaning.
Optimised for 10 – 1 000 points per chart. Beyond that range, SVG
becomes the bottleneck (one DOM node per point) ; a Canvas-backed
variant (uPlot or similar) would land as a separate component family
when a concrete need arrives.
4 module(s), 54 public symbol(s)
_layers.pySVG layers shared by the charts — the pieces that build Element.
reject_empty_text_component empty_text= is not a slot — the four charts refuse it.
render_empty_state A chart's empty state: a ui.empty_state in a box the size of the plot, or the escape hatch the author placed.
render_axis_layer The vertical axis: the axis line, the horizontal gridlines, the tick labels.
plot_svg The <svg> of a series chart — which IS its plot rectangle.
apply_fixed_width width=N: the chart is N pixels wide, never wider than its container. Without it, it fills the container.
render_static_legend The non-interactive legend: one dot + one label per entry.
data_table The table behind the drawing — the values a screen reader cannot read off a picture (the aria-label only sums it up).
keyboard_attrs A chart with points is ONE tab stop: the arrows walk its points, Enter clicks one, Escape leaves (keyboard() in charts.js, merged into every chart scope). The ring is the wrapper's slot.
titled The plot between its axis titles (x_label / y_label): the vertical axis's above it, at its left, the horizontal axis's below it, at its right — read level, as Observable Plot sets them, never turned on their side. Their font comes with the slot, from the size step (size= moves them with the axis labels).
render_line_axis_layer The vertical axis of the charts drawing x/y points.
render_x_axis_labels Numeric ticks across the X domain — Heckbert ~5 ticks; by 1 at least when every x is whole (whole_x: weeks, seats, days).
render_toggle_legend (function)_svg.pyShared SVG primitives for the chart components.
Localized A label the BROWSER writes in the page's language — the string itself is only the server's fallback, shown until the runtime starts.
label_js The JS expression of a label: its browser twin, or the string.
localized_attr The directive that lets the browser rewrite label: bz-text for a text node, bz-attr:<attr> for an attribute — nothing for a plain string.
joined parts glued together, keeping the browser twin of any of them.
format_value Format a numeric value for axis ticks, bar labels, tooltips.
number A number as the page writes it: its thousands grouped, its decimal mark — « 48 240 », « 12,4 » in French, « 48,240 », « 12.4 » in English. At most two decimals, trailing zeros dropped, as format_value. The value of a ui.stat.
linear_scale Return a function mapping domain_* linearly into range_*.
nice_domain Pick a (min, max) that frames values with a small visual pad.
widen The domain stretched to cover [low, high] — the bounds an app asked for (y_max=20: a mean on 20 reads on 0–20). Never narrowed: a value past a bound pushes it (a 21/20 with a bonus stays seen). A bound replaces the domain's padding on its side, so y_max=20 with a 20/20 ends at 20, not at a padded 21 → 25.
whole Every value a whole number — counts: their axis steps by 1 at least (compute_ticks(whole=True)).
compute_ticks Return target_count-ish "nice" tick values BRACKETING the domain. The first and last ticks fall on round numbers that extend *past* domain_min / domain_max — callers typically use these endpoints as the chart's visible y-range so the axis line spans full ticks and the visual bottom isn't a half-step above the smallest data point (which created the "gridline starts at 60 even though data goes down to 45" surprise).
compute_time_ticks Ticks of a TIME axis, on round moments: whole hours, midnights, Mondays — inside the domain.
text_width Estimated rendered width of label at font_px, in pixels.
axis_margin The room left of the plot for right-aligned axis labels.
line_path SVG d attribute for a polyline through points.
smooth_path SVG d for a monotone cubic curve through points.
area_path Closed path filling the region between points and baseline_y.
arc_path SVG path for a pie wedge (inner_radius=0) or donut wedge.reference.pyReference lines: the Reference dataclass and how the charts draw it.
Reference One reference line : on the y axis, or at an x (x_reference_lines).
coerce_references Normalise y_reference_lines= into a list of Reference.
coerce_x_references Normalise x_reference_lines= : the same shapes as y_reference_lines= — a Reference, a bare x, (x, label), (x, label, color) — with an x that is a number or a date, turned into the drawn x (a date's timestamp, as the x values are). Sorted by x, so the labels can step down when two marks are close.
reference_text A reference's label: its name, then its value in parens — the value keeps the eye anchored on the threshold. Formatted like the ticks, so it reads as the same scale.
render_reference_lines Horizontal dashed lines for threshold annotations.
render_reference_labels The references' labels, just above each line at the plot's right edge — painted AFTER the data, so nothing covers them.
vertical_rule A dashed vertical line across the plot, at x.
render_x_reference_lines Vertical dashed lines at moments — behind the data, like the horizontal ones (render_reference_lines).
render_x_reference_labels Each mark's label at the top of its line, painted after the data. Its name, or its x written like the axis when it has none. A label in the right quarter reads leftwards, so it stays in the plot ; a mark close to the previous one steps its label down a row.series.pyLight Series dataclass for multi-series chart payloads.
Series One data series in a multi-series chart.
with_series A clicked element's data, plus its series when there are several: a bar or a point belongs to one, and the rest does not say which.
to_timestamp Convert a date / datetime / number to a POSIX timestamp.
has_points Is there anything to draw? One series with a point is enough.
first_x The first x the caller gave, read on the raw data=, whichever series holds it: a series may be empty. None with no explicit x (a bare list of numbers, or nothing).
is_date_axis Did the caller give date / datetime x values?
x_back The drawn x turned back into what the app gave, for on_item_click(x, y) — an int an int; a date its ISO text (2026-09-01), as a handler's bound values are JSON.
x_bound x_min / x_max: a number or a date, as the x values are — anything else said, not raised bare from float().
bad_point A point of data= that is not a point: said, not skipped. A list of {"label", "value"} dicts must not draw « No data », nor a None mean vanish from the chart.
coerce_xy_series Normalise a chart's data= into list[Series] of (x, y).
runs_between_holes The stretches of a series between its holes (None y), in x order — one sub-path each, so a curve stops at a hole instead of bridging it. Shared by ui.line_chart and ui.sparkline: one reading of a None for every line.
gap_y A y as a number, or None — a hole.
coloured_slot A chart slot's class, PLUS its colour's bridge.
as_date_formatter Make a time-axis formatter receive a datetime.
resolve_date_axis_format The effective x-axis formatter, and whether the axis is temporal.bretzel.components.charts.bar_chartbar_chart component.
2 module(s), 2 public symbol(s)
bar_chart.pyBarChart — categorical bars, single or multi-series.
BarChart Categorical bar chart.
thinned The class that hides each category label where it would overlap.theme.pyDefault BarChart theme.
bretzel.components.charts.histogramThe histogram: raw values counted per tranche, drawn by the bar chart.The histogram: raw values counted per tranche, drawn by the bar chart.
Its own package and not a variant of bar_chart: it takes values,
not pairs, and owns the tranches — their bounds, the mean, a click that
says the tranche.
1 module(s), 3 public symbol(s)
histogram.pyHistogram — raw values counted per tranche, drawn as bars.
tranches The tranches, (low, high, label), in order.
tranche_of The index of the tranche that holds value — the last holds its top.
Histogram Raw values counted per tranche — bars, one series.bretzel.components.charts.line_chartline_chart component.
2 module(s), 1 public symbol(s)
line_chart.pyLineChart — continuous x, single or multi-series.
LineChart Continuous-x line chart with crosshair hover.theme.pyDefault LineChart theme.
bretzel.components.charts.pie_chartpie_chart component.
2 module(s), 1 public symbol(s)
pie_chart.pyPieChart — pie or donut, optional arc labels + centre text.
PieChart Pie or donut chart.theme.pyDefault PieChart theme.
bretzel.components.charts.scatter_chartscatter_chart component.
2 module(s), 1 public symbol(s)
scatter_chart.pyScatterChart — continuous X / Y dots, no connecting line.
ScatterChart Continuous-X-Y scatter plot.theme.pyDefault ScatterChart theme.
bretzel.components.charts.sparklinesparkline component.
2 module(s), 1 public symbol(s)
sparkline.pySparkline — inline single-series trend indicator.
Sparkline Inline single-series trend indicator.theme.pyDefault Sparkline theme.
bretzel.components.charts.statThe key figure: a number, and what the app says it means.The key figure: a number, and what the app says it means.
In the charts' family: its gauge is a measure drawn to scale, and its
numbers are written by the charts' formatter (_svg.number).
2 module(s), 2 public symbol(s)
stat.pyStat — a key figure, and what it means.
reached Whether value meets target the good way.
Stat A key figure: its label, its value, and what the app says it means.theme.pyDefault Stat theme.
bretzel.components.dataStructured data display.
bretzel.components.data.accordionaccordion component.
2 module(s), 2 public symbol(s)
accordion.pyAccordion / AccordionItem — collapsible content panels.
Accordion Stack of collapsible AccordionItem panels.
AccordionItem One collapsible row inside an Accordion.theme.pyDefault Accordion / AccordionItem theme.
bretzel.components.data.datatableDatatable — public surface of the datatable package.Datatable — public surface of the datatable package.
bretzel.state.Query comes out through this door, the same as
bretzel.components.Move — the type an app handler must name
to write its signature (def load(q: Query)). It travels with
apply_query, which belongs to the component: five of the
repository's six call sites import them on the same line.
bretzel.state.datatable.DatatableState comes out here too, and
it is deliberate: writing a table asks for the component, its state,
Query and apply_query, and it is ONE task. The FILE, for its
part, lives in bretzel/state/datatable/ — it depends on nothing of
this layer — but where a file lives is not where its door is. The
top-level bretzel package does not export it: it would be the only
component state there.
2 module(s), 8 public symbol(s)
datatable.pyDatatable — a bretzel.components.data.table.Table that sorts, pages and searches.
decode_export Inverse of _encode_export, for the route.
sort_by Advance the sort on key — bound per column by the header button.
go_to_page Move to the page the pager just submitted.
search_for Apply the search box's current text, and go back to page 1.
apply_filter Commit one column's selection — fired when its panel CLOSES.
clear_filters Drop every column filter — the toolbar's reset.
apply_query Run query over rows : filter → search → sort → page.
Datatable Table with server-driven sort, pagination and search.theme.pyDefault Datatable theme.
bretzel.components.data.diagramDiagram — a directed graph laid out in layers, rendered server-side.
3 module(s), 15 public symbol(s)
diagram.pyDiagram — a directed graph, laid out in layers on the server.
GraphNode Describe one node in a graph.
GraphEdge Describe a directed edge from source to target.
node Describe a graph node for ui.diagram.
edge Describe a graph edge for ui.diagram.
Diagram Render a server-laid-out directed graph in layers.layout.pyLayered layout of a directed graph — pure, with no rendering.
Metrics The layout's distances, in pixels.
Box A placed node — top-left corner, plus its effective size.
Route A placed edge.
Placement What the engine returns, and all it returns.
break_cycles (acyclic edges, reversed edges).
assign_layers {key: layer index} — longest path from the roots.
order_layers Order each layer so as to reduce the crossings.
layout Lay out a directed graph.
neighbourhood focus plus what it touches, at depth hops, both ways.
keys_from_edges The set of cited nodes, in order of first appearance.theme.pyDefault theme for Diagram.
bretzel.components.data.messageui.message — one message of a conversation; ui.message_list, the thread.
2 module(s), 2 public symbol(s)
message.pyMessage — one message of a conversation, whoever says it.
Message One message of a conversation: where it sits, who said it, what it says.
MessageList A conversation's messages, which follows its newest one.theme.pyDefault Message and MessageList themes.
bretzel.components.data.schedulerScheduler — events posed on a grid of time, to the minute.
4 module(s), 12 public symbol(s)
item.pySchedulerItem — one event of a Scheduler, and its content.
read_moment A naive datetime from a datetime, a date or an ISO string.
SchedulerItem One event placed by its parent Scheduler.reschedule.pyReschedule — what a drop or a pulled edge reports to its handler.
Reschedule One completed gesture on a scheduler card, as the server sees it.scheduler.pyScheduler — events posed on a grid of time, to the minute.
clock An hour as the page's language writes it: « 8h », « 10h10 » in French, « 8:00 », « 10:10 » otherwise.
hhmm 485 → "08:05": the value the browser's clock reads.
shown_clock An hour on the page: the server writes it with clock, the browser rewrites it with THE clock, $bz.times.shown — the one the time picker uses, and the one that knows « 2:30 PM ». French reads the same on both sides; elsewhere the server's form is only what shows before the runtime starts.
spoken_event_js An event's accessible name, written by the browser: its title, its day in words (« mardi 3 novembre 2026 ») and its hours. Written by the server, it would say the day in ISO to a screen reader.
minute_of (function)
lanes Spans at the same time share the column side by side: for each span (start, end), its (lane, number of lanes of its cluster). A cluster is a run of spans that overlap one another, directly or through a third.
all_day_bars Each all-day item as one bar: (item, first column, columns spanned, row). Bars that overlap stack on separate rows; a bar is clipped to the days shown (holidays running through a hidden weekend).
segments Every timed item cut at midnight into the days shown.
Scheduler Events on a grid of time — week or day view.theme.pyDefault Scheduler theme.
bretzel.components.data.tabletable component.
2 module(s), 4 public symbol(s)
table.pyTable — simple data table with custom cell renderers.
Column Describes one column of a Table or Datatable.
column Build a Column — sugar so users can do ui.column(...) instead of importing the dataclass.
read_cell Look up key on row — the one row-access rule.
Table Simple data table — header row + body rows, styled by theme.theme.pyDefault Table theme.
bretzel.components.data.treetree component.
2 module(s), 2 public symbol(s)
theme.pyDefault Tree / TreeNode theme.
tree.pyTree / TreeNode — a recursive, collapsible hierarchy.
Tree Root of a collapsible hierarchy of TreeNode\s.
TreeNode One node inside a Tree.bretzel.components.feedbackUser feedback (alert, notification, progress, etc.).
bretzel.components.feedback.alertalert component.
2 module(s), 1 public symbol(s)
alert.pyAlert — inline status panel.
Alert Status panel : leading icon, optional title, message body, optional dismiss button on the right.theme.pyDefault Alert theme.
bretzel.components.feedback.avataravatar component.
2 module(s), 2 public symbol(s)
avatar.pyAvatar — round / square user image with initials fallback.
initials_of A name's initials — "Alex Martin" → "AM".
Avatar Round / square user chip with image or initials fallback.theme.pyDefault Avatar theme.
bretzel.components.feedback.badgebadge component.
2 module(s), 1 public symbol(s)
badge.pyBadge — small inline label / status / count pill.
Badge Inline pill — count / status / tag / filter chip.theme.pyDefault Badge theme.
bretzel.components.feedback.bannerbanner component.
2 module(s), 1 public symbol(s)
banner.pyBanner — full-width page-level status strip.
Banner Full-width page-level status strip.theme.pyDefault Banner theme.
bretzel.components.feedback.empty_stateempty_state component.
2 module(s), 1 public symbol(s)
empty_state.pyEmptyState — "nothing here yet" placeholder.
EmptyState Centred placeholder for "nothing here yet" surfaces.theme.pyDefault EmptyState theme.
bretzel.components.feedback.notificationui.notification toast helper.
2 module(s), 4 public symbol(s)
notification.pyui.notification — toast helper, V1 idiom.
notification Queue a toast to fire at end-of-request.
skeleton_html Build the empty toaster skeleton injected into <body> once per page render.
serialise_pending Render the pending toast queue into a <bz-patch> block (V3).theme.pyDefault theme for the ui.notification toast helper.
runtime_payload Return the theme dict in the exact shape the runtime JS expects.bretzel.components.feedback.progressprogress component.
2 module(s), 3 public symbol(s)
progress.pyProgress — horizontal value indicator.
percent « 42 % » in French, « 42% » in English — the table's number.percent.
percent_js The same, written by the browser from a JS number.
Progress Horizontal progress bar.theme.pyDefault Progress theme.
bretzel.components.feedback.skeletonskeleton component.
2 module(s), 1 public symbol(s)
skeleton.pySkeleton — loading placeholder block.
Skeleton Loading-placeholder block.theme.pyDefault Skeleton theme.
bretzel.components.inputsUser input components.
4 module(s), 36 public symbol(s)
_checkable.pyThe shared render of the two checkable controls — Checkbox and Switch.
label_line What the control's container adds beside a label: ONE LINE of it.
render_checkable <label>: the real <input>, the fake visuals, then the label._picker.pyShared surface of the panel pickers — Select and Combobox.
badge_pill_classes Compose the (pill_class, close_class) strings from BADGE_THEME for use inside a pill-rendering bz-for template. Single source of truth for pill styling : Combobox / Select multi-pickers both delegate here so a Badge theme tweak propagates everywhere automatically.
field_text_pill A tag INSIDE a field writes as one types in that field.
normalise_option Return (value, label, disabled) for any of the accepted option shapes : str / tuple / dict.
option_classes An option row's static classes : the sized option slot, plus option_current in single mode.
option_body The BODY of an option — what render= replaces.
has_picks SSR snapshot: does the picker have a selection at the first paint?
render_x_icon The clear button's × glyph, at the picker's size.
option_check The tick of a PICKED option, in multi mode.
build_pills_template Reactive pills via <template bz-for>. Each picked value renders as <span class="pill">label <button>×</button></span>.
build_header_bar The panel's sticky header: the picks, or the relocated search.
build_footer_bar The panel's sticky footer — the counter, then the commands._picker_field.pyThe shared mechanics of the *picker fields* — editable field + popover.
calendar_value_mirror bz-effect body mirroring value_expr onto a child <bz-calendar>'s observed value ATTRIBUTE.
value_expr The expression the DIRECTIVES read for the field's value.
relocate_field_events Empty the root of its handlers, towards the carrier that can fire them.
detach_wrapper_carriers Remove from the root what makes no sense there, and return the name.
hidden_carrier The <input type=hidden> that carries the value in the form data.
typed_field_attrs The editable text of a picker: it SHOWS the value, and WRITES it only once normalised — at change (Enter, or leaving a changed field) and at blur.
typed_hint The placeholder of a date field: the author's, or the numeric form one types, in the page's order — « JJ/MM/AAAA » in French, « MM/DD/YYYY » in American English ($bz.dates.pattern).
calendar_picker_scope The bz-data of a picker whose panel is a <bz-calendar>.
panel_calendar The panel's <bz-calendar> — detached, but ADDRESSED by its picker.
icon_button One of the frame's two buttons: the × or the panel opener.
trigger_button The button that toggles the panel.
clear_button The × — visible only when there is a value to clear.
render_calendar_field The WHOLE render of a picker with a <bz-calendar> panel._wiring.pyShared V3 client wiring for input components.
ghost_frame A ghost field's frame has no horizontal padding.
refuse_on_a_single A bulk command on a control that holds one value: said, not ignored.
ChoiceCommands .set() / .clear() / .select_all() / .deselect_all() of a control holding one choice, or several with multiple=True.
CheckedCommands .set(bool) / .toggle() of a control carrying checked.
add_local_value_scope Give an INTERACTIVE, LOCAL simple input an internal value scope.
force_boolean_form_vals Make a server-bound checkbox/switch always transmit its boolean.
false_companion_input The other half of "an unticked box still sends its false".
value_command_listeners bz-on:bz-set for $el.value carriers.
checked_command_listeners bz-on:bz-toggle / bz-on:bz-set for $el.checked toggles.
date_to_iso Coerce a date-ish prop value to an ISO YYYY-MM-DD string.bretzel.components.inputs.attachmentsui.attachments — the files joined to something; any button adds with .pick().
2 module(s), 3 public symbol(s)
attachments.pyAttachments — the files joined to something, shown where one wants.
size_label A size as the server writes it before the browser localises it ($bz.attachments.formatSize): the same three units, in English.
server_files files= read into one shape: name, size, type, href, key (the name when absent). A bare string is a name.
Attachments The list of files joined to something; any button adds to it with .pick().theme.pyDefault Attachments theme — the list of files, in its three presentations, its refusal panel and its hidden input.
bretzel.components.inputs.calendarRe-export the Calendar component and its helpers.
2 module(s), 5 public symbol(s)
calendar.pyCalendar — month-grid date picker, single or range.
compute_month_grid Return 6 rows × 7 cells covering the displayed month.
format_month_label "<MonthName> <Year>" (e.g. "March 2026").
rotate_weekday_names Return the 7 weekday names rotated so weekstart comes first.
normalise_marks marks= → {"2026-08-14": 3}, in both of its call shapes.
Calendar Month-grid date picker, single or range. Web Component-backed.theme.pyDefault Calendar theme.
bretzel.components.inputs.checkboxcheckbox component.
2 module(s), 1 public symbol(s)
checkbox.pyCheckbox — boolean input with a styled "soft-tick" box.
Checkbox Boolean toggle input with optional inline label.theme.pyDefault Checkbox theme.
bretzel.components.inputs.color_pickerColorPicker — a colour field with a swatch panel.
2 module(s), 3 public symbol(s)
color_picker.pyColorPicker — colour field with a swatch panel.
hex_or_empty Coerce a colour value to "#rrggbb" or "".
normalise_to_hex_js Rewrite field as #rrggbb (or #rrggbbaa), lower case: with or without its #, a short form doubled. Empty when it is no colour.
ColorPicker Render a color field with a swatch selection panel.theme.pyDefault ColorPicker theme.
bretzel.components.inputs.comboboxcombobox component.
2 module(s), 3 public symbol(s)
combobox.pyCombobox — search-as-you-type select with optional multi-pick.
shrink_fit_wrapper The other direction : a w-full root that must hug its trigger.
trigger_asks_full_width Does anything ask this wrapper to fill its row ?
Combobox Search-as-you-type select with single / multi modes.theme.pyDefault Combobox theme.
bretzel.components.inputs.date_pickerRe-export the DatePicker component.
2 module(s), 3 public symbol(s)
date_picker.pyDatePicker — single-date input with an inline calendar popover.
shown_date_js What the field shows of value_expr: the day in the page's language, « mar. 3 nov. 2026 » ($bz.dates.shown).
normalise_to_iso_js The free-form → ISO blur normaliser for value_expr.
DatePicker Single-date input with an inline calendar popover.theme.pyDefault DatePicker theme.
bretzel.components.inputs.date_range_pickerRe-export the DateRangePicker component.
2 module(s), 1 public symbol(s)
date_range_picker.pyDateRangePicker — start + end date input with shared calendar popover.
DateRangePicker Start + end date input with shared calendar popover.theme.pyDefault DateRangePicker theme.
bretzel.components.inputs.editorui.editor — a text field that formats, its value Markdown; ui.editor_tool in its bar.
2 module(s), 3 public symbol(s)
editor.pyEditor — a text field that formats: bold, italic, lists, links.
preview_html The HTML the surface shows until ProseMirror takes over — no flash of raw Markdown, no jump of height while the brick loads. Cached: a zone refreshed around an unchanged editor re-reads nothing.
Editor A text field that formats — bold, italic, lists, links — and whose value is Markdown.
EditorTool A button of one's own in the bar of an Editor.theme.pyDefault Editor theme — the frame of a field, a bar on top.
bretzel.components.inputs.file_uploadui.file_upload — dropzone or compact-button file picker.
2 module(s), 1 public symbol(s)
file_upload.pyFileUpload — a dropzone, and the list of files under it.
FileUpload A dropzone, and the list of the files dropped on it.theme.pyDefault FileUpload theme — the dropzone, over the list.
bretzel.components.inputs.formform component.
2 module(s), 6 public symbol(s)
form.pyForm — wraps children in a <form> tag with submit handling.
contains_file_input Is there an <input type="file"> anywhere under these nodes?
upload_limits What each ui.file_upload under these nodes declared to the render it accepts, by field name — the only file fields the server will take (ui.input refuses type="file").
named_controls The name of every control under these nodes — what the form will send. Wire fields (_-prefixed) are not controls; a name inside raw HTML is not read: the framework did not render it.
rendered_actions The action ids posted from this form: its own hx-post and its controls'. They go into its token, which then vouches for its fields only when one of THEM is posted (bretzel.server.handlers.form_token).
Form HTML form wrapper. Children are added via with block.
form_element A <form> around rendered children: the signed list of its controls, its own submit semantics, and multipart when a file is in it.theme.pyDefault Form theme — a thin flex column.
bretzel.components.inputs.form_fieldform_field component.
2 module(s), 1 public symbol(s)
form_field.pyFormField — wraps an input with label / hint / error display.
FormField Field wrapper : label on top, child input in the middle, hint or error below.theme.pyDefault FormField theme.
bretzel.components.inputs.inputinput component.
2 module(s), 1 public symbol(s)
input.pyInput — text input with prefix/suffix/icon slots.
Input Render a text input with distinct input and change events.theme.pyDefault Input theme.
bretzel.components.inputs.message_inputui.message_input — where a message is written; ui.message_input_tool in its bar.
2 module(s), 2 public symbol(s)
message_input.pyMessageInput — where a message is written: to an AI, or to anyone.
MessageInput A box to write a message in: text, files, voice, tools, send and stop.
MessageInputTool A button of one's own in the bar of a MessageInput.theme.pyDefault MessageInput theme — one field frame that lights up whole.
bretzel.components.inputs.month_pickermonth_picker component.
2 module(s), 3 public symbol(s)
month_picker.pyMonthPicker — a MONTH field with a year grid in a popover.
month_to_ym Coerce a month value to "YYYY-MM".
normalise_to_ym_js The free-input → YYYY-MM normaliser for value_expr.
MonthPicker Render a month field with a year-grid popover.theme.pyDefault MonthPicker theme.
bretzel.components.inputs.number_inputnumber_input component.
2 module(s), 1 public symbol(s)
number_input.pyNumberInput — numeric input with vertical ± stepper buttons.
NumberInput Numeric input with vertical ± stepper buttons.theme.pyDefault NumberInput theme.
bretzel.components.inputs.radioradio component.
2 module(s), 2 public symbol(s)
radio.pyRadio + RadioGroup — single-choice input cluster.
RadioGroup Container for a cluster of Radio items. Owns the name and the bound value.
Radio One choice inside a RadioGroup. Inherits name, value (binding), color, size from the group's reactive props at render time — explicit kwargs on the radio override per-item if needed.theme.pyDefault themes for RadioGroup and Radio.
bretzel.components.inputs.selectselect component.
2 module(s), 1 public symbol(s)
select.pySelect — custom popover-based combobox.
Select Styled combobox built on a button trigger + dropdown panel.theme.pyDefault Select theme.
bretzel.components.inputs.signature_padui.signature_pad — sign with a finger or a mouse.
2 module(s), 1 public symbol(s)
signature_pad.pySignaturePad — sign with a finger or a mouse, inside a form.
SignaturePad Surface de signature — pointeur / doigt → PNG en data-URL.theme.pyDefault SignaturePad theme.
bretzel.components.inputs.sliderslider component.
2 module(s), 1 public symbol(s)
slider.pySlider — drag-to-pick numeric value, single or range.
Slider Drag-to-pick numeric input, single or range.theme.pyDefault Slider theme.
bretzel.components.inputs.switchswitch component.
2 module(s), 1 public symbol(s)
switch.pySwitch — visual variant of checkbox with a sliding thumb.
Switch Boolean toggle rendered as a sliding rail.theme.pyDefault Switch theme.
bretzel.components.inputs.tags_inputui.tags_input — free values typed as tags, helped by suggestions (the recipients of a mail). Apart from combobox, which picks in a list.ui.tags_input — free values typed as tags, helped by suggestions
(the recipients of a mail). Apart from combobox, which picks in a list.
2 module(s), 1 public symbol(s)
tags_input.pyTagsInput — free values typed as tags, helped by suggestions.
TagsInput Free values typed as tags inside the field, helped by suggestions.theme.pyDefault TagsInput theme.
bretzel.components.inputs.textareatextarea component.
2 module(s), 1 public symbol(s)
textarea.pyTextarea — multi-line text input.
Textarea Multi-line text input.theme.pyDefault Textarea theme.
bretzel.components.inputs.time_pickertime_picker component.
2 module(s), 3 public symbol(s)
theme.pyDefault TimePicker theme.
time_picker.pyTimePicker — time field with a two-column panel.
time_to_hhmm Coerce a time value to "HH:MM".
normalise_to_hhmm_js The free-input → HH:MM normaliser for value_expr.
TimePicker Render a time field with hour and minute panels.bretzel.components.inputs.toggle_grouptoggle_group component.
2 module(s), 2 public symbol(s)
theme.pyDefault themes for ToggleGroup and ToggleButton.
toggle_group.pyToggleGroup + ToggleButton — multi-button selector cluster.
ToggleGroup Cluster of ToggleButton items — single or multi-select.
ToggleButton One item inside a ToggleGroup.bretzel.components.inputs.week_pickerweek_picker component.
2 module(s), 2 public symbol(s)
theme.pyDefault WeekPicker theme.
week_picker.pyWeekPicker — a WEEK field, selected by row.
normalise_to_week_js The free-input → start-of-week ISO normaliser.
WeekPicker Render a week field with row-based day selection.bretzel.components.layoutLayout (flex, grid, stack, container, card).
bretzel.components.layout.cardcard component.
2 module(s), 1 public symbol(s)
card.pyCard — surface wrapper with V1's signature hover lift effect.
Card Surface wrapper. Pass href= to make the whole card a link (auto-enables hoverable), padding= for the inner spacing scale, hoverable=True to opt in to the lift effect manually. variant="ghost" for a row of a list, active=True for the chosen one.theme.pyDefault Card theme.
bretzel.components.layout.carouselcarousel component.
2 module(s), 1 public symbol(s)
carousel.pyCarousel — snapping scroll through a series of contents.
Carousel Render a snapping track whose direct children are slides.theme.pyDefault Carousel theme.
bretzel.components.layout.containercontainer component.
2 module(s), 1 public symbol(s)
container.pyContainer — centered max-width layout primitive.
Container Centered max-width column. Pass width= to pick the clamp.theme.pyDefault Container theme.
bretzel.components.layout.draggabledraggable component.
2 module(s), 1 public symbol(s)
draggable.pyDraggable — one grabbable item inside a Dropzone.
Draggable A grabbable wrapper around one item of a dropzone.theme.pyTheme slots for ui.draggable.
bretzel.components.layout.dropzonedropzone component.
3 module(s), 2 public symbol(s)
dropzone.pyDropzone — a region that receives dragged items.
Dropzone Render a drop target whose on_move handler receives a typed Move.move.pyMove — what a drop reports to its on_move handler.
Move One completed drag, as the server sees it.theme.pyTheme slots for ui.dropzone.
bretzel.components.layout.flexRe-export the Flex component.
2 module(s), 1 public symbol(s)
flex.pyFlex — generic CSS-flex container (Archetype 2).
Flex A flex container with the full Tailwind axis API exposed.theme.pyDefault Flex theme.
bretzel.components.layout.gridgrid component.
2 module(s), 1 public symbol(s)
grid.pyGrid — CSS-grid container, sibling of Flex.
Grid Two-dimensional layout container.theme.pyDefault Grid theme.
bretzel.components.layout.panepane component.
2 module(s), 1 public symbol(s)
pane.pyPane — the region that scrolls.
Pane Render a scrolling column that occupies the remaining space.theme.pyDefault theme for Pane — the region that scrolls.
bretzel.components.layout.resizableui.resizable / ui.resizable_panel — split panes.
2 module(s), 3 public symbol(s)
resizable.pyResizable — panels separated by handles you drag.
normalize_weights Raw sizes → count percentages summing to 100.
ResizablePanel Render one panel inside a resizable group.
Resizable Render a group of panels separated by resize handles.theme.pyDefault Resizable / ResizablePanel theme.
bretzel.components.layout.stackRe-export VStack, HStack.Re-export VStack, HStack.
Both are tiny shortcuts on top of Flex that bake a direction
in and offer a smaller kwargs surface for the common "list of items"
layouts. There is no bare Stack — pick VStack / HStack
explicitly, or drop to Flex for a runtime-chosen direction.
1 module(s), 2 public symbol(s)
stack.pyVStack and HStack — Flex shortcuts with a baked direction.
VStack Vertical stack — Flex with direction="col" baked in.
HStack Horizontal stack — Flex with direction="row" baked in.bretzel.components.layout.viewportviewport component.
2 module(s), 1 public symbol(s)
theme.pyDefault theme for Viewport — the full-screen frame.
viewport.pyViewport — the frame that takes the screen and never scrolls.
Viewport Render a full-screen frame whose regions scroll independently.bretzel.components.metaThe framework's marker components: outlet, fragment, interval, title, meta_tag, and the each family. (page and layout are NOT here: they are decorators, in render/decorators/.)The framework's marker components: outlet, fragment,
interval, title, meta_tag, and the each family. (page
and layout are NOT here: they are decorators, in
render/decorators/.)
bretzel.components.meta.fragmentfragment component.
1 module(s), 1 public symbol(s)
fragment.pyFragment — children grouping with no DOM wrapper.
Fragment Wrap-less container — children render flat into the parent.bretzel.components.meta.intervalinterval component.
1 module(s), 1 public symbol(s)
interval.pyInterval — recurring client timer that fires a server action.
Interval Hidden recurring timer. Pairs with a ClientBinding gate so the cadence is stoppable without any server-side task lifecycle.bretzel.components.meta.iterationReactive list-iteration family — keyed iteration + filter + paginate.Reactive list-iteration family — keyed iteration + filter + paginate.
One discoverable home for the *_each generators, even though they
straddle two layers by necessity :
- each is defined HERE (each.py). The
bretzel.render.iteration module only carries the key stack
(_KEY_STACK / current_iteration_key / _extract_key), and
neither defines nor re-exports each.
- filter_each / paginate_each / limit_each wrap each item's
body in a component (a bz-show window), so they are
component-layer and live here.
Re-exported together so callers — and the ui.* namespace — find the
whole family in one place. Server-side sort / group are
intentionally NOT here : reorder is a refreshable concern.
7 module(s), 8 public symbol(s)
_window.pyWhat the generators that hide rows on the client share.
window_ref value as a parenthesised JS subexpression.
shown_while Yield each item inside a wrapper shown while condition(index, item), a client expression, holds. The caller's loop body lands in the wrapper.drag_each.pyui.drag_each — iterate items, wrapping each in a ui.draggable.
drag_each Yield each item inside a ui.draggable. See module docstring.each.pyui.each — keyed iteration generator (the base of the *_each family).
each Iterate over items while preserving stable per-item identity.filter_each.pyui.filter_each — client-side filtered iteration.
filter_each Iterate items, wrapping each body in a client-side bz-show matching query against text(item). See module docstring.limit_each.pyui.limit_each — client-side "first N" iteration.
limit_each Iterate items, showing only the first limit client-side.paginate_each.pyui.paginate_each — client-side paginated iteration.
paginate_each Iterate items, showing only the current page's window client-side.show_more.pyui.show_more — ui.limit_each + a "Show more" button.
show_more Iterate items first-count (client-side), then drop a "Show more" button after the rows. See the module docstring.bretzel.components.meta.meta_tagmeta_tag component.
1 module(s), 1 public symbol(s)
meta_tag.pyMetaTag — <meta> injection into the document <head>.
MetaTag <meta> element pushed into the request's head_extras.bretzel.components.meta.outletoutlet component.
1 module(s), 1 public symbol(s)
outlet.pyOutlet — page-content injection point inside an @layout.
Outlet <main> slot where the page content lands inside a layout.bretzel.components.meta.titletitle component.
1 module(s), 1 public symbol(s)
title.pyTitle — page-level <title> override.
Title Page-level <title> override (side-effect component).bretzel.components.navigationNavigation between pages/sections.
2 module(s), 11 public symbol(s)
_nav_item.pyThe contract of a navigation row, shared by the sidebar, navbar and bottom bar.
NavItem A navigation row: icon, label, optional badge, link or action._wiring.pyThe shared body of a navigation item — NavbarItem, SidebarItem, BottomBarItem.
capture_layout The enclosing layout's name, read at construction.
current_path_scope The bz-data literal that declares the current_path signal.
NavItemWiring What wire_nav_item resolved — the behaviour, not the render.
wire_nav_item The prologue of a nav item's render() — reading + wiring.
is_external_href An href that leaves the site — never partial-nav'd.
apply_active_state Set the active state on attrs — three sources, in order.
apply_partial_nav Aim the item at its layout's outlet when it has an href AND a layout was captured: the page's boost does the rest, as for any link.
apply_disabled Neutralise the item — a11y, tab order, click channels.
render_badge A nav item's badge chip. addition: the app's slots= for the badge, kept last over the chip's own classes (with_slot_class).
current_path_resync_init bz-init that keeps current_path stuck to the real URL.bretzel.components.navigation.bottom_barbottom_bar component.
2 module(s), 2 public symbol(s)
bottom_bar.pyBottomBar / BottomBarItem — bottom-of-screen tab bar (mobile).
BottomBar Render a bottom navigation bar that tracks the current path.
BottomBarItem Render a bottom-bar item with an icon, label, and optional badge.theme.pyDefault theme for the BottomBar family (BottomBar / BottomBarItem).
bretzel.components.navigation.breadcrumbbreadcrumb component.
2 module(s), 2 public symbol(s)
breadcrumb.pyBreadcrumb — page-location trail.
Breadcrumb Page-location trail with chevron-separated parents.
BreadcrumbItem Render one breadcrumb segment with an optional icon and link.theme.pyDefault Breadcrumb theme.
bretzel.components.navigation.navbarnavbar component.
2 module(s), 3 public symbol(s)
navbar.pyNavbar / NavbarSection / NavbarItem — top navigation bar.
Navbar <header> top bar. Owns current_path for active links.
NavbarSection One of three positional groupings inside a Navbar.
NavbarItem Horizontal nav row — icon + label + optional badge.theme.pyDefault theme for the Navbar family (Navbar / NavbarSection / NavbarItem).
bretzel.components.navigation.paginationpagination component.
2 module(s), 2 public symbol(s)
pagination.pyPagination — page-navigation widget.
compute_range Return the page list to display, with "ellipsis" markers.
Pagination Page navigation : *Prev* — N page buttons — *Next*.theme.pyDefault Pagination theme.
bretzel.components.navigation.sidebarsidebar component.
2 module(s), 7 public symbol(s)
sidebar.pySidebar / SidebarSection / SidebarItem — navigation rail.
Sidebar Render a collapsible application sidebar.
SidebarTrigger Render a button that opens or closes a sidebar.
SidebarSection Group of items with an optional uppercase label.
SidebarTitle Render the sidebar title and optional home link.
SidebarItem One nav row : icon + label + optional badge.
SidebarFooter Render the footer region of a sidebar.
SidebarFooterItem A clickable row inside a SidebarFooter popover.theme.pyDefault theme for the Sidebar family (Sidebar / SidebarSection / SidebarItem).
bretzel.components.navigation.stepperstepper component.
2 module(s), 3 public symbol(s)
stepper.pyStepper / Step / StepPanel — progress through ordered steps.
Stepper Render an ordered sequence of steps with matching content panels.
Step Describe one step in a stepper.
StepPanel Render content when its step is active.theme.pyDefault Stepper / Step / StepPanel theme.
bretzel.components.navigation.tabstabs component.
2 module(s), 3 public symbol(s)
tabs.pyTabs / Tab / TabPanel — switchable content panels.
Tabs Container that holds Tab buttons + TabPanel content.
Tab One button inside a Tabs strip.
TabPanel Content shown when its tab matches the active id.theme.pyDefault Tabs / Tab / TabPanel theme.
bretzel.components.overlaySurfaces above flow (dialog, drawer, popover, etc.).
3 module(s), 5 public symbol(s)
_anchored.pyThe shared render of the ANCHORED overlays — Dropdown and Popover.
render_anchored_overlay Wrapped trigger + teleported panel + wired root._base.pyThe contract of the open-driven overlays: modal and anchored.
Overlay A panel that opens and closes, from a binding or from its commands.
ModalOverlay An overlay above the page, with a backdrop.
AnchoredOverlay An overlay floating next to its trigger._modal.pyThe shared render of the two modal overlays — Dialog and Drawer.
render_modal_overlay Backdrop + container + panel (header, body) + wired root.bretzel.components.overlay.dialogdialog component.
2 module(s), 1 public symbol(s)
dialog.pyDialog — modal overlay with backdrop, escape, scroll lock.
Dialog Centered modal with backdrop + escape + scroll lock.theme.pyDefault Dialog theme.
bretzel.components.overlay.drawerdrawer component.
2 module(s), 1 public symbol(s)
drawer.pyDrawer — side-anchored sliding panel.
Drawer Side-anchored sliding panel.theme.pyDefault Drawer theme.
bretzel.components.overlay.dropdowndropdown component.
2 module(s), 2 public symbol(s)
dropdown.pyDropdown + DropdownItem — anchored menu of clickable rows.
Dropdown Anchored menu of clickable rows.
DropdownItem One clickable row inside a Dropdown.theme.pyDefault Dropdown + DropdownItem theme.
bretzel.components.overlay.popoverpopover component.
2 module(s), 1 public symbol(s)
popover.pyPopover — anchored floating panel.
Popover Anchored floating panel toggled by a trigger element.theme.pyDefault Popover theme.
bretzel.components.overlay.tooltiptooltip component.
2 module(s), 4 public symbol(s)
theme.pyDefault Tooltip theme.
tooltip.pyTooltip — text panel shown on hover / focus of a wrapped trigger.
name_from_tooltip A control with nothing to read takes its tooltip= as its name.
holds_a_disabled_button Whether a button disabled at render time is among children.
Tooltip Hover-/focus-revealed text panel.
tooltip_host The page's ONE tooltip panel, #bz-tip — shown by tip.js.bretzel.components.primitivesNon-interactive elementary blocks.
bretzel.components.primitives.audioaudio component.
2 module(s), 1 public symbol(s)
audio.pyAudio — the thinnest of the media family, and it owns it.
Audio Render a native audio player with visible controls by default.theme.pyDefault Audio theme — the repository's thinnest, and rightly so.
bretzel.components.primitives.codeRe-export the Code component.
2 module(s), 2 public symbol(s)
code.pyCode — block code display with optional Pygments highlighting.
highlight_code Pygments highlight with a (text, lang) LRU cache.
Code Block code with Pygments syntax highlighting.theme.pyDefault Code theme.
bretzel.components.primitives.dividerdivider component.
2 module(s), 1 public symbol(s)
divider.pyDivider — horizontal or vertical separator with optional label.
Divider Horizontal or vertical separator. orientation="vertical" flips the axis ; pass label="…" for the boxed-section look.theme.pyDefault Divider theme.
bretzel.components.primitives.headingheading component.
2 module(s), 2 public symbol(s)
heading.pyHeading — semantic h1–h6 with size decoupled from level.
heading_classes The classes of a level-level title in theme: its root, its size (level_sizes unless size is given), its weight.
Heading Semantic heading. Pass text positionally, set level= (int 1–6) for the HTML tag, size= to override the auto-derived visual size.theme.pyDefault Heading theme.
bretzel.components.primitives.htmlhtml component.
2 module(s), 1 public symbol(s)
html.pyHtml — the way out: injecting verbatim markup.
Html Inject trusted HTML verbatim without escaping it.theme.pyDefault Html theme — deliberately almost empty.
bretzel.components.primitives.iconicon component.
2 module(s), 1 public symbol(s)
icon.pyIcon — Iconify wrapper, set-agnostic.
Icon Inline icon. name accepts "save" (resolved against the theme's default set) or "lucide:save" (explicit set).theme.pyDefault Icon theme.
bretzel.components.primitives.iframeiframe component.
2 module(s), 1 public symbol(s)
iframe.pyIframe — a third-party document, bounded by default.
Iframe Embed a titled document with a secure sandbox by default.theme.pyDefault Iframe theme.
bretzel.components.primitives.imageimage component.
2 module(s), 1 public symbol(s)
image.pyImage — show an image, with its room reserved.
Image Render an image and optionally reserve its layout with ratio=.theme.pyDefault Image theme.
bretzel.components.primitives.markdownRe-export the Markdown component.
2 module(s), 1 public symbol(s)
markdown.pyMarkdown — render markdown text to styled HTML.
Markdown Block markdown rendering with bretzel typography. Server-only.theme.pyDefault Markdown theme.
bretzel.components.primitives.menu_itemmenu_item primitive — shared base for clickable menu rows.
1 module(s), 1 public symbol(s)
menu_item.pyMenuItem — shared base for clickable menu rows.
MenuItem Base clickable menu row. Subclasses provide THEME/THEME_KEY.bretzel.components.primitives.spinnerspinner component.
2 module(s), 1 public symbol(s)
spinner.pySpinner — pure-CSS loading indicator.
Spinner Loading indicator. Pass size= for the scale, color= for the tint — a rotating ring is the one built-in look.theme.pyDefault Spinner theme.
bretzel.components.primitives.textRe-export the Text component.
2 module(s), 1 public symbol(s)
text.pyText — typographic primitive (Archetype 1, leaf).
Text Inline / block text with typographic modifiers.theme.pyDefault Text theme.
bretzel.components.primitives.videovideo component.
3 module(s), 3 public symbol(s)
theme.pyDefault Video theme.
track.pyTrack — a subtitle track described as data.
Track Describe a timed media track such as captions, descriptions, or chapters.
track Build a timed media track for ui.audio or ui.video.video.pyVideo — a dressed <video>, not a player.
Video Render a native video player with reserved layout space.bretzel.coreINTERNAL layer — pure framework primitives with no user-facing API.
10 module(s), 33 public symbol(s)
base_path.pybase_path — an app that does not live at the root of its site.
normalize "/radar", or "" for an app at the root. Refuses the rest.
activate (function)
deactivate (function)
current The prefix of the app serving this request, "" if none.
with_base url as the browser must ask for it. Only a path of this site changes: a full URL, //host, #anchor or data: stay as they are.
without_base A path the browser shows, as the app knows it.
strip The ASGI scope with the prefix off its path, when it is there.
same_host Is url a full address on the host this request came to?errors.pyLayer 0 — the canonical framework exceptions.
BretzelError Generic runtime error from Bretzel internals.
AuthRequiredError Raised when a user-scoped state is resolved with no user.escape.pyHTML / attribute / JS escaping primitives.
escape_html Escape a string for use in HTML body content.
escape_attr Escape a value for a double-quoted HTML attribute.
escape_js Escape a string for inclusion as a JS string literal.
escape_inline_json Make a JSON payload inert as the TEXT of an HTML element.
is_script_url javascript: or vbscript:, as the browser reads the scheme.
serialize_attrs Serialize HTML attributes into a leading-space string.identity.pyStable cross-render IDs.
key_segment The id segment for a key= — the key itself when it is already selector-safe (every id that worked renders the same byte), else its unsafe characters turned into - plus a digest of the original, so a:b and a-b stay two ids.
hash_segment Stable 8-char hex digest used to compress IDs (and other stable wire ids, e.g. a @refreshable zone's bz-id).
IdGenerator Generate stable child identifiers within one render scope.invoke.pyCall APPLICATION code without ever blocking the event loop.
call_without_blocking Call fn without blocking the event loop.payload.pyEventPayload — a typed value object a component sends with an action.
EventPayload Base for the typed payloads a component's runtime sends to a handler.serialize.pyNode tree → HTML string.
serialize Render a Node tree to an HTML string.text.pyText comparison helpers.
fold Case- and accent-insensitive form of text, for comparison only.tracking.pyObserver-pattern reactivity engine.
Observer Anything that can be invalidated when one of its dependencies changes.
CircularDependencyError Raised when an observer is detected at two levels of the eval stack.
Reads What one DependencyTracker.recording block read.
DependencyTracker Coordinates dependency registration and invalidation.tree.pyImmutable virtual-DOM nodes.
Node Marker base class. Concrete subclasses are immutable dataclasses.
Element A single HTML-ish element with optional attributes and children.
TextNode Plain text content. Escaped at serialization time.
HtmlNode Pre-rendered raw HTML escape hatch.
FragmentNode Children grouping with no DOM wrapper.
LaterNode What a page hides at load: a closed dialog's panel, a menu's panel.bretzel.introspectLayer 7 — the framework describes itself, and cannot lie.Layer 7 — the framework describes itself, and cannot lie.
This module reads the installed code at the moment it is queried.
That is what distinguishes it from an API catalogue: there is nothing to
maintain, so nothing to let drift. It is also why it ships INSIDE the
framework and cannot live in a separate package — a version gap between
the describer and the described would make it lie, which is precisely the
illness it cures.
Three high-level entry points:
- index — one line per ui.* symbol, the whole surface.
- describe — a symbol's complete card, as text, on demand.
- resolve — the SAME resolution, returned as a dataclass. It is
the one a consumer calls: the CLI draws its --json from it, and the
order of the tiers (module → component → symbol) is written only there.
⚠️ The emitters' output is UTF-8, arrows and quotation marks
included. A consumer writing it to a stream owns its encoding — on a
Windows console (cp1252) a bare print raises. The CLI does it for
them (bretzel.cli.main); a home-made script must do it too.
And the per-section readers, for a consumer composing their own:
describe_state, describe_client_algebra,
describe_toplevel_surface, describe_method_surface,
describe_callable.
The contract for a third-party consumer (living documentation, generator,
MCP server) is bretzel.introspect.model: the dataclasses are
imported in process, the text output is not parsed.
The absence of a specialised section in the textual output does not mean
the symbol is absent from the general resolution.
14 module(s), 59 public symbol(s)
_signature.pyReading a live Python signature — the shared primitive.
type_label A compact, readable label for a resolved type.
default_label The label of an already-known default value (outside a signature).
describe_callable Read a callable's live signature._target.pymodule:attribute → the object it names. The one reader.
load_target Import module:attribute and return (object, module file).algebra.pyThe Python→JS client binding algebra — read AND executed.
describe_client_algebra Read a binding class's live Python→JS algebra.capabilities.pyWhat Bretzel can DO — the list no tree can give.
Capability One thing Bretzel makes possible, and where one enters it.
capability_names The titles, in list order.
render_capabilities The list as text — what bretzel describe capabilities returns.components.pyThe ui.* catalogue — read live, never copied.
helper_kind The nature of a ui.* symbol that is not a component.
ui_symbol_names Every public ui.<name> symbol, in declaration order.
ui_name_of_class Component class → its ui.* call name.
prop_vocabulary THEME_KEY → variant / size → accepted values.
theme_vocabulary THEME_KEY → group → keys — what Theme(components={…}) can name.
theme_shapes THEME_KEY → group → key → "str" or "dict" — the SHAPE the SHIPPED theme gives each entry.
describe_component Read a Component subclass: family, tag, parameters, and the FIVE introspectable contracts (BINDABLE_PROPS / EVENTS / NAMED_SLOTS / IMPERATIVE / THEME's vocabulary) plus AUTONAME_FROM and THEME_KEY.
describe_ui_symbol Classify a ui.<name> symbol and read it live.
describe_components The whole ui.* catalogue, sorted by name.methods.pyA NAMESPACE's callable surface — the generic primitive.
describe_method_surface Everything callable on cls as a public API.
describe_namespace_surface The callables of names read on owner, in that order.
return_label (function)model.pyThe introspection dataclasses — and nothing else.
ParamInfo A parameter acceptable at the call site.
CallableInfo Any callable read from its live signature.
ComponentInfo A ui.* entry that is a Component subclass.
FieldInfo A field of a state class.
StateInfo A state class — server (4 scopes) or client.
MethodInfo A public method read on a class.
AlgebraOp An operation of the client binding algebra, with the JS it really emits — captured by a probe, not copied.
ModuleSection The public surface of ONE framework module, classified by need.
SurfaceSymbol A name from bretzel.__all__, classified by the need it covers.
SymbolDetail The card of a public symbol that is not a ui.*.
HelperInfo A ui.* entry that is not a component.modules.pyThe public surfaces of the framework's modules, classified by need.
module_names The modules that have a classification table.
public_owners Public name → the package exporting it, over the whole app surface.
uncovered_owners Those of public_owners that no section classifies.
describe_module Read a module's __all__ and classify every name by need.
describe_modules Every covered section, in reading order.
describe_toplevel_surface bretzel.__all__ classified — the surface one meets first.
kind_of (function)
first_doc_line (function)
value_summary A constant's value — its summary, not its type's.
summarize A symbol's index line: its value when it is one, otherwise the first line of its docstring.package_tree.pyThe folder TREE — the framework describes its own layout.
SymbolLine A module's public symbol, and its first line.
ModuleInfo A .py module, its reason to exist, and what it exposes.
PackageNode A package, its reason to exist, and what it contains.
describe_package The tree starting from name, docstrings included.
walk The node and all its descendants, depth first.
package_names Every package under root, dotted paths, sorted.
render_tree The tree as text. No caller in the framework: bretzel describe <package> renders render_package, which does not use it.
render_package A package's card — its reason to exist, its tree, its modules.packages.pyThe components published by INSTALLED packages — and why it is not the same entry point as the roots to scan.
ThemeKeyCollision A package publishes a THEME_KEY the framework already carries.
third_party_components The Component classes published by the installed packages.
third_party_theme_vocabulary THEME_KEY → group → keys, for third-party components.routing.pyKwarg routing — derived from the base layer, never copied.
Bucket One split_kwargs bucket, with what falls into it.
describe_kwarg_routing The buckets, read from the base layer's constants.state.pyThe state classes, read live.
describe_state Read a live state subclass.symbols.pyThe card of a public symbol that is not a ui.*.
symbol_owners Public name → the modules exporting it, in reading order.
symbol_names Every describable name outside ui.*, sorted.
describe_symbol The card of a public symbol of a framework module.theme_sheet.pyA component's THEME card — what describe X --theme returns.
theme_sheet ui_name's theme card, as text.bretzel.introspect.emitProjections of bretzel.introspect.model — and nothing more.Projections of bretzel.introspect.model — and nothing more.
An emitter is dumb: it formats already-built dataclasses, it computes
nothing. That is what guarantees that the text and the JSON cannot
diverge — they read the same data.
1 module(s), 7 public symbol(s)
text.pyThe text emitter — two granularities, and that is the design's point.
render_index One line per ui.* symbol — plus a contracts line when the component carries any. full appends the module API, the kwarg routing and the bindable matrix; without it, the module names and where the rest is.
render_detail A symbol's complete card.
render_symbol The card of a symbol outside ui.*.
render_module A module section, grouped by need.
render_modules Every module section, in reading order.
render_kwarg_routing Kwarg routing, DERIVED from the base layer's constants.
render_bindable_matrix Each component's bindable surface, DERIVED.bretzel.lintLayer 7 — the framework judges the code written against it.Layer 7 — the framework judges the code written against it.
The counterpart of bretzel.introspect: that one describes,
this one reports. The distinction is not cosmetic — it decides what
can be extracted. describe reflects the installed code, so it must
travel at its exact version, otherwise it lies; lint carries *rules*,
knowledge that depends on no version, and it is the half that can leave
the public repository one day. The lint-stays-extractable contract in
the .importlinter file makes that a mechanical guarantee rather than
an intention: no framework module outside cli may import this
package.
Two tiers, by safety and not by convenience:
- run — static. AST only, nothing of the app is executed. It
is the default, and it is what makes it safe to run over a third
party's code.
- run_deep — imports the application to query its map
(undeclared routables, contract drift). Far more powerful, but it
runs the user's code: it cannot be the default, and it takes not
paths but a module:attribute target — the questions it asks have
no answer in an isolated file.
7 module(s), 19 public symbol(s)
corpus.pyDiscovering an app's files, and their AST — with no floor.
Module A source file and its tree, parsed once.
discover The .py files under paths (files or folders).
parse Parse a file, or return None when it is unreadable.
modules Everything readable under paths, parsed.
bound Expose found as the current pass's corpus.
current The pass's corpus, or an empty tuple outside run.
derived The pass's key derivation, built once.
catalogue ui.<name> → its introspected card, read once per pass — the rules consult it for every module or every ui.* call.deep.pyThe deep tier — the one that IMPORTS the application.
run_deep The map lints on the app designated by module:attribute.
lint_app The core, separated from the import.hidden.pyNote: branches a ClientState hides with visible=, rendered anyway.
notes One note per with block hiding heavy content under a ClientState.
watched How many with blocks carry a visible= bound to a ClientState — the population the note judges, for a gate's floor.mode.pyNote: an app that writes its mode= in Bretzel(...).
is_test_module A test file, or anything under a tests folder (benches, e2e apps).
notes One note per literal mode= in an app's Bretzel(...) call.redrawn.pyNote: a component redrawn call after call — a variant may be missing.
notes One note per component redrawn past the threshold, at its first call.report.pyWhat a rule returns, and what the command does with it.
Finding One finding, located, with enough to act on.
Report One pass's aggregate. exit_code is the only translation into a verdict, and it lives here — not in a rule.structure.pyNotes: an app's structure, against app-structure.md.
notes The structure notes of a corpus, sorted like the findings.
is_feature_module (function)bretzel.lint.rulesThe rules — each pure, each enumerable.The rules — each pure, each enumerable.
A rule has the signature check(module) -> list[Finding]. It knows
neither corpus, nor floor, nor exit code: it reports on ONE module and
returns bretzel.lint.report.Finding.
The registry is a list, not a plugin system. The charter rules out a
plugin system before the core stabilises, and a non-enumerable rule set
would stop check saying what it can verify — which is precisely the
question one asks a tool of this kind.
25 module(s), 36 public symbol(s)
_app_calls.pyWhat the app-idiom rules share: reading a ui.* call and its classes.
ui_name badge for ui.badge(...); None for anything not ui.*.
keyword (function)
module_constants {NAME: value} for the module's top-level NAME = value (and NAME: T = value) — the last one wins, as at run time.
literal_tokens The class tokens a classes= value spells out literally — the constant parts of an f-string included, the computed parts left out.
slot_tokens (slot, token) for each class token a slots= value spells out: a dict literal, its ** unpackings, a module-level name for either.
first_text The literal start of a call's first positional argument._theme_calls.pyReading a literal Theme(components={…}) — once only.
called_name The name called, bare or as an attribute — None otherwise.
dict_items The "literal": value entries of a literal dict.
components_arg The components= of a call that looks like Theme(...).
component_maps Every components={…} of this module's Theme(...).badge_by_hand.pyRule: a pill built by hand — ui.badge exists.
check (function)breadcrumb_by_hand.pyRule: a breadcrumb built by hand — ui.breadcrumb exists.
check (function)dialog_flag.pyRule: a dialog opened by a boolean of server state.
check (function)forced_classes.pyRule: a component bent with ! classes.
check (function)handler_script.pyRule: a JavaScript on_* handler built from a value, unescaped.
check (function)handlers.pyRule: a handler cannot be a lambda.
check (function)injection.pyRule: ui.html with anything but a literal.
check (function)kwargs.pyRule: a kwarg passed to ui.* that the component does not accept.
check The kwargs no component called here reads, the framework names imported that do not exist, and the keywords its callables refuse.lifespan.pyRule: a TestClient built without ever entering the lifespan.
check The test clients that will never enter the lifespan.loop_state.pyRule: a ServerState built in an async def body.
check The server-state constructions made from the loop.nested_link.pyRule: a link INSIDE a link — the parser undoes the card.
check The anchors opened inside another anchor's body.nested_page.pyRule: a @page declared in a function body, harvested by nothing.
check The marked pages no sweep can reach.partial_sizes.pyRule: a theme that resizes PART of the form controls.
check The themes that resize only part of the family.shape.pyRule: a theme override that keeps the NAME and changes the SHAPE.
check The theme overrides whose shape contradicts the shipped theme.shared_counter.pyRule: an AppState total incremented without being declared additive.
check The AppState totals incremented without an additive declaration.sizes.pyRule: SIBLING form controls at different sizes.
check One finding per neighbourhood whose controls do not agree.specificity.pyRule: a class in classes= that the SAME prop already sets.
check The classes= entries a prop of the same call already sets.tailwind.pyRule: an assembled Tailwind class only exists in dev.
check (function)theme.pyRule: a Theme(components={…}) name that nothing reads.
check The theme names nothing will read.theme_colors.pyRule: a colour utility names no colour of the theme.
unknown_color The colour a class token names when no theme has it, else None.
check (function)topics.pyRule: a Topic wired on one side only.
TopicUses Where one topic is declared, and the functions touching it.
topics_in Every topic declared in found, with what reads and writes it.
check The topics declared here that one side of the app never touches.transport.pyRule: an app does not drive the transport by hand.
check (function)variant.pyRule: a variant= / size= value no table carries.
check The values no table — shipped or declared — carries.bretzel.probeBrowser-based tools for probing a running Bretzel application.
7 module(s), 21 public symbol(s)
_browser.pyThe browser — one Chromium per process, one context per window.
shared_browser The process's Chromium — started on the first request.
contexts count fresh contexts, closed together on exit._hidden.pyWhat the page carries hidden — measured where it is decided, in the browser.
judge_loads One finding per page loaded: is what visible= hides light?
judge_redraws The zones the actions rendered while they were hidden._probe.pyThe probe — serves the app, opens the windows, records the findings.
ProbeFailedError Raised when at least one browser probe check fails.
ScopeNotReadableError Raised when a probe cannot inspect the requested state scope.
Net Record the network cost of a browser interaction.
say Print, whatever happens to the console's encoding.
Verdict (class)
Probe (class)
probe Serve an application, open browser windows, and run checks on exit._server.pyServing the app for the probe's duration — in a thread, or a subprocess.
free_port (function)
resolve "module:attr" → the object. An object stays itself.
serve Return (base_url, app_object_or_None)._settle.pyWait for the STATE, never for a duration.
settle_page Return SETTLED, NOTHING_MOVED, NAVIGATED or TIMEOUT._sweep.pyThe free sweep — what nobody rewrites, so nobody forgets.
sweep Measure every window, at two sizes and in both themes._window.pyA window — a browser context, its page, what it has seen.
Box Describe an element's geometry in CSS pixels.
Seen A request seen leaving from a window.
ElementNotFoundError Raised when a selector matches no element in a probe window.
DropMissedError Raised when a drag operation does not land on its intended target.
Window Control one browser window during a probe.bretzel.renderINTERNAL layer — server-driven HTML rendering implementation.
20 module(s), 99 public symbol(s)
context.pyPer-request RenderContext + contextvars.ContextVar binding.
RenderContext The per-request scope object.
current_context Return the active context. Raises if called outside a render scope.
maybe_current_context Variant that returns None outside a render scope (no raise).
page_scope_of The page token, derived from the request PATH.
use_context Bind ctx as the active context for the duration of the block.fusion.pyNo-div-soup fusion : attach bz-id to the natural root.
FusionConflict Kept as a public name for backwards compatibility.
fuse_or_wrap Apply the no-div-soup rule and return one HTML element.icons.pyIcons drawn at the first paint, with the text beside them.
with_glyphs nodes with each static icon's glyph inside it, and the JSON block of their data ("" when there is none).ids.pyTwo live elements of a page never share an id — checked in dev.
refuse_duplicate_ids Raise if two live elements of nodes carry the same id.iteration.pyIteration key context — the stable-key stack consumed by components.
current_iteration_key Return the joined iteration key (or None outside any each loop).
iteration_key_for The joined key an each loop running here would give the item keyed key — the id of a row that is not in the list any more.
key_segment Push an identity segment onto the stack, outside any loop.lang.pyWhich language to serve THIS request — and the word table that goes with it.
negotiate_language Choose a language from Accept-Language or use default.
LanguageTables Store the framework text table for each declared language.
resolve_language Resolve the language for the current request.
Language Read or select the language for the current request.later.pyA full page in two times: what shows first, what the page hides after.
visible_first (what shows, the pieces): the HTML of nodes with each hidden piece replaced by its place, and the HTML of each piece, in the order of their places.
place_of The empty <template> that keeps piece index's place.
after_all The pieces as they close <body>, each naming its place.
whole_page A full page as the browser holds it once loaded: each piece back in its place (takeLater in index.js), the inverse of the split.parallel_zones.pyThe zones of one response, rendered side by side.
ZoneNesting Which zones each zone was seen to hold, learned from the responses.
fork A context for one zone rendered apart, and what each of its own collections held when it started (to know, on merge, what it added).
merge Hand what zone_ctx added over to the request's context, as if the zone had rendered in it.partials.pyPartial rendering — single @refreshable section + state delta.
RenderResult The output of a render call ready for Layer 6 to wrap.
render_partial Render refreshable regions and the client-state delta.
render_zones Render zones as out-of-band fragments, one per zone that moved.
push_title Announce title to the runtime through HX-Trigger.
fingerprinter_for The fingerprint rules of this app: its anti-replay window, and which actions are @idempotent — decided as the action route decides, from the handler the action id resolves to (cf. render/zone_diff.py, "What a fingerprint ignores").
drain_refresh_queue Render every queued refreshable in one OOB-batched response.pipeline.pyFull-page render orchestration — turns a @page function into HTML bytes.
render_page Render a full HTML5 document for page_fn.row_memo.pyThe rows a table does not rebuild.
RowMismatchError In dev: a row taken back differs from the row rebuilt.
RowMemo The rows last rendered, per session. Owned by the application (Bretzel.row_memo), never by the module; bounded by rows.
print_of A print of a row's value that two renders of the same data share, or None when there is none (an object that only shows its address).
columns_print A print of the columns: their fields, and each render= by its code, its defaults and what its closure holds.
row_cells The cells of the row row_id: taken back when nothing moved, else build().screen.pyScreen — current viewport shape, read server-side from a cookie.
Screen Per-request viewport shape read from the bz_screen cookie.serialize.pyPublic helper : Component → serialized HTML string.
serialize_html Render *component* in isolation and return pretty HTML.shared_parts.pyParts a page carries ONCE, cloned where they are needed.
share_part Register children as a part of the page; return its key.
shared_part_templates The <template> of each part this render shared, once each.
graft_shared_parts node with every shared part put back in its host.shell.pyHTML5 document shell — assembles the bytes that go on the wire.
nav_progress_html The navigation bar, injected once per page.
default_shell Assemble the complete HTML5 document.
inline_scripts The inline bodies, named. Cf. _inline_scripts.
ShellSources Everything the shell loads or runs — the surface a CSP covers.
shell_sources Return the sources the HTML shell will actually emit.
favicon_href The URL of the document's icon, for Bretzel(favicon=…).texts.pyThe words the framework wrote itself, and how to replace them.
TextsError Raised when a replaced framework sentence is not one Bretzel says.
resolve_texts The table of lang: the framework's words in it — French ships with the framework, an unshipped language is English — then the app's overrides on top.
text Return a framework phrase for key in the application's language.
template Return the raw framework text template before interpolation.
plural The form of key the request's language takes for n: in French the singular for 0 (_one), in English "0 results" (_other); a form the table lacks falls back on _other.translations.pyThe words of an app in each language it declares — t.
TranslationsError Raised at startup when translations= cannot be read right.
split_translations translations= → the framework's sentences it replaces, and the app's own, each by language.
TranslationTables The app's tables, checked once at startup, queried per request.
t source in the request's language, its holes filled.types.pyStructural types used by the render layer.
BretzelApp The slice of Bretzel the render pipeline depends on.vendor.pyThe three third-party scripts, served from your own host, not a CDN.
VendoredAsset A third-party script: its file name, its source, its fingerprint.
packaged_path Where asset sits inside the installed package.
vendor_dir ./.bretzel/vendor/ — the project cache, next to the cwd.
cached_name Return the cache filename containing the expected content fingerprint.
cache_path Return the project-cache path for asset whether or not it exists.
vendored_local_path The file to serve: the packaged copy, else the project cache.
vendored_is_available Return whether a vendored asset exists locally.
route_for (function)
url_for The URL to put in the <script>: local if present, CDN otherwise.
download Download asset into the cache, fingerprint verified.
download_all Everything that can be brought in-house, in the project cache.
browser_css_asset The browser Tailwind compiler — the FOURTH third party.
downloadable_assets Return every third-party asset that can be downloaded locally.
prosemirror_asset ProseMirror and markdown-it, the brick under ui.editor — the FIFTH third party, and the only one a page loads on demand.
served_assets The third-party scripts the vendor route serves: every page's, and the editor's.
ensure_vendored Download missing third-party assets without making startup fatal.
vendored_assets Return the third-party scripts loaded by every page, in order.
main bretzel vendor (and python -m bretzel.render.vendor).
IconRequest The component's request: a set and the names it wants from it.
icon_request /<prefix>.json?icons=a,b read, or None for anything else.
icon_cache_dir ./.bretzel/vendor/icons/ — created on demand.
packaged_icon_payload Answer /<prefix>.json?icons=a,b from a set shipped in the wheel.
icon_payload Answer the component's request: shipped set, cache, then upstream.
packaged_glyph (body, width, height) of prefix:name from a set shipped in the wheel, without touching the network. None when the set is not shipped, the name unknown, or an alias transforms its parent (rotate, flip) — the component then draws it as before.zone_diff.pyShip only the elements of a zone that changed.
ZonePrint A zone's fingerprints, as one render produced them.
ZoneVersion What the cache keeps of a zone version: each identified element's fingerprints, and the ones that have identified descendants, with those (in order).
ListPatch A parent whose list of addressed children changed, nothing else.
Patch What to ship so that the client's copy becomes the fresh render, as changes found it. ship sends it.
Fingerprinter Computes the fingerprints of a tree under one render's rules.
position_key A unique key for the index-th element under parent — a control character no id carries. Never parsed back: the place is kept in ZonePrint.place.
is_positional Is key a position (position_key), not an id?
shape_of A short fingerprint of an element's children as the runtime sees them — djb2 over their tags joined by ,, bz-if ones left out. The runtime computes the same from the DOM (localName, skipping data-bz-row) before each step of a walk: a tag alone does not tell two spans apart.
holding The addressed elements nearest to a form control named in names.
drifted Does the browser hold, inside zone root_id, a zone with another fingerprint than zones says? Then its copy is not that version.
inner_version The version of the zone zone_id as printed renders it inside its parent — what that zone holds once a patch of the parent reached it, cut out of the parent's fingerprints rather than walked again. None when the parent's ids repeat.
as_shown The version of zone root_id the browser actually shows.
changes What to ship so that held becomes printed.
list_patch The ops turning the list before into after (cf. ListPatch); nodes holds the fresh children, matched the children by position that stay (_match).
ship A patch as the response carries it, nested zones stamped.
ZoneMaps Zone fingerprint → its elements' fingerprints, most recent first.
SessionZoneMaps ZoneMaps under one session's prefix — same three methods.
stamp_zones Set DATA_ZONE_HASH on every zone among nodes.
stamped The zone's root carrying its fingerprint, cached for the next patch.bretzel.render.decoratorsRender-layer decorators (@page, @layout, …).Render-layer decorators (@page, @layout, …).
Internal aggregator — the user-facing surface lives on the
Bretzel instance, which dispatches app.page(...) /
app.layout(...) to these implementations.
5 module(s), 26 public symbol(s)
download.py@download — the routable that returns a FILE, not a page.
DownloadAlreadyMarkedError Two @download on the SAME function — the second would erase the first.
DownloadMeta Captured at decoration time, read by the route registrar.
path_params_of The parameter names a route path declares, in order.
download Mark a function as the producer for a file served at GET path.error.py@error_page(status_code) — register a custom HTTP error page.
ErrorMeta (class)
error_page Mark a function as the custom page for an HTTP status code.layout.py@layout — mark a function as a layout that wraps pages.
LayoutMeta Captured at decoration time.
layout (function)
layout (function)
layout Mark a function as a layout. Free decorator — needs no app.page.py@page — register a function as a routed page handler.
PageAlreadyMarkedError Two @page on the SAME function — the second would erase the first.
PageMeta Captured at decoration time, read by the route registrar.
page Mark fn as the handler for GET path (or other methods).refreshable.py@refreshable — mark a function as a partial swap target.
state_qualname Return the stable wire identifier for a state class.
shared_states The states among classes that another tab can change. Who among the other tabs hears of it is the scope's business (_publish_broadcast).
ZoneRegistry The zones of one application, owned by it (Bretzel.zones).
zones_reachable_from Every zone bound to a module name in the app's own modules.
zone_attrs The attributes a zone sets IN ADDITION to its bz-id.
drain_pending_async_zones Await the bodies of the async zones set down during this render.
RefreshableHandle Callable wrapper carrying refresh metadata.
field_id The short wire identifier of a state field — derived from the code, so the same on every worker. Two fields sharing one (16M values) cost a re-render too many, never one too few.
enqueue_readers Enqueue every zone that read a changed field for the end-of-action refresh drain.
enqueue Queue zone for the drain, once.
broadcast_changes Fan out state-dirty for every changed state another tab can see and some zone shows, so the OTHER tabs showing it refetch it.
refreshable Wrap fn as a refreshable page region.
refresh Force a refresh of a zone — the single imperative trigger.bretzel.render.languagesThe framework's words in the languages it ships, and how each counts.The framework's words in the languages it ships, and how each counts.
English is bretzel.render.texts.DEFAULT_TEXTS; the others live
here, one module each, with the same keys and the same holes. A language
the framework does not ship is served in English — an app gives its
sentences through translations=.
Counting is part of the language. French says the singular for 0
and 1, English for 1 alone — "0 results" — and Russian or Polish have a
third and a fourth form. The rules below are CLDR's for whole numbers —
the framework only ever counts things (results, files, points) — for the
languages a Bretzel app is likely to declare; any other counts as English
does, one for 1.
1 module(s), 0 public symbol(s)
fr.pyThe framework's words in French — the table lang="fr" takes.
bretzel.runtimeINTERNAL layer — browser transport and client runtime integration.
7 module(s), 24 public symbol(s)
_build.pyAssemble the runtime sources in the order declared by bretzel.runtime.sources.MODULES.
build (function)
check CI helper: non-zero when either bundle is stale vs _src/._minify.pyStrip comments and indentation from a JS bundle. Nothing else.
strip_comments src without its comments — strings, templates and regexes intact.
minify The bundle without comments, indentation or blank lines.envelope.pyEnvelope / patch serialisation — the V3 wire format server ↔ runtime.
Envelope Top-level shape of the <bz-envelope> payload.
Patch Top-level shape of one <bz-patch> payload.
default_endpoints The runtime endpoints baked into a fresh envelope.
build_envelope Build a deterministic, JSON-friendly runtime envelope.
serialize_envelope Render the complete <bz-envelope>…</bz-envelope> tag.
build_patch Bundle the client states to send into a patch payload.
serialize_patch Render the <bz-patch>…</bz-patch> tag, or "" if empty.
error_envelope Render a <bz-patch> carrying a reserved _error directive.
parse_client_payload Split form-data into (client state per instance) + (handler args).protocol.pyWire-format constants — the only place these strings are defined.
posted_action The action id these attributes post (hx-post, written by components.base.events.action_attrs), or None. Read next to the route it names, so every layer reads it the same way.
posted_args The _args blob these attributes post (hx-vals, written by action_attrs), "" when there is none.
is_public_asset_path Return whether path names a public framework asset.
outlet_id_for Return the <main> id for layout_name's outlet.sources.pyWhere the runtime's client code lives, and in which order it loads.
verbs.pyClient verbs — BROWSER actions, written in Python.
copy Copy value to the clipboard when the action runs.
print_page Open the browser print dialog when the action runs.
fullscreen Enter fullscreen mode when the action runs.
share Open the native share sheet, or copy the URL when sharing is unavailable.
vibrate Vibrate the device when the action runs.version.pyRuntime protocol version + compatibility check.
parse_major Extract the major-version segment of a vN.M[.K] string.
check_compat Return True if the client's reported version is compatible.bretzel.serverHTTP, authentication, routing, and application lifecycle services.
16 module(s), 94 public symbol(s)
_dev.pyBretzel-owned dev watcher.
PortAlreadyTakenError The port is already held — said BEFORE launching anything.
ensure_port_is_free Raise PortAlreadyTakenError if (host, port) is taken.
exit_with_parent In a spawned child: leave when the parent is gone.
run_dev_server Block on watchfiles' parent loop: spawn _run_uvicorn as a child, restart it on every *.py change under watch_dirs. Returns on Ctrl+C.app.pyBretzel — the user-facing app class.
Bretzel The Bretzel application instance.auth.pyAuthentication helpers for Bretzel applications.
resolve_cookie_secure Should the Secure attribute be set on the cookies?
request_scheme A request's scheme, tolerating duck-typed objects.
parse_cookies_from_scope Parse the Cookie header on an ASGI scope into a name→value dict.
AuthUser Minimal auth identity — the framework only knows the id.
login Open a session for user_id — the proof already happened.
session_cookie The value of the session cookie: the id and its signature.
session_of_cookie The session id a cookie carries, or None when this server did not sign it (invented, altered, or from before the signature).
logout Clear the auth cookie + rotate the session id.
session_key A key that lets another program act in THIS browser session.
user_id Return the authenticated user id, or None for an anonymous request.
is_authenticated Convenience boolean wrapper around user_id.
verify_auth_cookie Validate a Bretzel_auth cookie and return the user id.
verify_session_key Validate a session_key and return the session id it opens.
resolve_identity The identity chain, played on a raw request.
app_of The Bretzel instance reachable from a raw request.config.pyResolved app configuration — populated once at Bretzel init.
redis_state_url state_url when it names a Redis server, None otherwise.
ConfigError Raised at BretzelConfig construction when a required setting is missing or malformed.
project_secret The project's own key, ./.bretzel/secret_key, created on the first start.
weak_secret Why key is weak for production, or "": a placeholder, under 32 characters, or fewer than 10 distinct characters ("x" * 32). A generated key (secrets.token_hex(32)) passes all three.
BretzelConfig The resolved, validated configuration of a Bretzel app.crypto.pyKey derivation + signing primitives for the security layer.
derive_key Return a 32-byte key derived from master for purpose.
sign Compute the HMAC-SHA256 hex digest of payload under key.
verify Constant-time check that signature matches sign(key, payload).errors.pyServer-layer error types + abort + default error pages.
abort Raise an HTTP error from inside a request handler.
default_error_page Build a self-contained HTML5 error page.feature.pyThe Feature contract — a colocated slice's public boundary.
FeatureError Raised when a feature contract is malformed, or a set of features doesn't form a valid graph (unknown dependency, cycle, name clash).
Feature One feature's contract. Declared once per feature package ::
validate_features Check a set of features forms a valid graph.
ProvideInfo One item a feature exposes, classified by what it is.
FeatureNode One feature in the app graph — its contract, with provides classified, plus its folder path (the group hierarchy).
AppGraph The whole app, read from its feature contracts : the nodes, the routes they mount, and the dependency edges. This is the living skeleton — one source (the Feature objects), read live, so it can't drift from the app it describes.
describe_app Read a set of feature contracts into an AppGraph.
undeclared_provides L1 — registered routables (pages / error handlers) covered by NO Feature: they run, but the map does not see them and the graph does not validate them — the skeleton would lie by omission.
DriftReport L2 — ONE feature's gap between its contract and its real imports.
dependency_drift L2 — confront the DECLARED uses/reads with the REAL imports (AST of each feature's modules, already loaded in sys.modules).feature_audit.pyWhat an app's Feature contracts can answer when they are asked.
SymbolUse importer takes name from provider's modules.
Surface Public symbols nobody else uses, and symbols taken without being public.
Impact What a change to some files touches.
app_files The app's Python files that belong to no feature — core/, main.py, the tests — as (label, path): what they use is used.
symbol_uses Every symbol a feature takes from another one: from x import a, and import x as m / from pkg import x read as m.a. With root, the app's files outside the features too (core/, the tests), labelled by their path.
surface (function)
import_graph Feature → the features its modules really import (not its uses).
impact The features a change to files touches, and how to check them.
describe_features The map: per feature, what it is, its first docstring line, its routes, what it exposes, who imports it and what it imports.
kind_errors What makes a kind lie, one line each:
contract_errors What makes a contract lie, one line each: a uses that differs from the real imports, a symbol taken from a feature whose provides does not hold it, a kind that lies (kind_errors). What Bretzel refuses to start on in mode="dev".
findings What to fix, one line each: contract_errors, then a public symbol nothing uses — advice, not an error: a function kept for the chatbot or an API may wait for its first caller. root: the app's folder, so that what core/ or the tests use counts as used.handlers.pyStateless action dispatch — module::qualname + HMAC signing.
HandlerResolutionError Raised when an action_id cannot be resolved or its signature fails verification.
UnsealedActionError A request asks to write a state without saying which fields it may (writable_fields): its page is older than the server.
encode_action_id Return <module>::<qualname> for a module-level callable.
action_path The path this handler POSTs to — what a guard must let through.
resolve_handler Look action_id up in sys.modules and return the callable.
encode_args The _args blob: a partial's bound args, and the form fields this action may write into a state — its control's own name (cf. writable_fields).
decode_args Decode the _args form field (POST body) back into (args, kwargs).
UploadRefusedError A file field sent more, bigger or other files than its control accepts (check_uploads).
fields_token The value of a form's FIELDS_TOKEN input, signed for one session: the names of the controls it renders, what each of its file fields accepts, and the ACTIONS rendered under it — the form's own and its controls'. htmx sends it with the form, by its own rules — the form submitted, or the form around the control that fires. Bound like an action's signature: a token lifted from another session's form (one that lists role) widens nothing here; and a token lifted from ANOTHER FORM of the same page widens nothing either (form_token takes the posted action).
form_token The form token this request carries, verified for the request's session and for action_id — None without one, with one that does not verify, or with one signed for a form whose actions do not include this one (it counts for nothing).
writable_fields The state fields this request may write.
check_uploads Hold each file field of the form to what its control accepts — accept, multiple, max_files, max_bytes — or raise UploadRefusedError.
sign_refetch The signature of a zone's refetch URL (<zone>) for one session. The refetch route renders a zone outside its page, so outside whatever the page checks; without this, any client that could spell the URL — module names are public — got the zone.
verify_refetch Constant-time check of sign_refetch.
action_hmac_payload The exact byte string signed and verified for one action.
sign_action Compute the HMAC-SHA256 signature for one action, in one session.
verify_action Constant-time comparison of the supplied signature against the one we'd produce for (action_id, args_blob, ts) in session_id — the session of the request, never one the request names.idempotency.pyOpt-in handler idempotency (HMAC v2 — the "C" half).
idempotent Mark a handler idempotent for ttl seconds.
idempotent_ttl The handler's idempotency TTL (seconds), or None if not marked.
idempotency_key Compact, injection-safe dedup key for one signed request + user.
MemoryIdempotencyStore Single-process store — a dict + lock with lazy expiry.
RedisIdempotencyStore Multi-worker store — an atomic SET key 1 NX EX ttl.lifecycle.pyStartup / shutdown orchestration.
bretzel_startup Run framework-side startup. Call before user hooks.
bretzel_shutdown Run framework-side teardown. Call after user hooks (LIFO).
build_middleware_stack Wrap the FastAPI app in framework + user middlewares.navigation.pySending the browser elsewhere — from a handler or from a middleware.
response_is_read_by_htmx True when htmx will handle the headers of the response to request.
redirect_response A response sending request to url, whatever its nature.
PageRedirectError redirect called while a page renders for an ordinary navigation. The page route answers it with a real redirect (routing/pages.py); it only surfaces where no page is rendering — an API route, a @download —, with the way out in its message.
redirect Navigate the browser to url.
push_url Change the displayed URL without navigating or reloading the page.
reload Reload the page displayed by the browser after the current request.oauth.pyOAuth and OpenID Connect authentication providers.
OAuthError An OAuth transaction that does not complete, framework-side.
OAuthProfile Represent the normalized user profile returned by an OAuth provider.
OIDC Configure an OpenID Connect provider from its issuer metadata.
OAuth2 Configure an OAuth 2 provider from explicit endpoint URLs.pwa.pyPWA — the declaration that makes an app installable.
PWAIcon Describe one icon in the web application manifest.
PWA Declare the metadata that makes an application installable.security.pySecurity headers — the boring ones always, the CSP on request.
script_hash Return the 'sha256-…' of an inline <script> body.
build_policy Compose the value of the Content-Security-Policy header.sse.pySSE broker — per-session message queues + state subscription tracking.
SSEBroker Backend-agnostic protocol the framework holds at runtime.
MemoryBroker In-process SSEBroker implementation.
RedisBroker Cross-worker SSEBroker — a local queue engine plus a Redis Pub/Sub fanout of the state-dirty signal.bretzel.server.decoratorsServer-side decorators : middleware, startup, shutdown, background.
4 module(s), 9 public symbol(s)
background.py@background — fire-and-forget after-response work.
BackgroundContextError Raised when .schedule() runs with no live request bound.
bind_background_tasks Bind tasks as the current request's background queue.
BackgroundHandle Returned by background. .schedule(kwargs) enqueues the wrapped function onto the current request's background queue ; calling the handle directly (await handle(kwargs)) just runs the function — the escape for contexts with no request.
background Mark fn as an after-response background task.identity.py@auth.source and @auth.door — the two halves of identity.
source Declare an identity source checked after the signed cookie.
door Declare a login provider and how its profile is handled.lifecycle.py@app.startup / @app.shutdown decorators.
startup Register a startup hook. Hooks fire after framework internals.
shutdown Register a shutdown hook. Hooks fire LIFO before framework teardown.middleware.py@app.middleware — register a user-defined middleware.
middleware Append target to the app's user-middleware list.bretzel.server.middlewareFramework middlewares wrapping the underlying FastAPI.Framework middlewares wrapping the underlying FastAPI.
Inbound order (outermost → innermost):
0. SecurityHeadersMiddleware <.security.SecurityHeadersMiddleware>
— sets the security headers on the response on the way back. The
outermost of the five so as to cover what the layers below produce on
their own (a CSRF 403, an auth 401).
1. SessionMiddleware <.session.SessionMiddleware> — mints /
reads the Bretzel_session cookie; stashes session_id and
parsed cookies on request.state.
2. CSRFMiddleware <.csrf.CSRFMiddleware> — verifies the
per-session X-Bretzel-CSRF header on non-safe HTTP methods.
Skipped for /_bretzel/action/* (those carry their own HMAC).
3. AuthMiddleware <.auth.AuthMiddleware> — verifies the
Bretzel_auth cookie and pins request.state.user.
4. RenderContextMiddleware <.render_context.RenderContextMiddleware>
— composes the bretzel.render.context.RenderContext that
the rest of the pipeline reads from; buffers + parses the form
body once and splits the V3 namespaced client-state fields
(Class.key.field) from regular handler args.
8 module(s), 13 public symbol(s)
_state.pyInternal helpers for the pure-ASGI middleware stack.
ensure_state Get or initialise the State object pinned on scope.
read_header Return scope['headers']'s value for name or None.auth.pyIdentity middleware — resolves request.state.user on every request.
AuthMiddleware Resolve request.state.user from the identity chain.compression.pyCompression — Starlette's GZipMiddleware, minus the open streams.
asks_for_a_stream Whether the request's Accept names text/event-stream.
Compression GZipMiddleware that builds no compressor for a live stream.csrf.pyCSRF middleware — session-bound token + Origin/Referer check.
csrf_token_for Compute the CSRF token for session_id under csrf_key.
CSRFMiddleware Verify the per-session CSRF token on non-safe HTTP methods.host.pyHost check — answer only the names this app is reached by.
host_name The name in a Host header, without its port, lowercased — [::1]:8000 → [::1], Example.org:443 → example.org.
is_allowed (function)
HostMiddleware Refuse a request addressed to a name the app does not answer.render_context.pyRender-context middleware — the central piece.
RenderContextMiddleware Construct a per-request RenderContext and apply its accumulated cookies / headers to the outgoing response.security.pyMiddleware that sets the security headers on every response.
SecurityHeadersMiddleware Set BORING_HEADERS and, if asked for, the CSP.session.pySession-cookie middleware — Bretzel_session.
SessionMiddleware Read or mint the Bretzel_session cookie on every request.bretzel.server.routingRoutes for pages, actions, partials.
11 module(s), 14 public symbol(s)
_csv.pyCSV writing, shared by both download paths.
cell One CSV cell: text that would open a formula gets a leading ', which a spreadsheet shows as text and does not run (OWASP's rule). Numbers — the value's own type, or a signed plain number — pass as they are.
to_csv RFC 4180 text: one header row, then one record per line.
columns_of The columns DERIVED from a list of dicts — key and label equal.actions.pyPOST /_bretzel/action/{action_id} — the event-dispatch endpoint.
register_action_route Wire the single POST /_bretzel/action/{action_id:path} route.api_docs.pyGET /docs — Swagger UI over the app's own JSON API, opt-in.
register_api_docs Mount /docs and declare the bearer scheme, if api_docs.datatable.pyGET /_bretzel/datatable.csv — the Datatable's export endpoint.
register_datatable_export_route Wire the single GET /_bretzel/datatable.csv route.downloads.pyMounting the @download routes.
attachment The Content-Disposition of a file named name.
register_download_routes Mount one GET route per function carrying _bz_download.errors.pyException handlers — turn raised errors into Bretzel-rendered pages.
register_error_handlers Wire the four exception handlers on the FastAPI app.manifest.pyGET /manifest.webmanifest — the app's manifest, when it declares one.
register_manifest_route Mount the manifest route, if there is a manifest.pages.pyPage routing — turn @page("/path") into FastAPI routes.
register_pages Add every registered @page function to fastapi.realtime.pyGET /_bretzel/refetch/{zone} — the per-zone refetch route.
register_realtime_route Wire GET /_bretzel/refetch/{zone_qualname}.sse.pyGET /_bretzel/sse — the EventSource endpoint for realtime.
register_sse_route Wire GET /_bretzel/sse on fastapi.static.pyFramework-served static assets — runtime.js, theme.css.
register_static_routes Wire the framework asset routes into fastapi.bretzel.stateTyped state for Bretzel applications.
8 module(s), 26 public symbol(s)
_wire_name.pyThe name a bound control sends its field under — and how to read it.
AmbiguousFieldError Two states sent a field of the same name, and the handler asked for the bare name — which one it means cannot be guessed.
wire_name Delivery.mode / Delivery[paris].mode.
split_wire_name (class name, key, field) of a wire name, else None.
state_view The submission as state_cls's default instance reads it: {field: value} — its wire names first, else the bare field names of controls the app named itself.
lookup (found, value) for a handler parameter or form_value(name).base.pyAbstract State + the _StateMeta metaclass.
State Abstract parent of all typed-state classes.live_connection.pyLiveConnection — the state of the SSE link, held by the runtime.
LiveConnection Expose the state of the framework's real-time connection.locking.pyThe lock an app asks for, around a read-modify-write.
LockTimeoutError Raised when a state lock cannot be acquired before its deadline.
StateLock The context manager returned by MyState.lock().registry.pyPer-request state registry.
ScopeConfigError Raised when scope-specific identity is missing (no session id …).
StateHydrationError Raised when server state cannot be hydrated safely.
current_registry Return the registry bound to the active async task, if any.
use_registry Bind a registry as the active one for the current task.
StateRegistry Per-request resolver, hydrator and committer.topic.pyTopic — a subject whose changes redraw the zones that read it.
Topic A named subject. Declare it once, at module level.
reads A zone calling this function follows topics.
writes Once this function has returned, the zones reading topics redraw.types.pyThe business types a state field can carry, and how they travel.
register_type Register how cls is encoded to and decoded from JSON.
encode_value Render value in a form json accepts.
decode_value Read raw back as a type_, or return it unchanged.
is_storable Can the declared type REACH the store, AND come back from it?url.pyThe state fields an app makes addressable — the URL as state.
AddressableFieldError Invalid URL declaration, or two states claiming the same name.
addressable_fields {field name: parameter name} declared by cls.
would_publish What addressable=True would publish — VALIDATED, therefore true.
apply_url_params Seed the declared fields from params. Returns the names touched.
collect_url_params {parameter: value} for every declared field of instances.bretzel.state.datatableTyped state and reader queries for data tables.
2 module(s), 2 public symbol(s)
query.pyQuery — what the reader asked for, handed to a rows callable.
Query One reader's view of a table : what to match, how to order, which slice.state.pyDatatableState — the query a Datatable reads and writes.
DatatableState The query behind one Datatable — sort, page, search.bretzel.state.fieldsField descriptors and decorators (internal aggregator).Field descriptors and decorators (internal aggregator).
The user-facing surface lives in bretzel.state ; this package only
groups the implementation files for cohesion.
3 module(s), 11 public symbol(s)
computed.py@computed decorator and the ComputedProperty descriptor.
ComputedProperty Descriptor backing a @computed declaration.
computed Mark a method as a derived, auto-tracked, cached property.descriptor.pyField descriptor — the storage / access primitive for typed state.
coerce_form_value (provided, value) — a submitted string in the declared type.
assign_fields Write several fields as ONE mutation. (errors, rejected).
Field Per-attribute descriptor.
field Declare a typed state field.validator.pyValidator declarations for typed state.
FormError Report a validation error for an entire state instance.
Validator Wrapper around a validator callable.
validator (function)
validator (function)
validator Mark a function as a validator.bretzel.state.persistenceStorage backends and the ClientState field-materialisation helpers.Storage backends and the ClientState field-materialisation helpers.
Internal aggregator — the user-facing API lives in
bretzel.state (MemoryBackend, SqliteBackend,
RedisBackend,
Backend). The V3 wire format itself lives in
bretzel.runtime.envelope.
5 module(s), 8 public symbol(s)
base.pyStorage backend protocol.
Backend Async key-value store with scope-aware key namespacing.client_bridge.pyField materialisation helpers for ClientState wire payloads.
instance_key Return the wire key for state : "<ClassName>.<key>".
full_field_dict Read every declared field, materialising defaults.memory.pyIn-memory storage backend for dev / tests.
MemoryBackend Backend implementation backed by a process-local dict.redis.pyRedis storage backend for production deployments.
require_redis The redis package, imported on first use.
RedisBackend Backend implementation backed by redis.asyncio.sqlite.pySQLite storage backend: the states survive a restart, in one file.
path_of The file a sqlite:///… URL names — SQLAlchemy's convention.
SqliteBackend Backend implementation backed by one SQLite file.bretzel.state.scopesState scopes — internal aggregator.State scopes — internal aggregator.
The user-facing surface (ServerState, ClientState plus the
sugar aliases) is re-exported by bretzel.state. This package
groups the implementations only.
2 module(s), 6 public symbol(s)
client.pyClientState — typed state living in the browser.
rendering_scope Mark the active task as 'rendering'.
ReactivityError Raised when a ClientBinding is misused server-side.
ClientBinding Wrapper carrying field metadata + the current server-side value.
ClientExpression Build a browser-side expression from one or more client bindings.
ClientState Typed state mirrored into the browser by the runtime.server.pyServerState — typed state living on the server.
ServerState A typed state persisted on the server side.bretzel.themeVisual identity, palettes, and Tailwind CSS generation.
13 module(s), 39 public symbol(s)
bridges.pyThe colour bridges — twelve steps derived from one source hue.
bridge_class A colour's bridge class name. primary → bz-c-primary.
bridged_color_names The colours that receive a bridge.
step_percentages Every step's percentage for color in mode, and the colour the fill's hover moves towards (solid_hover_to).
wash_lines The vivid colours' steps reachable BY NAME — bg-error-wash, border-error-edge — for a variant table that writes one colour per row and so has no bridge class to read. The bridge's own formula and doses (step_percentages), not a second measurement.
generate_color_bridges The bridges' CSS block — one rule per colour.build.pyStandalone Tailwind v4 binary downloader + compile orchestration.
download_binary Download the Tailwind v4 standalone binary if absent.
scan_roots The folders the compiler will read, for THIS input CSS.
get_or_build_css Return a compiled style.css string for theme_css.class_merge.pyThe app's class wins over the theme's: the conflict is settled in the HTML.
split_token ("dark:hover:", "bg-text/5") for dark:hover:!bg-text/5.
utility_properties The CSS properties Tailwind emits for utility (no variant, no !), sorted — or None when the table does not know it.
longhands props with every shorthand read as the longhands it sets.
merge_classes base + addition, without what addition redeclares.
slot_strings What a component theme draws slot with: its template, the rows of its variants and sizes for that slot (a row is the root's string, or a dict keyed by slot), and the root's modifiers.color_scheme.pyColorScheme — current color mode as a framework-owned ClientState.
ColorScheme Framework-owned color mode (singleton via the default key).compiler.pySubprocess wrapper around the Tailwind v4 / Lightning CSS binary.
CompilerError Raised when the binary cannot be located or returns a non-zero exit code. The message includes whatever the binary printed to stderr so the user has something actionable on hand.
find_lightning_binary Resolve the Tailwind v4 / Lightning CSS binary.
CompileResult Return value of a successful one-shot compile.
compile_with_lightning One-shot compile : feed theme_css to the binary, write to output_path.
start_lightning_watch Spawn the binary in --watch mode and return the live process.config.pyUser-facing theme configuration dataclasses.
IconConfig Defaults consumed by the ui.icon(...) component.
ScrollbarConfig Style for the synthesised scrollbar (WebKit + Firefox).css.pyFull theme.css generator.
generate_scrollbar_css Build the scrollbar rules: ::-webkit-scrollbar for Chromium and Safari, the standard properties for Firefox only.
strip_safelist Strip the scan instructions from the theme CSS — the @source inline(...) safelist and the @source "<dir>" roots.
strip_scan_roots Strip the @source "<dir>" roots — and NOTHING else.
generate_theme_css_full Assemble the full theme.css Lightning CSS will ingest.neutrals.pyThe neutral steps — the greys every component shares, computed.
neutral_reads Whether a neutral step reads at a dose — the rule of NEUTRAL_STEPS, for the solver and for the gate that judges the emitted CSS. before is the dose of the step an after: follows.
neutral_percentages Each measured neutral step's dose in mode.
neutral_lines The --color-<step> declarations of mode — every step, so a .dark subtree recomputes them from its own text and grounds.palette.pyResolved palette — semantic + extras, with auto-foreground derivation.
ThemeError Raised on invalid theme input (missing slot, unknown color, …).
resolve_color_pair Return (bg_hex, fg_hex) for a single hex.
ResolvedColor A color name + hex pair + the CSS class names that point to it.
Palette Resolved palette — semantic + extras for both light and dark modes.slots.pyPure helpers for component-theme slot resolution and override merging.
merge_component_themes Deep-merge override on top of base — non-mutating.
validate_component_overrides Raise when an override names something nothing will read.sources.pyThe roots the production compiler SCANS — and who declares them.
discovered_source_roots The roots installed packages declare, sorted.
all_source_roots The framework package, then what the others declare.
generate_source_directives Return the Tailwind v4 @source "<dir>"; block for roots.tailwind.pyGenerate the Tailwind v4 @theme block.
generate_theme_css Build the @import + @theme + .dark blocks.
generate_safelist_comment Return a Tailwind v4 @source inline(...) directive.tokens.pySemantic / palette name catalogue + type literals.