Widgets¶
The Ff widget library: typed wrappers of the React components in the committed dist.
femforge_workbench.widgets
¶
The Ff widget library: typed wrappers of the React components in the built dist, one module per family.
Modules:
-
accordion–The accordion: collapsible sections, one or several open at a time.
-
badge–The badge.
-
body_look–The body look: a swatch that opens a body's visibility, opacity and color editor.
-
busy–The busy indicator of an area whose content the server is working on.
-
button–Buttons: the shadcn button and button group.
-
card–Cards: a bordered box with header, content and footer.
-
checkbox–The checkbox.
-
code–The code editor: Monaco over a text value.
-
combobox–The combobox: a searchable single choice narrowed by group toggles.
-
context_menu–Context menus: a Radix menu a right click opens over its trigger, and its items.
-
dialog–Dialogs: a modal and its trigger, content, header, footer and close.
-
dist_hash–The source hash a built client dist records in version.json, shared by the build hook and the startup check.
-
dock–The dock: a dockview host rendering one server template per panel.
-
drawer–A bar at the bottom of its parent with a body that slides up under it.
-
dropdown_menu–Dropdown menus: a Radix menu and its trigger, content, items and groups.
-
element–The Element base: a wrapper's declared parameters become React props by name, those named on_* events.
-
entity_grid–The entity grid: rows of bodies or boundaries with their conditions as read-only editors, one tab stop with roving focus.
-
field–Fields: a labelled control with its description and error.
-
fields–Read-only fields: an authored value shown in the control that would edit it.
-
icon–The icon: one of the curated lucide names.
-
input–Text inputs: uncontrolled, committing to the state on blur and Enter, named after the state key they bind.
-
label–The label.
-
module–The Ff client module: the built dist under serve/, its trame descriptor and the URLs of its files.
-
notify–The shell's one-shot messages to the user: a file to save and a toast.
-
plot–The plot: a plotly figure reporting restyle, relayout and click events.
-
progress–The progress bar.
-
reveal–Controls that appear with the setting they depend on.
-
scene–The scene widgets: the browser-side companion of a mirrored view.
-
scroll_area–Scroll areas: a viewport with styled scrollbars.
-
select–Selects: a Radix select and its trigger, value, content and items.
-
separator–The separator.
-
slider–The slider.
-
switch–The switch.
-
table–The table: a TanStack table over columns, rows and options, reporting its layout, row clicks and the selection.
-
tabs–Tabs: a tab list and the content panes it switches.
-
term–The terminal: an xterm fed from the server.
-
tip–The tooltip a single child carries.
-
toggle–Toggles: a pressed button and a group of them choosing one or many values.
-
tooltip–Tooltips: a provider, a tooltip and its trigger and content.
-
tour–The guided tour: a spotlight and a card stepping over elements of the live app.
-
tree–The tree: collapsible items with leaf checkboxes.
Functions:
-
asset_url–The URL of a file under the served directory.
-
initialize–Enables the module before the first client connects.
asset_url
¶
initialize
¶
accordion
¶
The accordion: collapsible sections, one or several open at a time.
Classes:
-
Accordion–Sections opened one at a time (
type_single) or several;modelbinds the open ids to a state variable. -
AccordionItem–One section, named by
value. -
AccordionTrigger–The header that opens and closes a section.
-
AccordionContent–The body of a section.
Accordion
¶
Accordion(children: object = None, *, model: str | None = None, type_: Prop[AccordionType] = None, value: Prop[str | Sequence[str]] = None, default_value: Prop[str | Sequence[str]] = None, on_value_change: Event = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
Sections opened one at a time (type_ single) or several; model binds the open ids to a state variable.
Parameters:
-
children(object, default:None) –The accordion's sections.
-
model(str | None, default:None) –A state variable to bind the open section ids to, unless
on_value_changeis given. -
type_(Prop[AccordionType], default:None) –Whether one section opens at a time or several.
-
value(Prop[str | Sequence[str]], default:None) –The open section's id, or the open ids of a multiple accordion.
-
default_value(Prop[str | Sequence[str]], default:None) –The sections open at mount while
valueis unset. -
on_value_change(Event, default:None) –Receives the open ids after a section opens or closes.
-
disabled(Prop[bool], default:None) –Disables every section.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/accordion.py
AccordionItem
¶
AccordionItem(children: object = None, *, value: Prop[str] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
One section, named by value.
Parameters:
-
children(object, default:None) –The section's trigger and content.
-
value(Prop[str], default:None) –The section's id.
-
disabled(Prop[bool], default:None) –Disables the section.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/accordion.py
AccordionTrigger
¶
Bases: Element
The header that opens and closes a section.
Parameters:
-
children(object, default:None) –The header's text.
-
disabled(Prop[bool], default:None) –Disables the trigger.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/accordion.py
AccordionContent
¶
AccordionContent(children: object = None, *, force_mount: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The body of a section.
Parameters:
-
children(object, default:None) –The section's content.
-
force_mount(Prop[bool], default:None) –Keeps the content mounted while the section is closed.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/accordion.py
badge
¶
The badge.
Classes:
-
Badge–A small status label.
Badge
¶
Badge(children: object = None, *, variant: Prop[BadgeVariant] = None, as_child: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A small status label.
Parameters:
-
children(object, default:None) –The badge's text.
-
variant(Prop[BadgeVariant], default:None) –The badge's style.
-
as_child(Prop[bool], default:None) –Renders the child element itself, styled as the badge.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/badge.py
body_look
¶
The body look: a swatch that opens a body's visibility, opacity and color editor.
Classes:
-
BodyLook–One body's look as an 18 px swatch; its popover holds the eye and opacity on top, then the Field, Colormap and Fixed modes.
BodyLook
¶
BodyLook(*, paint: Prop[Paint] = None, colors: Prop[Sequence[str | None]] = None, shown: Prop[bool | Literal['mixed']] = None, opacity: Prop[float] = None, field_gradient: Prop[str] = None, colormap: Prop[str] = None, colormaps: Prop[Sequence[ComboboxItem]] = None, filters: Prop[Sequence[str]] = None, field_disabled: Prop[bool] = None, palette: Prop[Sequence[str]] = None, label: Prop[str] = None, disabled: Prop[bool] = None, on_shown_change: Event = None, on_opacity_change: Event = None, on_opacity_commit: Event = None, on_paint_change: Event = None, on_color_change: Event = None, on_colormap_change: Event = None, **kwargs: Unpack[Shared])
Bases: Element
One body's look as an 18 px swatch; its popover holds the eye and opacity on top, then the Field, Colormap and Fixed modes.
Parameters:
-
paint(Prop[Paint], default:None) –Where the color comes from: the field colormap, the body colormap, a fixed color, or a group's mix.
-
colors(Prop[Sequence[str | None]], default:None) –The resolved color of each body the swatch stands for, None for a body painted by the field.
-
shown(Prop[bool | Literal['mixed']], default:None) –Whether the bodies show, or
mixedfor a group that is partly hidden. -
opacity(Prop[float], default:None) –The bodies' own opacity, 0 to 1.
-
field_gradient(Prop[str], default:None) –The field colormap as a CSS gradient.
-
colormap(Prop[str], default:None) –The shared body colormap.
-
colormaps(Prop[Sequence[ComboboxItem]], default:None) –The colormaps the Colormap mode lists.
-
filters(Prop[Sequence[str]], default:None) –The group toggles that narrow the colormap list.
-
field_disabled(Prop[bool], default:None) –Disables the Field mode, for a run without fields.
-
palette(Prop[Sequence[str]], default:None) –The fixed colors offered one click away.
-
label(Prop[str], default:None) –The name the controls are announced with.
-
disabled(Prop[bool], default:None) –Disables the swatch.
-
on_shown_change(Event, default:None) –Receives the new visibility.
-
on_opacity_change(Event, default:None) –Receives the opacity as the thumb moves.
-
on_opacity_commit(Event, default:None) –Receives the opacity when the thumb is released.
-
on_paint_change(Event, default:None) –Receives the chosen mode.
-
on_color_change(Event, default:None) –Receives a picked fixed color.
-
on_colormap_change(Event, default:None) –Receives a picked body colormap.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/body_look.py
busy
¶
The busy indicator of an area whose content the server is working on.
Classes:
-
Busy–A line along the top edge of its parent and a spinner on the control that started the work, shown only while
activeoutlasts the busy delay.
Busy
¶
Bases: Element
A line along the top edge of its parent and a spinner on the control that started the work, shown only while active outlasts the busy delay.
Parameters:
-
active(Prop[bool], default:None) –Whether the server is working on the parent's content.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/busy.py
button
¶
Buttons: the shadcn button and button group.
Classes:
-
Button–A button whose children are its label or icon.
-
ButtonGroup–Buttons joined into one row or column.
-
ButtonGroupSeparator–A separator between grouped buttons.
-
ButtonGroupText–Text set beside grouped buttons.
Button
¶
Button(children: object = None, *, variant: Prop[ButtonVariant] = None, size: Prop[ButtonSize] = None, disabled: Prop[bool] = None, type_: Prop[ButtonType] = None, as_child: Prop[bool] = None, aria_label: Prop[str] = None, aria_disabled: Prop[bool] = None, aria_pressed: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A button whose children are its label or icon.
Parameters:
-
children(object, default:None) –The button's label or icon.
-
variant(Prop[ButtonVariant], default:None) –The button's style.
-
size(Prop[ButtonSize], default:None) –The button's size; the icon sizes make it square.
-
disabled(Prop[bool], default:None) –Disables the button.
-
type_(Prop[ButtonType], default:None) –The HTML button type.
-
as_child(Prop[bool], default:None) –Renders the child element itself, styled as the button.
-
aria_label(Prop[str], default:None) –The accessible name, needed when the button shows only an icon.
-
aria_disabled(Prop[bool], default:None) –Marks the button unavailable while it stays hoverable and focusable, so its tooltip can say why.
-
aria_pressed(Prop[bool], default:None) –The on state of a toggle button.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/button.py
ButtonGroup
¶
ButtonGroup(children: object = None, *, orientation: Prop[Orientation] = None, **kwargs: Unpack[Shared])
Bases: Element
Buttons joined into one row or column.
Parameters:
-
children(object, default:None) –The grouped buttons.
-
orientation(Prop[Orientation], default:None) –Whether the buttons join in a row or a column.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/button.py
ButtonGroupSeparator
¶
ButtonGroupSeparator(*, orientation: Prop[Orientation] = None, decorative: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A separator between grouped buttons.
Parameters:
-
orientation(Prop[Orientation], default:None) –The direction the separator runs.
-
decorative(Prop[bool], default:None) –Hides the separator from assistive technology.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/button.py
card
¶
Cards: a bordered box with header, content and footer.
Classes:
-
Card–A bordered box.
-
CardHeader–The title row of a card.
-
CardTitle–A card's title.
-
CardDescription–A card's description.
-
CardAction–A control set in the header's corner.
-
CardContent–A card's body.
-
CardFooter–A card's action row.
Card
¶
CardHeader
¶
Bases: Element
The title row of a card.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/card.py
CardTitle
¶
Bases: Element
A card's title.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/card.py
CardDescription
¶
Bases: Element
A card's description.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/card.py
CardAction
¶
Bases: Element
A control set in the header's corner.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/card.py
CardContent
¶
Bases: Element
A card's body.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/card.py
checkbox
¶
The checkbox.
Classes:
-
Checkbox–A checkbox;
modelbinds its checked state to a state variable.
Checkbox
¶
Checkbox(*, model: str | None = None, checked: Prop[bool] = None, default_checked: Prop[bool] = None, on_checked_change: Event = None, disabled: Prop[bool] = None, required: Prop[bool] = None, name: Prop[str] = None, value: Prop[str] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A checkbox; model binds its checked state to a state variable.
Parameters:
-
model(str | None, default:None) –A state variable to bind the checked state to, unless
on_checked_changeis given. -
checked(Prop[bool], default:None) –Whether the box is checked.
-
default_checked(Prop[bool], default:None) –Whether the box is checked at mount while
checkedis unset. -
on_checked_change(Event, default:None) –Receives the new checked state.
-
disabled(Prop[bool], default:None) –Disables the checkbox.
-
required(Prop[bool], default:None) –Marks the checkbox as required in a form.
-
name(Prop[str], default:None) –The form field name.
-
value(Prop[str], default:None) –The value a form submits while the box is checked.
-
aria_label(Prop[str], default:None) –The accessible name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/checkbox.py
code
¶
The code editor: Monaco over a text value.
Classes:
-
Code–An editor over
valueinlanguage;on_change(shared) carries the edited text.
Code
¶
Code(*, value: Prop[str] = None, language: Prop[str] = None, theme: Prop[str] = None, options: Prop[Mapping[str, object]] = None, **kwargs: Unpack[Shared])
Bases: Element
An editor over value in language; on_change (shared) carries the edited text.
Parameters:
-
value(Prop[str], default:None) –The text to edit.
-
language(Prop[str], default:None) –The Monaco language that highlights the text.
-
theme(Prop[str], default:None) –The Monaco theme.
-
options(Prop[Mapping[str, object]], default:None) –Monaco editor options.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/code.py
combobox
¶
The combobox: a searchable single choice narrowed by group toggles.
Classes:
-
ComboboxItem–One option: its value, label, the groups it belongs to and an optional CSS background swatch.
-
Combobox–A searchable select whose
filterstoggle its groups on and off and whose arrow keys apply as they step;modelbinds its value to a state variable.
ComboboxItem
¶
Bases: TypedDict
One option: its value, label, the groups it belongs to and an optional CSS background swatch.
Combobox
¶
Combobox(*, model: str | None = None, items: Prop[Sequence[ComboboxItem]] = None, value: Prop[str] = None, on_value_change: Event = None, filters: Prop[Sequence[str]] = None, placeholder: Prop[str] = None, search_placeholder: Prop[str] = None, empty_text: Prop[str] = None, disabled: Prop[bool] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A searchable select whose filters toggle its groups on and off and whose arrow keys apply as they step; model binds its value to a state variable.
Parameters:
-
model(str | None, default:None) –A state variable to bind the value to, unless
on_value_changeis given. -
items(Prop[Sequence[ComboboxItem]], default:None) –The options.
-
value(Prop[str], default:None) –The chosen option's value.
-
on_value_change(Event, default:None) –Receives the chosen value.
-
filters(Prop[Sequence[str]], default:None) –The group toggles that narrow the items.
-
placeholder(Prop[str], default:None) –The trigger's text while nothing is chosen.
-
search_placeholder(Prop[str], default:None) –The search field's placeholder.
-
empty_text(Prop[str], default:None) –The text shown when no option matches the search.
-
disabled(Prop[bool], default:None) –Disables the combobox.
-
aria_label(Prop[str], default:None) –The accessible name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/combobox.py
context_menu
¶
Context menus: a Radix menu a right click opens over its trigger, and its items.
Classes:
-
ContextMenu–A menu a right click on its trigger opens at the pointer.
-
ContextMenuTrigger–The area a right click opens the menu over;
as_childmakes the child element itself that area. -
ContextMenuContent–The floating list of items.
-
ContextMenuItem–One item;
on_selectfires when it is chosen. -
ContextMenuCheckboxItem–An item with a check mark.
-
ContextMenuSeparator–A rule between items.
ContextMenu
¶
ContextMenu(children: object = None, *, on_open_change: Event = None, modal: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A menu a right click on its trigger opens at the pointer.
Parameters:
-
children(object, default:None) –The menu's trigger and content.
-
on_open_change(Event, default:None) –Receives the new open state.
-
modal(Prop[bool], default:None) –Blocks the page outside the menu while it is open.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/context_menu.py
ContextMenuTrigger
¶
ContextMenuTrigger(children: object = None, *, as_child: Prop[bool] = None, disabled: Prop[bool] = None, drag_tolerance: Prop[float] = None, **kwargs: Unpack[Shared])
Bases: Element
The area a right click opens the menu over; as_child makes the child element itself that area.
Parameters:
-
children(object, default:None) –The area's content.
-
as_child(Prop[bool], default:None) –Makes the child element itself the area.
-
disabled(Prop[bool], default:None) –Leaves the browser's own menu to a right click.
-
drag_tolerance(Prop[float], default:None) –How far, in pixels, a right press may move and still open the menu; None opens it after any drag.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/context_menu.py
ContextMenuContent
¶
Bases: Element
The floating list of items.
Parameters:
-
children(object, default:None) –The menu's items.
-
loop(Prop[bool], default:None) –Whether keyboard navigation wraps from the last item to the first.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/context_menu.py
ContextMenuItem
¶
ContextMenuItem(children: object = None, *, on_select: Event = None, disabled: Prop[bool] = None, inset: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
One item; on_select fires when it is chosen.
Parameters:
-
children(object, default:None) –The item's label.
-
on_select(Event, default:None) –Fires when the item is chosen.
-
disabled(Prop[bool], default:None) –Disables the item.
-
inset(Prop[bool], default:None) –Indents the item to line up with a checkbox item's label.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/context_menu.py
ContextMenuCheckboxItem
¶
ContextMenuCheckboxItem(children: object = None, *, checked: Prop[bool] = None, on_checked_change: Event = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
An item with a check mark.
Parameters:
-
children(object, default:None) –The item's label.
-
checked(Prop[bool], default:None) –Whether the item is checked.
-
on_checked_change(Event, default:None) –Receives the new checked state.
-
disabled(Prop[bool], default:None) –Disables the item.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/context_menu.py
ContextMenuSeparator
¶
dialog
¶
Dialogs: a modal and its trigger, content, header, footer and close.
Classes:
-
Dialog–A dialog opened by its trigger or the
open_prop. -
DialogTrigger–The control opening the dialog;
as_childrenders the child element itself. -
DialogContent–The dialog's box.
-
DialogHeader–The title and description block.
-
DialogFooter–The action row.
-
DialogTitle–The dialog's title.
-
DialogDescription–The dialog's description.
-
DialogClose–A control closing the dialog.
Dialog
¶
Dialog(children: object = None, *, open_: Prop[bool] = None, default_open: Prop[bool] = None, on_open_change: Event = None, modal: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A dialog opened by its trigger or the open_ prop.
Parameters:
-
children(object, default:None) –The dialog's trigger and content.
-
open_(Prop[bool], default:None) –Whether the dialog is open.
-
default_open(Prop[bool], default:None) –Whether the dialog opens at mount while
open_is unset. -
on_open_change(Event, default:None) –Receives the new open state, as when Escape or the backdrop closes the dialog.
-
modal(Prop[bool], default:None) –Blocks the page behind the dialog while it is open.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogTrigger
¶
DialogTrigger(children: object = None, *, as_child: Prop[bool] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The control opening the dialog; as_child renders the child element itself.
Parameters:
-
children(object, default:None) –The trigger's content.
-
as_child(Prop[bool], default:None) –Renders the child element itself as the trigger.
-
disabled(Prop[bool], default:None) –Disables the trigger.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogContent
¶
DialogContent(children: object = None, *, show_close_button: Prop[bool] = None, force_mount: Prop[bool] = None, scrim: Prop[bool] = None, persistent: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The dialog's box.
Parameters:
-
children(object, default:None) –The dialog's header, body and footer.
-
show_close_button(Prop[bool], default:None) –Shows the close button in the corner.
-
force_mount(Prop[bool], default:None) –Keeps the content mounted while the dialog is closed.
-
scrim(Prop[bool], default:None) –Dims the page behind; a dialog whose changes show in the page leaves it clear.
-
persistent(Prop[bool], default:None) –Stays open through clicks and focus outside it, and through Escape pressed outside it.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogHeader
¶
Bases: Element
The title and description block.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogFooter
¶
DialogFooter(children: object = None, *, show_close_button: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The action row.
Parameters:
-
children(object, default:None) –The dialog's actions.
-
show_close_button(Prop[bool], default:None) –Adds a Close button to the row.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogTitle
¶
Bases: Element
The dialog's title.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogDescription
¶
Bases: Element
The dialog's description.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
DialogClose
¶
Bases: Element
A control closing the dialog.
Parameters:
-
children(object, default:None) –The control's content.
-
as_child(Prop[bool], default:None) –Renders the child element itself as the close control.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dialog.py
dist_hash
¶
The source hash a built client dist records in version.json, shared by the build hook and the startup check.
Functions:
-
source_hash–The hash version.json must carry for the package at
root: sha256 over the sorted (posix path, LF bytes) of every input, first 16 hex characters.
source_hash
¶
The hash version.json must carry for the package at root: sha256 over the sorted (posix path, LF bytes) of every input, first 16 hex characters.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dist_hash.py
dock
¶
The dock: a dockview host rendering one server template per panel.
Classes:
-
Dock–Hosts panels whose bodies are the server templates
render_panelnames; the panel methods reach the mounted dock through its ref.
Dock
¶
Dock(*, render_panel: Slot | None = None, popout_url: Prop[str] = None, floating_group_bounds: Prop[FloatingGroupBounds] = None, on_ready: Event = None, on_layout_change: Event = None, on_visibility: Event = None, on_active_panel: Event = None, on_panel_removed: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Hosts panels whose bodies are the server templates render_panel names; the panel methods reach the mounted dock through its ref.
Parameters:
-
render_panel(Slot | None, default:None) –The slot rendering a panel's body from its params.
-
popout_url(Prop[str], default:None) –The page a popped-out group opens in.
-
floating_group_bounds(Prop[FloatingGroupBounds], default:None) –Where a floating group may move: wholly within the viewport, or keeping the given minimum width and height in view.
-
on_ready(Event, default:None) –Fires once the dock is mounted and can take panels.
-
on_layout_change(Event, default:None) –Receives the serialized layout once a burst of changes settles.
-
on_visibility(Event, default:None) –Receives a panel's id and whether it became visible.
-
on_active_panel(Event, default:None) –Receives the id of the panel that became active.
-
on_panel_removed(Event, default:None) –Receives the id of the panel the user closed.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Methods:
-
add_panel–Adds a panel showing a template; an id already present is left alone.
-
remove_panel–Removes the panel from the dock.
-
active_panel–Activates the panel's tab.
-
restore_layout–Replaces the arrangement with a serialized dockview layout.
-
move_to–Moves a panel into the group of another.
-
set_panel_title–Renames the panel's tab.
-
maximize–Maximizes the panel's group.
-
restore_maximized–Returns the maximized group to its place.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dock.py
add_panel
¶
Adds a panel showing a template; an id already present is left alone.
Parameters:
-
panel_id(str) –The new panel's id.
-
title(str) –The tab title.
-
template_name(str) –The server template the panel's body renders.
-
add_on(object, default:{}) –dockview's placement options, such as
position,inactiveand the initial size.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dock.py
restore_layout
¶
Replaces the arrangement with a serialized dockview layout.
move_to
¶
set_panel_title
¶
drawer
¶
A bar at the bottom of its parent with a body that slides up under it.
Classes:
-
Drawer–Pins its first child, the bar, to the bottom of its parent and slides the rest up under it while
open_holds, so the bar heads the open drawer.
Drawer
¶
Bases: Element
Pins its first child, the bar, to the bottom of its parent and slides the rest up under it while open_ holds, so the bar heads the open drawer.
Parameters:
-
children(object, default:None) –The bar, then the body.
-
open_(Prop[bool], default:None) –Whether the body is open.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/drawer.py
dropdown_menu
¶
Dropdown menus: a Radix menu and its trigger, content, items and groups.
Classes:
-
DropdownMenu–A menu opened by its trigger.
-
DropdownMenuTrigger–The control opening the menu;
as_childrenders the child element itself. -
DropdownMenuContent–The floating list of items.
-
DropdownMenuItem–One item;
on_selectfires when it is chosen. -
DropdownMenuCheckboxItem–An item with a check mark.
-
DropdownMenuRadioGroup–Radio items choosing one value.
-
DropdownMenuRadioItem–One radio item.
-
DropdownMenuLabel–A heading inside the menu.
-
DropdownMenuSeparator–A rule between items.
-
DropdownMenuShortcut–The key hint at an item's end.
-
DropdownMenuGroup–Items under one label.
-
DropdownMenuSub–A nested menu.
-
DropdownMenuSubTrigger–The item opening a nested menu.
-
DropdownMenuSubContent–The nested menu's list.
DropdownMenu
¶
DropdownMenu(children: object = None, *, open_: Prop[bool] = None, default_open: Prop[bool] = None, on_open_change: Event = None, modal: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A menu opened by its trigger.
Parameters:
-
children(object, default:None) –The menu's trigger and content.
-
open_(Prop[bool], default:None) –Whether the menu is open.
-
default_open(Prop[bool], default:None) –Whether the menu opens at mount while
open_is unset. -
on_open_change(Event, default:None) –Receives the new open state.
-
modal(Prop[bool], default:None) –Blocks the page outside the menu while it is open.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuTrigger
¶
DropdownMenuTrigger(children: object = None, *, as_child: Prop[bool] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The control opening the menu; as_child renders the child element itself.
Parameters:
-
children(object, default:None) –The trigger's content.
-
as_child(Prop[bool], default:None) –Renders the child element itself as the trigger.
-
disabled(Prop[bool], default:None) –Disables the trigger.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuContent
¶
DropdownMenuContent(children: object = None, *, side: Prop[Side] = None, align: Prop[Align] = None, side_offset: Prop[float] = None, align_offset: Prop[float] = None, loop: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The floating list of items.
Parameters:
-
children(object, default:None) –The menu's items.
-
side(Prop[Side], default:None) –The side of the trigger the list opens on.
-
align(Prop[Align], default:None) –How the list aligns against the trigger.
-
side_offset(Prop[float], default:None) –The gap between the trigger and the list, in pixels.
-
align_offset(Prop[float], default:None) –The shift along the aligned edge, in pixels.
-
loop(Prop[bool], default:None) –Whether keyboard navigation wraps from the last item to the first.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuItem
¶
DropdownMenuItem(children: object = None, *, on_select: Event = None, disabled: Prop[bool] = None, inset: Prop[bool] = None, variant: Prop[MenuItemVariant] = None, text_value: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
One item; on_select fires when it is chosen.
Parameters:
-
children(object, default:None) –The item's label.
-
on_select(Event, default:None) –Fires when the item is chosen.
-
disabled(Prop[bool], default:None) –Disables the item.
-
inset(Prop[bool], default:None) –Indents the item to line up with items that carry an icon.
-
variant(Prop[MenuItemVariant], default:None) –The item's style.
-
text_value(Prop[str], default:None) –The text typeahead matches, for a label that is not plain text.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuCheckboxItem
¶
DropdownMenuCheckboxItem(children: object = None, *, checked: Prop[bool] = None, on_checked_change: Event = None, on_select: Event = None, disabled: Prop[bool] = None, text_value: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
An item with a check mark.
Parameters:
-
children(object, default:None) –The item's label.
-
checked(Prop[bool], default:None) –Whether the item is checked.
-
on_checked_change(Event, default:None) –Receives the new checked state.
-
on_select(Event, default:None) –Fires when the item is chosen.
-
disabled(Prop[bool], default:None) –Disables the item.
-
text_value(Prop[str], default:None) –The text typeahead matches, for a label that is not plain text.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuRadioGroup
¶
DropdownMenuRadioGroup(children: object = None, *, value: Prop[str] = None, on_value_change: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Radio items choosing one value.
Parameters:
-
children(object, default:None) –The radio items.
-
value(Prop[str], default:None) –The chosen item's value.
-
on_value_change(Event, default:None) –Receives the chosen value.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuRadioItem
¶
DropdownMenuRadioItem(children: object = None, *, value: Prop[str] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
One radio item.
Parameters:
-
children(object, default:None) –The item's label.
-
value(Prop[str], default:None) –The value the item chooses.
-
disabled(Prop[bool], default:None) –Disables the item.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuLabel
¶
Bases: Element
A heading inside the menu.
Parameters:
-
children(object, default:None) –The heading's text.
-
inset(Prop[bool], default:None) –Indents the heading to line up with items that carry an icon.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuSeparator
¶
DropdownMenuShortcut
¶
Bases: Element
The key hint at an item's end.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuGroup
¶
Bases: Element
Items under one label.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuSub
¶
DropdownMenuSub(children: object = None, *, open_: Prop[bool] = None, default_open: Prop[bool] = None, on_open_change: Event = None, **kwargs: Unpack[Shared])
Bases: Element
A nested menu.
Parameters:
-
children(object, default:None) –The nested menu's trigger and content.
-
open_(Prop[bool], default:None) –Whether the nested menu is open.
-
default_open(Prop[bool], default:None) –Whether the nested menu opens at mount while
open_is unset. -
on_open_change(Event, default:None) –Receives the new open state.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
DropdownMenuSubTrigger
¶
DropdownMenuSubTrigger(children: object = None, *, inset: Prop[bool] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The item opening a nested menu.
Parameters:
-
children(object, default:None) –The item's label.
-
inset(Prop[bool], default:None) –Indents the item to line up with items that carry an icon.
-
disabled(Prop[bool], default:None) –Disables the item.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/dropdown_menu.py
element
¶
The Element base: a wrapper's declared parameters become React props by name, those named on_* events.
Type Aliases:
Classes:
-
Shared–The trame-shared props and events a wrapper accepts beside its own.
-
Element–A component of the Ff library: its wrapper's parameters are its props and events, trame's shared names pass through.
Functions:
-
react_name–The React prop of a parameter: one trailing underscore stripped, then the rename map, else camelCase.
-
is_event–Whether a parameter is an event handler: its name starts with
on_. -
next_ref–A name for trame.refs, unique for the process.
-
setter–A client-side handler writing the event payload into the state variable.
Attributes:
-
RESERVED–Names of a wrapper's locals that are never props.
-
MODEL–The Python-only parameter of the control wrappers: the state variable the control binds and writes client-side.
-
RENAMES(Mapping[str, str]) –Parameters whose React prop is not their camelCase.
-
SHARED–The props and events trame registers on every React element.
RESERVED
module-attribute
¶
RESERVED = frozenset({'self', 'children', 'kwargs', '__class__'})
Names of a wrapper's locals that are never props.
MODEL
module-attribute
¶
The Python-only parameter of the control wrappers: the state variable the control binds and writes client-side.
RENAMES
module-attribute
¶
RENAMES: Mapping[str, str] = {'aria_label': 'aria-label', 'aria_disabled': 'aria-disabled', 'aria_pressed': 'aria-pressed'}
Parameters whose React prop is not their camelCase.
SHARED
module-attribute
¶
SHARED = frozenset(name if isinstance(name, str) else name[0] for name in (*SHARED_PROPS, *SHARED_EVENTS))
The props and events trame registers on every React element.
Element
¶
Element(tag: str, params: Mapping[str, object], children: object = None, *, rename: Mapping[str, str] = RENAMES, **kwargs: Unpack[Shared])
Bases: AbstractElement
A component of the Ff library: its wrapper's parameters are its props and events, trame's shared names pass through.
Parameters:
-
tag(str) –The element's custom tag, such as
ff-button. -
params(Mapping[str, object]) –The wrapper's locals; each declared parameter becomes a prop, or an event when named
on_*. -
children(object, default:None) –The content nested inside the element.
-
rename(Mapping[str, str], default:RENAMES) –Parameters whose React prop is not their camelCase.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, passed through as they are.
Methods:
-
call–Calls a method of the mounted component through its ref.
Attributes:
-
reference(str) –The name the client registers this element under on trame.refs; KeyError when it has none.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/element.py
react_name
¶
The React prop of a parameter: one trailing underscore stripped, then the rename map, else camelCase.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/element.py
is_event
¶
Whether a parameter is an event handler: its name starts with on_.
next_ref
¶
setter
¶
A client-side handler writing the event payload into the state variable.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/element.py
entity_grid
¶
The entity grid: rows of bodies or boundaries with their conditions as read-only editors, one tab stop with roving focus.
Classes:
-
LinePart–One run of text in a condition line.
-
ConditionLine–One condition a row received, as the parts it reads in.
-
BodyChip–A body a boundary touches, by its name and its body color.
-
EntityRow–One body or boundary group: its kind icon, its name or the bodies it touches, its material and measure, and its conditions as cards.
-
EntityGrid–Rows of bodies or boundaries as one grid: the arrows move the focus, Enter selects, F frames, S shows a hidden body and Escape clears.
ConditionLine
¶
EntityRow
¶
Bases: TypedDict
One body or boundary group: its kind icon, its name or the bodies it touches, its material and measure, and its conditions as cards.
Attributes:
-
id(str) –The entity id, such as
boundary:RIGHTFACE. -
name(str) –The name as authored, such as
RightFace. -
detail(str) –The measure of a body or a boundary.
-
detail_tip(str) –The detail's tooltip, such as the face area a 2D length stands for.
-
material(str) –A body's material, shown as a read-only field.
-
material_tip(str) –The material's full name.
-
tip(list[str]) –The name's tooltip lines, the Elmer name first.
-
kind_icon(IconName) –The icon of the group's kind: a body, a face or an edge.
-
chips(list[BodyChip]) –The bodies an unnamed boundary touches, which name it.
-
cards(list[ConditionCard]) –One read-only editor per condition the group received.
-
group(bool) –Whether the row heads the bodies of one material.
-
member(bool) –Whether the row is a body under a material group.
-
dimmed(bool) –Whether the row has no cells to highlight.
-
dim_tip(str) –Why a dimmed row cannot be highlighted.
-
hidden(bool) –Whether the body is hidden in the Field Viewer, which the row offers to show.
-
label(str) –The row's accessible name: its name, its conditions with their tooltips and why it is dimmed or hidden.
detail_tip
instance-attribute
¶
detail_tip: str
The detail's tooltip, such as the face area a 2D length stands for.
kind_icon
instance-attribute
¶
kind_icon: IconName
The icon of the group's kind: a body, a face or an edge.
chips
instance-attribute
¶
The bodies an unnamed boundary touches, which name it.
cards
instance-attribute
¶
cards: list[ConditionCard]
One read-only editor per condition the group received.
EntityGrid
¶
EntityGrid(*, rows: Prop[Sequence[EntityRow]] = None, selected: Prop[str] = None, label: Prop[str] = None, columns: Prop[Sequence[str]] = None, on_select: Event = None, on_frame: Event = None, on_show: Event = None, on_hover: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Rows of bodies or boundaries as one grid: the arrows move the focus, Enter selects, F frames, S shows a hidden body and Escape clears.
Parameters:
-
rows(Prop[Sequence[EntityRow]], default:None) –The rows, in order.
-
selected(Prop[str], default:None) –The id of the selected row.
-
label(Prop[str], default:None) –The grid's accessible name.
-
columns(Prop[Sequence[str]], default:None) –The header of each column: the name and the detail.
-
on_select(Event, default:None) –Receives the id of a row clicked or chosen with Enter, or an empty id for Escape.
-
on_frame(Event, default:None) –Receives the id of a row double-clicked or framed with F.
-
on_show(Event, default:None) –Receives the id of a hidden body whose Show was clicked or pressed with S.
-
on_hover(Event, default:None) –Receives the id of the row the pointer or the keyboard focus moved onto, and an empty id once both left the grid.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/entity_grid.py
field
¶
Fields: a labelled control with its description and error.
Classes:
-
Field–A control with its label, laid out along
orientation. -
FieldLabel–The label of a field.
-
FieldContent–The column holding a field's control and description.
-
FieldDescription–Help text under a field.
-
FieldError–The error text of a field, or the
errorsit lists. -
FieldGroup–A stack of fields.
-
FieldSet–A fieldset of related fields.
-
FieldLegend–The legend of a fieldset.
-
FieldSeparator–A rule between fields, with optional text.
-
FieldTitle–A title styled like a label without being one.
Field
¶
Field(children: object = None, *, orientation: Prop[FieldOrientation] = None, **kwargs: Unpack[Shared])
Bases: Element
A control with its label, laid out along orientation.
Parameters:
-
children(object, default:None) –The field's label and control.
-
orientation(Prop[FieldOrientation], default:None) –The direction the label and the control lay out along.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldLabel
¶
Bases: Element
The label of a field.
Parameters:
-
children(object, default:None) –The label's text.
-
html_for(Prop[str], default:None) –The id of the control the label names.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldContent
¶
Bases: Element
The column holding a field's control and description.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldDescription
¶
Bases: Element
Help text under a field.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldError
¶
FieldError(children: object = None, *, errors: Prop[list[dict[str, str]]] = None, **kwargs: Unpack[Shared])
Bases: Element
The error text of a field, or the errors it lists.
Parameters:
-
children(object, default:None) –The error's text.
-
errors(Prop[list[dict[str, str]]], default:None) –Errors listed by their
messagewhen no children are given. -
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldGroup
¶
Bases: Element
A stack of fields.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldSet
¶
FieldSet(children: object = None, *, disabled: Prop[bool] = None, name: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A fieldset of related fields.
Parameters:
-
children(object, default:None) –The fieldset's legend and fields.
-
disabled(Prop[bool], default:None) –Disables every control in the fieldset.
-
name(Prop[str], default:None) –The fieldset's form name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldLegend
¶
FieldLegend(children: object = None, *, variant: Prop[FieldLegendVariant] = None, **kwargs: Unpack[Shared])
Bases: Element
The legend of a fieldset.
Parameters:
-
children(object, default:None) –The legend's text.
-
variant(Prop[FieldLegendVariant], default:None) –Whether the legend reads as a legend or as a label.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
FieldSeparator
¶
Bases: Element
A rule between fields, with optional text.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/field.py
fields
¶
Read-only fields: an authored value shown in the control that would edit it.
Classes:
-
FieldView–One labelled read-only field.
-
ConditionCard–One condition as the read-only editor its authoring form would be.
-
Fields–Labelled read-only fields in two aligned columns.
FieldView
¶
Bases: TypedDict
One labelled read-only field.
Attributes:
-
label(str) –The field's label.
-
kind(FieldKind) –How the value shows: a number with its unit, one cell per component, plain text, or a select's choice.
-
value(NotRequired[str]) –The value of a quantity, text or choice field.
-
values(NotRequired[list[str | None]]) –Each component of a vector field; None for a free one.
-
axes(NotRequired[list[str]]) –The label of each component of a vector field.
-
unit(NotRequired[str]) –The unit after the value or the last component.
-
dropped(NotRequired[list[int]]) –The components of a vector the solve frame drops, shown muted.
-
tip(NotRequired[str]) –What the screen does not show about the field, such as why a component is muted.
kind
instance-attribute
¶
How the value shows: a number with its unit, one cell per component, plain text, or a select's choice.
values
instance-attribute
¶
values: NotRequired[list[str | None]]
Each component of a vector field; None for a free one.
axes
instance-attribute
¶
axes: NotRequired[list[str]]
The label of each component of a vector field.
dropped
instance-attribute
¶
dropped: NotRequired[list[int]]
The components of a vector the solve frame drops, shown muted.
tip
instance-attribute
¶
tip: NotRequired[str]
What the screen does not show about the field, such as why a component is muted.
ConditionCard
¶
Bases: TypedDict
One condition as the read-only editor its authoring form would be.
Attributes:
-
title(str) –The condition type, such as
Surface Force. -
icon(NotRequired[IconName]) –The condition's glyph icon; absent for a condition the scene draws no glyph for.
-
fields(list[FieldView]) –The condition's fields in authoring order.
icon
instance-attribute
¶
icon: NotRequired[IconName]
The condition's glyph icon; absent for a condition the scene draws no glyph for.
Fields
¶
Bases: Element
Labelled read-only fields in two aligned columns.
Parameters:
-
fields(Prop[Sequence[FieldView]], default:None) –The fields in order.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/fields.py
icon
¶
The icon: one of the curated lucide names.
Type Aliases:
-
IconName–The names in the dist's icons.json.
Classes:
-
Icon–A lucide icon; an unknown name draws circle-help with a console warning.
IconName
¶
IconName = Literal['anchor', 'app-window', 'arrow-big-right-dash', 'arrow-down-to-line', 'arrow-left-to-line', 'arrow-right-to-line', 'arrow-up-right', 'arrow-up-to-line', 'axis-3d', 'box', 'camera', 'check', 'chevron-down', 'chevron-up', 'chevron-right', 'circle-dashed', 'circle-dot', 'circle-help', 'circle-x', 'columns-3', 'copy', 'copy-check', 'external-link', 'eye', 'eye-off', 'file', 'filter', 'flame', 'folder', 'git-commit-horizontal', 'grip-vertical', 'info', 'layout-grid', 'loader-circle', 'magnet', 'maximize-2', 'minimize-2', 'minus', 'pentagon', 'picture-in-picture-2', 'play', 'plus', 'refresh-cw', 'scaling', 'scan', 'search', 'settings', 'sliders-horizontal', 'terminal', 'trash-2', 'triangle-alert', 'view-2d', 'view-back', 'view-front', 'x', 'zap']
The names in the dist's icons.json.
Icon
¶
Icon(name: IconName | Bind, *, size: Prop[float] = None, color: Prop[str] = None, stroke_width: Prop[float] = None, **kwargs: Unpack[Shared])
Bases: Element
A lucide icon; an unknown name draws circle-help with a console warning.
Parameters:
-
name(IconName | Bind) –The lucide icon's name, or a binding to one.
-
size(Prop[float], default:None) –The icon's width and height, in pixels.
-
color(Prop[str], default:None) –The stroke colour; the text colour by default.
-
stroke_width(Prop[float], default:None) –The stroke width, in pixels.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/icon.py
input
¶
Text inputs: uncontrolled, committing to the state on blur and Enter, named after the state key they bind.
Classes:
-
Input–A text input seeded from
modeland writing it back on blur and Enter; a controlled value would drop keystrokes on the round trip. -
Textarea–A multi-line input seeded from
modeland writing it back on blur. -
InputGroup–An input with addons on its sides.
-
InputGroupAddon–An addon of an input group, aligned to one side.
-
InputGroupText–Text inside an input group addon.
-
InputGroupInput–The input of an input group, with the same commit rule as Input.
-
ColorInput–A native color picker writing its hex value to
modelon every change; controlled, since a pick sends whole values, not keystrokes.
Functions:
-
committing–A key handler writing the input text into the state variable on Enter.
Input
¶
Input(*, model: str | None = None, default_value: Prop[str] = None, value: Prop[str] = None, placeholder: Prop[str] = None, type_: Prop[str] = None, name: str | None = None, disabled: Prop[bool] = None, read_only: Prop[bool] = None, min_: Prop[float] = None, max_: Prop[float] = None, step: Prop[float] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A text input seeded from model and writing it back on blur and Enter; a controlled value would drop keystrokes on the round trip.
Parameters:
-
model(str | None, default:None) –A state variable that seeds the text and takes it back on blur and Enter; it also names the input.
-
default_value(Prop[str], default:None) –The text at mount.
-
value(Prop[str], default:None) –The text as a controlled value, for a read-only readout that follows its state.
-
placeholder(Prop[str], default:None) –The text shown while the input is empty.
-
type_(Prop[str], default:None) –The HTML input type.
-
name(str | None, default:None) –The form field name;
modelby default. -
disabled(Prop[bool], default:None) –Disables the input.
-
read_only(Prop[bool], default:None) –Makes the text read-only.
-
min_(Prop[float], default:None) –The smallest value of a number input.
-
max_(Prop[float], default:None) –The largest value of a number input.
-
step(Prop[float], default:None) –The step of a number input.
-
aria_label(Prop[str], default:None) –The accessible name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
Textarea
¶
Textarea(*, model: str | None = None, default_value: Prop[str] = None, placeholder: Prop[str] = None, rows: Prop[int] = None, name: str | None = None, disabled: Prop[bool] = None, read_only: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A multi-line input seeded from model and writing it back on blur.
Parameters:
-
model(str | None, default:None) –A state variable that seeds the text and takes it back on blur; it also names the textarea.
-
default_value(Prop[str], default:None) –The text at mount.
-
placeholder(Prop[str], default:None) –The text shown while the textarea is empty.
-
rows(Prop[int], default:None) –The visible line count.
-
name(str | None, default:None) –The form field name;
modelby default. -
disabled(Prop[bool], default:None) –Disables the textarea.
-
read_only(Prop[bool], default:None) –Makes the text read-only.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
InputGroup
¶
Bases: Element
An input with addons on its sides.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
InputGroupAddon
¶
InputGroupAddon(children: object = None, *, align: Prop[AddonAlign] = None, **kwargs: Unpack[Shared])
Bases: Element
An addon of an input group, aligned to one side.
Parameters:
-
children(object, default:None) –The addon's text, icon or button.
-
align(Prop[AddonAlign], default:None) –The side of the input the addon sits on.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
InputGroupText
¶
Bases: Element
Text inside an input group addon.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
InputGroupInput
¶
InputGroupInput(*, model: str | None = None, default_value: Prop[str] = None, placeholder: Prop[str] = None, type_: Prop[str] = None, name: str | None = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The input of an input group, with the same commit rule as Input.
Parameters:
-
model(str | None, default:None) –A state variable that seeds the text and takes it back on blur and Enter; it also names the input.
-
default_value(Prop[str], default:None) –The text at mount.
-
placeholder(Prop[str], default:None) –The text shown while the input is empty.
-
type_(Prop[str], default:None) –The HTML input type.
-
name(str | None, default:None) –The form field name;
modelby default. -
disabled(Prop[bool], default:None) –Disables the input.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
ColorInput
¶
ColorInput(*, model: str | None = None, value: Prop[str] = None, disabled: Prop[bool] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A native color picker writing its hex value to model on every change; controlled, since a pick sends whole values, not keystrokes.
Parameters:
-
model(str | None, default:None) –A state variable bound to the colour and written on every change.
-
value(Prop[str], default:None) –The colour as
#rrggbb. -
disabled(Prop[bool], default:None) –Disables the picker.
-
aria_label(Prop[str], default:None) –The accessible name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/input.py
label
¶
The label.
Classes:
-
Label–A label for the control
html_fornames.
Label
¶
Bases: Element
A label for the control html_for names.
Parameters:
-
children(object, default:None) –The label's text.
-
html_for(Prop[str], default:None) –The id of the control the label names.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/label.py
module
¶
The Ff client module: the built dist under serve/, its trame descriptor and the URLs of its files.
Classes:
-
VersionKey–The fields of version.json.
Functions:
-
version–The dist's version.json: the source hash and the bundle and stylesheet names.
-
stale–The built and the source hash when a source checkout's dist is older than its sources; None for a current dist or a wheel.
-
asset_url–The URL of a file under the served directory.
-
served–The route-relative URL of a built file with the source hash as its cache buster.
-
assets–The absolute URLs of the bundle and the stylesheet as the page loads them.
-
descriptor–The trame module: the served directory, the bundle and stylesheet to load, and the global to install.
-
initialize–Enables the module before the first client connects.
Attributes:
-
PACKAGE_ROOT–The package directory holding js/ in a source checkout; an installed wheel has none.
-
LIBRARY–The window global whose install(registerTag) registers the tags.
PACKAGE_ROOT
module-attribute
¶
The package directory holding js/ in a source checkout; an installed wheel has none.
LIBRARY
module-attribute
¶
The window global whose install(registerTag) registers the tags.
version
cached
¶
The dist's version.json: the source hash and the bundle and stylesheet names.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/module.py
stale
¶
The built and the source hash when a source checkout's dist is older than its sources; None for a current dist or a wheel.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/module.py
asset_url
¶
served
¶
The route-relative URL of a built file with the source hash as its cache buster.
assets
¶
The absolute URLs of the bundle and the stylesheet as the page loads them.
descriptor
cached
¶
The trame module: the served directory, the bundle and stylesheet to load, and the global to install.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/module.py
initialize
¶
notify
¶
The shell's one-shot messages to the user: a file to save and a toast.
Classes:
-
DownloadFile–A file for the browser to save: a sequence number that makes each one new, its name, media type and base64 bytes.
-
ToastMessage–A toast: a sequence number that makes each one new, and its text.
-
Download–Saves each new file it is handed to the browser's downloads; renders nothing.
-
Toast–A short message rising in the bottom-right corner for a few seconds.
DownloadFile
¶
Bases: TypedDict
A file for the browser to save: a sequence number that makes each one new, its name, media type and base64 bytes.
Download
¶
Download(*, file: Prop[DownloadFile | None] = None, on_done: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Saves each new file it is handed to the browser's downloads; renders nothing.
Parameters:
-
file(Prop[DownloadFile | None], default:None) –The file to save; a new
seqsaves again. -
on_done(Event, default:None) –Called once the browser has the file.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/notify.py
Toast
¶
Toast(*, message: Prop[ToastMessage | None] = None, **kwargs: Unpack[Shared])
Bases: Element
A short message rising in the bottom-right corner for a few seconds.
Parameters:
-
message(Prop[ToastMessage | None], default:None) –The message to show; a new
seqshows it again. -
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/notify.py
plot
¶
The plot: a plotly figure reporting restyle, relayout and click events.
Classes:
-
Plot–A figure whose
figureholds data, layout and config;on_click(shared) carries the picked points.
Plot
¶
Plot(*, figure: Prop[Mapping[str, object]] = None, on_restyle: Event = None, on_relayout: Event = None, **kwargs: Unpack[Shared])
Bases: Element
A figure whose figure holds data, layout and config; on_click (shared) carries the picked points.
Parameters:
-
figure(Prop[Mapping[str, object]], default:None) –The plotly figure as JSON: data, layout and config.
-
on_restyle(Event, default:None) –Receives
[update, trace_indices]after a trace changed, as when the legend toggles one. -
on_relayout(Event, default:None) –Receives the changed layout keys after a zoom, a pan or a resize.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/plot.py
progress
¶
The progress bar.
Classes:
-
Progress–A determinate bar filled to
valueout ofmax_.
Progress
¶
Bases: Element
A determinate bar filled to value out of max_.
Parameters:
-
value(Prop[float], default:None) –How far the bar is filled.
-
max_(Prop[float], default:None) –The value of a full bar.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/progress.py
reveal
¶
Controls that appear with the setting they depend on.
Classes:
-
Reveal–Expands its children into place while
open_holds and collapses them away when it ends;classeslay out the children.
Reveal
¶
Bases: Element
Expands its children into place while open_ holds and collapses them away when it ends; classes lay out the children.
Parameters:
-
children(object, default:None) –The controls that depend on the setting.
-
open_(Prop[bool], default:None) –Whether the setting they depend on holds.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/reveal.py
scene
¶
The scene widgets: the browser-side companion of a mirrored view.
Classes:
-
SceneSync–Turns the mirror's triad with its camera in the browser, glides the camera to each
move, supersamples the canvas when asked and reports its size in render pixels throughon_resize.
SceneSync
¶
SceneSync(*, view_ref: Prop[str] = None, camera_id: Prop[int] = None, matrix_id: Prop[int] = None, renderer_id: Prop[int] = None, move: Prop[Mapping[str, object]] = None, highlights: Prop[Mapping[str, int]] = None, highlighted: Prop[str] = None, supersample: Prop[float] = None, on_resize: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Turns the mirror's triad with its camera in the browser, glides the camera to each move, supersamples the canvas when asked and reports its size in render pixels through on_resize.
Parameters:
-
view_ref(Prop[str], default:None) –The trame ref of the mirrored view whose camera turns the triad and whose canvas is measured.
-
camera_id(Prop[int], default:None) –The wasm id of the main renderer's camera.
-
matrix_id(Prop[int], default:None) –The wasm id of the matrix the triad's actor carries.
-
renderer_id(Prop[int], default:None) –The wasm id of the main renderer, whose clipping range follows a glide.
-
move(Prop[Mapping[str, object]], default:None) –The camera to glide to:
seq,position,focal_point,view_upandparallel_scale; a newseqstarts a glide. -
highlights(Prop[Mapping[str, int]], default:None) –The wasm id of the hidden outline actor of each entity id.
-
highlighted(Prop[str], default:None) –The entity id whose outline shows; empty shows none.
-
supersample(Prop[float], default:None) –Render pixels per device pixel along each side; above one the canvas renders larger and the browser averages it down.
-
on_resize(Event, default:None) –Receives the canvas's width, height and pixel ratio in render pixels whenever they change.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/scene.py
scroll_area
¶
Scroll areas: a viewport with styled scrollbars.
Classes:
-
ScrollArea–A scrolling viewport;
type_says when its bars show. -
ScrollBar–A scrollbar of the area along
orientation.
ScrollArea
¶
ScrollArea(children: object = None, *, type_: Prop[ScrollAreaType] = None, scroll_hide_delay: Prop[float] = None, **kwargs: Unpack[Shared])
Bases: Element
A scrolling viewport; type_ says when its bars show.
Parameters:
-
children(object, default:None) –The scrolled content.
-
type_(Prop[ScrollAreaType], default:None) –When the scrollbars show.
-
scroll_hide_delay(Prop[float], default:None) –How long the scrollbars stay after scrolling stops, in milliseconds.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/scroll_area.py
ScrollBar
¶
ScrollBar(*, orientation: Prop[Orientation] = None, force_mount: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A scrollbar of the area along orientation.
Parameters:
-
orientation(Prop[Orientation], default:None) –The direction the bar scrolls.
-
force_mount(Prop[bool], default:None) –Keeps the bar mounted while it is hidden.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/scroll_area.py
select
¶
Selects: a Radix select and its trigger, value, content and items.
Classes:
-
Select–A single-choice select;
modelbinds its value to a state variable. -
SelectTrigger–The button showing the chosen value.
-
SelectValue–The chosen value inside the trigger, or
placeholderwhile none is. -
SelectContent–The dropdown holding the items.
-
SelectItem–One option;
childrenis its label. -
SelectGroup–Items under one label.
-
SelectLabel–The label of a group.
-
SelectSeparator–A rule between items.
Select
¶
Select(children: object = None, *, model: str | None = None, value: Prop[str] = None, default_value: Prop[str] = None, on_value_change: Event = None, open_: Prop[bool] = None, default_open: Prop[bool] = None, on_open_change: Event = None, disabled: Prop[bool] = None, required: Prop[bool] = None, name: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A single-choice select; model binds its value to a state variable.
Parameters:
-
children(object, default:None) –The select's trigger and content.
-
model(str | None, default:None) –A state variable to bind the value to, unless
on_value_changeis given. -
value(Prop[str], default:None) –The chosen item's value.
-
default_value(Prop[str], default:None) –The value at mount while
valueis unset. -
on_value_change(Event, default:None) –Receives the chosen value.
-
open_(Prop[bool], default:None) –Whether the dropdown is open.
-
default_open(Prop[bool], default:None) –Whether the dropdown opens at mount while
open_is unset. -
on_open_change(Event, default:None) –Receives the new open state.
-
disabled(Prop[bool], default:None) –Disables the select.
-
required(Prop[bool], default:None) –Marks the select as required in a form.
-
name(Prop[str], default:None) –The form field name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectTrigger
¶
SelectTrigger(children: object = None, *, size: Prop[SelectTriggerSize] = None, disabled: Prop[bool] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
The button showing the chosen value.
Parameters:
-
children(object, default:None) –The trigger's content, usually a SelectValue.
-
size(Prop[SelectTriggerSize], default:None) –The trigger's height.
-
disabled(Prop[bool], default:None) –Disables the trigger.
-
aria_label(Prop[str], default:None) –The trigger's accessible name, for a select whose caption is not its label element.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectValue
¶
Bases: Element
The chosen value inside the trigger, or placeholder while none is.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectContent
¶
SelectContent(children: object = None, *, position: Prop[SelectPosition] = None, side: Prop[Side] = None, align: Prop[Align] = None, side_offset: Prop[float] = None, **kwargs: Unpack[Shared])
Bases: Element
The dropdown holding the items.
Parameters:
-
children(object, default:None) –The select's items.
-
position(Prop[SelectPosition], default:None) –Whether the list sits over the chosen item or floats beside the trigger.
-
side(Prop[Side], default:None) –The side of the trigger the list opens on, in popper position.
-
align(Prop[Align], default:None) –How the list aligns against the trigger, in popper position.
-
side_offset(Prop[float], default:None) –The gap between the trigger and the list in pixels, in popper position.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectItem
¶
SelectItem(children: object = None, *, value: Prop[str] = None, disabled: Prop[bool] = None, text_value: Prop[str] = None, flag: Prop[str] = None, detail: Prop[list[str]] = None, **kwargs: Unpack[Shared])
Bases: Element
One option; children is its label.
Parameters:
-
children(object, default:None) –The option's label.
-
value(Prop[str], default:None) –The value the option chooses.
-
disabled(Prop[bool], default:None) –Disables the option.
-
text_value(Prop[str], default:None) –The text typeahead matches, for a label that is not plain text.
-
flag(Prop[str], default:None) –A state word after the label, such as Solving, set apart from the muted detail.
-
detail(Prop[list[str]], default:None) –Muted parts after the label, never copied into the trigger nor matched on typeahead.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectGroup
¶
Bases: Element
Items under one label.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectLabel
¶
Bases: Element
The label of a group.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/select.py
SelectSeparator
¶
separator
¶
The separator.
Classes:
-
Separator–A rule between content.
Separator
¶
Separator(*, orientation: Prop[Orientation] = None, decorative: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A rule between content.
Parameters:
-
orientation(Prop[Orientation], default:None) –The direction the rule runs.
-
decorative(Prop[bool], default:None) –Hides the rule from assistive technology.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/separator.py
slider
¶
The slider.
Classes:
-
Slider–A one- or two-thumb slider over a list of values, its thumbs named after
aria_label;modelbinds the values to a state variable.
Slider
¶
Slider(*, model: str | None = None, value: Prop[Sequence[float]] = None, default_value: Prop[Sequence[float]] = None, on_value_change: Event = None, on_value_commit: Event = None, min_: Prop[float] = None, max_: Prop[float] = None, step: Prop[float] = None, min_steps_between_thumbs: Prop[int] = None, orientation: Prop[Orientation] = None, inverted: Prop[bool] = None, disabled: Prop[bool] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
A one- or two-thumb slider over a list of values, its thumbs named after aria_label; model binds the values to a state variable.
Parameters:
-
model(str | None, default:None) –A state variable to bind the values to, unless
on_value_changeis given. -
value(Prop[Sequence[float]], default:None) –The thumb values, one per thumb.
-
default_value(Prop[Sequence[float]], default:None) –The thumb values at mount while
valueis unset. -
on_value_change(Event, default:None) –Receives the thumb values while a thumb moves.
-
on_value_commit(Event, default:None) –Receives the thumb values when a thumb is released.
-
min_(Prop[float], default:None) –The low end of the range.
-
max_(Prop[float], default:None) –The high end of the range.
-
step(Prop[float], default:None) –The step between values.
-
min_steps_between_thumbs(Prop[int], default:None) –The fewest steps two thumbs keep between them.
-
orientation(Prop[Orientation], default:None) –The direction the slider runs.
-
inverted(Prop[bool], default:None) –Runs the range from high to low.
-
disabled(Prop[bool], default:None) –Disables the slider.
-
aria_label(Prop[str], default:None) –The accessible name the thumbs are named after.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/slider.py
switch
¶
The switch.
Classes:
-
Switch–An on/off switch;
modelbinds its checked state to a state variable.
Switch
¶
Switch(*, model: str | None = None, checked: Prop[bool] = None, default_checked: Prop[bool] = None, on_checked_change: Event = None, size: Prop[SwitchSize] = None, disabled: Prop[bool] = None, aria_disabled: Prop[bool] = None, name: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
An on/off switch; model binds its checked state to a state variable.
Parameters:
-
model(str | None, default:None) –A state variable to bind the checked state to, unless
on_checked_changeis given. -
checked(Prop[bool], default:None) –Whether the switch is on.
-
default_checked(Prop[bool], default:None) –Whether the switch is on at mount while
checkedis unset. -
on_checked_change(Event, default:None) –Receives the new checked state.
-
size(Prop[SwitchSize], default:None) –The switch's size.
-
disabled(Prop[bool], default:None) –Disables the switch.
-
aria_disabled(Prop[bool], default:None) –Tells assistive technology the switch is disabled.
-
name(Prop[str], default:None) –The form field name.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/switch.py
table
¶
The table: a TanStack table over columns, rows and options, reporting its layout, row clicks and the selection.
Type Aliases:
-
Selectable–Whether the user selects no rows, one or several.
Classes:
-
ColumnSpec–One column: its row field, header title, whether it sorts and filters as a number, how its header facets, and its width.
-
LayoutDefaults–The authored layout a missing document and Reset fall back to; the keys are the document's.
-
TableOptions–The table options; the keys are the React prop's fields.
-
Table–Columns over rows;
optionscarries the persisted layout, the authored defaults and the switches.
Selectable
¶
Selectable = Literal['multiple', 'none', 'single']
Whether the user selects no rows, one or several.
ColumnSpec
¶
Bases: TypedDict
One column: its row field, header title, whether it sorts and filters as a number, how its header facets, and its width.
LayoutDefaults
¶
Bases: TypedDict
The authored layout a missing document and Reset fall back to; the keys are the document's.
Table
¶
Table(*, columns: Prop[Sequence[ColumnSpec]] = None, rows: Prop[Sequence[Row]] = None, options: Prop[TableOptions] = None, on_layout_change: Event = None, on_row_click: Event = None, on_selection_change: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Columns over rows; options carries the persisted layout, the authored defaults and the switches.
Parameters:
-
columns(Prop[Sequence[ColumnSpec]], default:None) –The column specs, in the order sent.
-
rows(Prop[Sequence[Row]], default:None) –The data rows.
-
options(Prop[TableOptions], default:None) –The persisted layout, the authored defaults and the switches.
-
on_layout_change(Event, default:None) –Receives the layout document once a burst of the user's changes settles.
-
on_row_click(Event, default:None) –Receives a clicked data row.
-
on_selection_change(Event, default:None) –Receives the selection, its rows under
rows. -
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Methods:
-
restore–Applies a layout document, or the authored defaults for None.
-
reset_layout–Returns to the authored defaults.
-
scroll_to_end–Scrolls to the last row.
-
scroll_to_row–Scrolls a row of the shown row model into view.
-
open_config–Shows, or hides, the column configuration panel.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/table.py
tabs
¶
Tabs: a tab list and the content panes it switches.
Classes:
-
Tabs–Tabbed panes;
modelbinds the active tab to a state variable. -
TabsList–The row of tab triggers.
-
TabsTrigger–The tab selecting
value. -
TabsContent–The pane shown while
valueis the active tab.
Tabs
¶
Tabs(children: object = None, *, model: str | None = None, value: Prop[str] = None, default_value: Prop[str] = None, on_value_change: Event = None, orientation: Prop[Orientation] = None, activation_mode: Prop[ActivationMode] = None, **kwargs: Unpack[Shared])
Bases: Element
Tabbed panes; model binds the active tab to a state variable.
Parameters:
-
children(object, default:None) –The tab list and the panes.
-
model(str | None, default:None) –A state variable to bind the active tab to, unless
on_value_changeis given. -
value(Prop[str], default:None) –The active tab's value.
-
default_value(Prop[str], default:None) –The active tab at mount while
valueis unset. -
on_value_change(Event, default:None) –Receives the newly active tab's value.
-
orientation(Prop[Orientation], default:None) –The direction the tab list runs.
-
activation_mode(Prop[ActivationMode], default:None) –Whether an arrow key activates a tab or only focuses it.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tabs.py
TabsList
¶
TabsList(children: object = None, *, variant: Prop[TabsListVariant] = None, loop: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The row of tab triggers.
Parameters:
-
children(object, default:None) –The tab triggers.
-
variant(Prop[TabsListVariant], default:None) –The list's style.
-
loop(Prop[bool], default:None) –Whether keyboard navigation wraps from the last tab to the first.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tabs.py
TabsTrigger
¶
TabsTrigger(children: object = None, *, value: Prop[str] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The tab selecting value.
Parameters:
-
children(object, default:None) –The tab's label.
-
value(Prop[str], default:None) –The value the tab activates.
-
disabled(Prop[bool], default:None) –Disables the tab.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tabs.py
TabsContent
¶
TabsContent(children: object = None, *, value: Prop[str] = None, force_mount: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
The pane shown while value is the active tab.
Parameters:
-
children(object, default:None) –The pane's content.
-
value(Prop[str], default:None) –The tab value the pane shows for.
-
force_mount(Prop[bool], default:None) –Keeps the pane mounted while another tab is active.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tabs.py
term
¶
The terminal: an xterm fed from the server.
Classes:
-
Term–An xterm whose
optionsare read at mount;on_datacarries typed text,on_resizethe new size.
Term
¶
Term(*, options: Prop[Mapping[str, object]] = None, on_data: Event = None, on_resize: Event = None, **kwargs: Unpack[Shared])
Bases: Element
An xterm whose options are read at mount; on_data carries typed text, on_resize the new size.
Parameters:
-
options(Prop[Mapping[str, object]], default:None) –xterm options, read once at mount.
-
on_data(Event, default:None) –Receives the text the user types.
-
on_resize(Event, default:None) –Receives the terminal's new size in columns and rows.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Methods:
-
write–Writes
textto the terminal. -
clear–Clears the terminal.
-
fit–Fits the grid to the host's size.
-
scroll_to_bottom–Scrolls to the newest line.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/term.py
tip
¶
The tooltip a single child carries.
Classes:
-
Tip–Gives its one child a tooltip that opens on hover and on keyboard focus; empty content renders the child alone.
Tip
¶
Tip(children: object = None, *, content: Prop[str] = None, side: Prop[Side] = None, definition: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
Gives its one child a tooltip that opens on hover and on keyboard focus; empty content renders the child alone.
Parameters:
-
children(object, default:None) –The one element the tooltip describes.
-
content(Prop[str], default:None) –The tooltip's text: what the element does or what the screen does not show.
-
side(Prop[Side], default:None) –The side of the element the tooltip opens on.
-
definition(Prop[bool], default:None) –Whether the content explains a value, which marks it with the accent edge, rather than naming what a control does.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tip.py
toggle
¶
Toggles: a pressed button and a group of them choosing one or many values.
Classes:
-
Toggle–A button that stays pressed;
modelbinds the pressed state to a state variable. -
ToggleGroup–Toggle items choosing one value (
type_single) or a list of them;modelbinds the choice to a state variable. -
ToggleGroupItem–One item of a toggle group.
Toggle
¶
Toggle(children: object = None, *, model: str | None = None, pressed: Prop[bool] = None, default_pressed: Prop[bool] = None, on_pressed_change: Event = None, variant: Prop[ToggleVariant] = None, size: Prop[ToggleSize] = None, disabled: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A button that stays pressed; model binds the pressed state to a state variable.
Parameters:
-
children(object, default:None) –The toggle's label or icon.
-
model(str | None, default:None) –A state variable to bind the pressed state to, unless
on_pressed_changeis given. -
pressed(Prop[bool], default:None) –Whether the toggle is pressed.
-
default_pressed(Prop[bool], default:None) –Whether the toggle is pressed at mount while
pressedis unset. -
on_pressed_change(Event, default:None) –Receives the new pressed state.
-
variant(Prop[ToggleVariant], default:None) –The toggle's style.
-
size(Prop[ToggleSize], default:None) –The toggle's size.
-
disabled(Prop[bool], default:None) –Disables the toggle.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/toggle.py
ToggleGroup
¶
ToggleGroup(children: object = None, *, model: str | None = None, type_: Prop[ToggleType] = None, value: Prop[str | Sequence[str]] = None, default_value: Prop[str | Sequence[str]] = None, on_value_change: Event = None, variant: Prop[ToggleVariant] = None, size: Prop[ToggleSize] = None, orientation: Prop[Orientation] = None, disabled: Prop[bool] = None, spacing: Prop[float] = None, aria_label: Prop[str] = None, **kwargs: Unpack[Shared])
Bases: Element
Toggle items choosing one value (type_ single) or a list of them; model binds the choice to a state variable.
Parameters:
-
children(object, default:None) –The group's items.
-
model(str | None, default:None) –A state variable to bind the choice to, unless
on_value_changeis given. -
type_(Prop[ToggleType], default:None) –Whether one item or several can be pressed.
-
value(Prop[str | Sequence[str]], default:None) –The pressed item's value, or the values of a multiple group.
-
default_value(Prop[str | Sequence[str]], default:None) –The choice at mount while
valueis unset. -
on_value_change(Event, default:None) –Receives the new choice.
-
variant(Prop[ToggleVariant], default:None) –The items' style.
-
size(Prop[ToggleSize], default:None) –The items' size.
-
orientation(Prop[Orientation], default:None) –The direction the items run.
-
disabled(Prop[bool], default:None) –Disables every item.
-
spacing(Prop[float], default:None) –The gap between items in Tailwind spacing units; 0 joins them.
-
aria_label(Prop[str], default:None) –The accessible name of the group.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/toggle.py
ToggleGroupItem
¶
ToggleGroupItem(children: object = None, *, value: Prop[str] = None, disabled: Prop[bool] = None, variant: Prop[ToggleVariant] = None, size: Prop[ToggleSize] = None, **kwargs: Unpack[Shared])
Bases: Element
One item of a toggle group.
Parameters:
-
children(object, default:None) –The item's label or icon.
-
value(Prop[str], default:None) –The value the item stands for.
-
disabled(Prop[bool], default:None) –Disables the item.
-
variant(Prop[ToggleVariant], default:None) –The item's style, over the group's.
-
size(Prop[ToggleSize], default:None) –The item's size, over the group's.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/toggle.py
tooltip
¶
Tooltips: a provider, a tooltip and its trigger and content.
Classes:
-
TooltipProvider–Shares the open delay across the tooltips inside it.
-
Tooltip–A tooltip around its trigger.
-
TooltipTrigger–The element the tooltip describes;
as_childrenders the child element itself. -
TooltipContent–The tooltip's bubble.
TooltipProvider
¶
TooltipProvider(children: object = None, *, delay_duration: Prop[float] = None, skip_delay_duration: Prop[float] = None, **kwargs: Unpack[Shared])
Bases: Element
Shares the open delay across the tooltips inside it.
Parameters:
-
children(object, default:None) –The tooltips that share the delay.
-
delay_duration(Prop[float], default:None) –How long the pointer rests on a trigger before its tooltip opens, in milliseconds.
-
skip_delay_duration(Prop[float], default:None) –How soon after a tooltip closes another opens without the delay, in milliseconds.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tooltip.py
Tooltip
¶
Tooltip(children: object = None, *, open_: Prop[bool] = None, default_open: Prop[bool] = None, on_open_change: Event = None, delay_duration: Prop[float] = None, disable_hoverable_content: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
A tooltip around its trigger.
Parameters:
-
children(object, default:None) –The trigger and the content.
-
open_(Prop[bool], default:None) –Whether the tooltip is open.
-
default_open(Prop[bool], default:None) –Whether the tooltip opens at mount while
open_is unset. -
on_open_change(Event, default:None) –Receives the new open state.
-
delay_duration(Prop[float], default:None) –The open delay in milliseconds, over the provider's.
-
disable_hoverable_content(Prop[bool], default:None) –Closes the tooltip once the pointer leaves the trigger, even for the content.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tooltip.py
TooltipTrigger
¶
Bases: Element
The element the tooltip describes; as_child renders the child element itself.
Parameters:
-
children(object, default:None) –The element the tooltip describes.
-
as_child(Prop[bool], default:None) –Renders the child element itself as the trigger.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tooltip.py
TooltipContent
¶
TooltipContent(children: object = None, *, side: Prop[Side] = None, align: Prop[Align] = None, side_offset: Prop[float] = None, **kwargs: Unpack[Shared])
Bases: Element
The tooltip's bubble.
Parameters:
-
children(object, default:None) –The tooltip's text.
-
side(Prop[Side], default:None) –The side of the trigger the bubble opens on.
-
align(Prop[Align], default:None) –How the bubble aligns against the trigger.
-
side_offset(Prop[float], default:None) –The gap between the trigger and the bubble, in pixels.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tooltip.py
tour
¶
The guided tour: a spotlight and a card stepping over elements of the live app.
Classes:
-
TourStep–One stop: the CSS selector of the element to highlight, the card's title and body, and its preferred side.
-
Tour–A guided tour: a spotlight and a card over each step's target;
modelbinds the open flag to a state variable.
TourStep
¶
Bases: TypedDict
One stop: the CSS selector of the element to highlight, the card's title and body, and its preferred side.
Tour
¶
Tour(children: object = None, *, model: str | None = None, steps: Prop[Sequence[TourStep]] = None, open_: Prop[bool] = None, on_open_change: Event = None, step: Prop[int] = None, on_step_change: Event = None, on_finish: Event = None, **kwargs: Unpack[Shared])
Bases: Element
A guided tour: a spotlight and a card over each step's target; model binds the open flag to a state variable.
Parameters:
-
children(object, default:None) –Unused; the tour renders only its spotlight and card.
-
model(str | None, default:None) –A state variable to bind the open flag to, unless
on_open_changeis given. -
steps(Prop[Sequence[TourStep]], default:None) –The stops in order; a stop whose target is not mounted is skipped.
-
open_(Prop[bool], default:None) –Whether the tour is showing.
-
on_open_change(Event, default:None) –Receives False when the tour closes itself.
-
step(Prop[int], default:None) –The current stop's index among the mounted ones; the tour keeps its own while unset.
-
on_step_change(Event, default:None) –Receives the new stop index.
-
on_finish(Event, default:None) –Receives
"done"from the last stop's Done, or"skipped"from Skip Tour and Escape. -
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.
Source code in packages/femforge-workbench/src/femforge_workbench/widgets/tour.py
tree
¶
The tree: collapsible items with leaf checkboxes.
Classes:
-
TreeItem–One node: its id, title and children.
-
Tree–Nested items whose leaves can be checked;
modelbinds the checked ids to a state variable.
Tree
¶
Tree(*, model: str | None = None, items: Prop[Sequence[TreeItem]] = None, value: Prop[Sequence[str]] = None, on_value_change: Event = None, selectable: Prop[TreeSelectable] = None, open_all: Prop[bool] = None, **kwargs: Unpack[Shared])
Bases: Element
Nested items whose leaves can be checked; model binds the checked ids to a state variable.
Parameters:
-
model(str | None, default:None) –A state variable to bind the checked ids to, unless
on_value_changeis given. -
items(Prop[Sequence[TreeItem]], default:None) –The root nodes.
-
value(Prop[Sequence[str]], default:None) –The ids of the checked leaves.
-
on_value_change(Event, default:None) –Receives the checked ids.
-
selectable(Prop[TreeSelectable], default:None) –Whether the leaves carry checkboxes.
-
open_all(Prop[bool], default:None) –Opens every node at mount.
-
kwargs(Unpack[Shared], default:{}) –Shared trame props and events, such as
classes,styleandon_click.