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.
-
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.
-
dialog–Dialogs: a modal and its trigger, content, header, footer and close.
-
dock–The dock: a dockview host rendering one server template per panel.
-
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.
-
field–Fields: a labelled control with its description and error.
-
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.
-
plot–The plot: a plotly figure reporting restyle, relayout and click events.
-
progress–The progress bar.
-
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.
-
theme–The theme switch:
.darkon , where the Radix portals outside the layout root see it. -
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.
-
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
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, **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.
-
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 whosecompactface shows only the swatch;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, lead: Prop[ComboboxItem] = None, filters: Prop[Sequence[str]] = None, compact: Prop[bool] = 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 compact face shows only the swatch; 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.
-
lead(Prop[ComboboxItem], default:None) –An option listed first, in a group of its own above the items.
-
filters(Prop[Sequence[str]], default:None) –The group toggles that narrow the items.
-
compact(Prop[bool], default:None) –Shows only the chosen option's swatch on the trigger.
-
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
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, **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.
-
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
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, dark: Prop[bool] = 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.
-
dark(Prop[bool], default:None) –Whether the dock paints its dark theme.
-
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
¶
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
¶
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
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
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['app-window', 'box', 'check', 'chevron-down', 'chevron-right', 'circle-help', 'columns-3', 'copy', 'external-link', 'eye', 'eye-off', 'file', 'filter', 'folder', 'grip-vertical', 'layout-grid', 'maximize-2', 'minimize-2', 'minus', 'picture-in-picture-2', 'play', 'plus', 'refresh-cw', 'search', 'settings', 'sliders-horizontal', 'square', 'terminal', 'trash-2', 'x']
The names in the dist's icons.json.
Icon
¶
Icon(name: IconName, *, 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) –The lucide icon's name.
-
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, 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.
-
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.
-
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:
-
LIBRARY–The window global whose install(registerTag) registers the tags.
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
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
¶
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
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 and reports the canvas size in device pixels through
on_resize.
SceneSync
¶
SceneSync(*, view_ref: Prop[str] = None, camera_id: Prop[int] = None, matrix_id: Prop[int] = None, on_resize: Event = None, **kwargs: Unpack[Shared])
Bases: Element
Turns the mirror's triad with its camera in the browser and reports the canvas size in device 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.
-
on_resize(Event, default:None) –Receives the canvas's width, height and pixel ratio 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, **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.
-
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, **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.
-
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, 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.
-
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
theme
¶
The theme switch: .dark on , where the Radix portals outside the layout root see it.
Classes:
-
Theme–Sets the colour scheme of the page; mount it first in the layout root.
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, **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.
-
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
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.