InputForm#

class ansys.solutions.dash_super_components.InputForm(items: list[dict[str, Any]], title: str | None = None, with_card: bool = True, card_props: dict[str, Any] | None = None, title_props: dict[str, Any] | None = None, column_names: list[str] | None = None, column_widths: dict[str, int] | None = None, aio_id: str | None = None, columns: list[str] | None = None, persistence: bool = False, persistence_type: str | None = None)#

Bases: Div

All-in-one component based on Dash Mantine Components to create input forms.

Each row of the form is defined by a dictionary with the following keys:

  • fields (required): list of field dicts. Each field dict must contain "type" and "id" keys plus any additional properties accepted by the underlying Dash Mantine component. Supported types: NumberInput, TextInput, PasswordInput, Checkbox, Select, MultiSelect, Slider, Switch.

  • label (optional): str — label text shown in the label column.

  • unit (optional): str — LaTeX-rendered unit shown in the unit column.

  • description (optional): str — description text shown in the description column.

  • help (optional): Dash component(s), str, or number — content shown in a modal when the help icon is clicked.

  • id (optional): str — explicit row identifier used as the row_index in component IDs. When omitted, the zero-based row position is used instead.

UI-side value persistence is disabled by default. It can be enabled globally for all fields via the persistence and persistence_type constructor parameters. Individual fields can override the global setting by including a "persistence" key in their field dict.

Parameters:
itemslist of dict

A list of row definitions. Each dict must contain a "fields" key whose value is a list of field dicts (each requiring "type" and "id"). Optional row keys: "label", "unit", "description", "help", "id". Fields also accept a "hidden": True key to hide the field on initialization. To override the global persistence setting for an individual field, pass "persistence": True or "persistence": False in the field dict.

titlestr, optional

Title displayed above the form.

with_cardbool, optional

Whether to wrap the form in a dmc.Card. Default is True.

card_propsdict, optional

Additional properties forwarded to dmc.Card.

title_propsdict, optional

Additional properties forwarded to the title html.P element.

column_nameslist of str, optional

Header labels for each column, in the same order as columns. Pass an empty list (default) to omit column headers.

column_widthsdict, optional

Mapping of column names to integer grid-span widths. Columns omitted here use built-in defaults.

aio_idstr, optional

Unique identifier for this component instance. A UUID is generated when not provided.

columnslist of str, optional

Ordered list of column names to display. Supported values: "label", "fields", "unit", "description", "help". Defaults to all five columns in the order listed.

persistencebool, optional

Whether to enable UI-side persistence for all form fields. When True, user-entered values survive page navigation within the same browser tab. Individual fields can override this setting via "persistence" in the field dict. Default is False.

persistence_typestr, optional

The Dash persistence storage type to use when persistence is True. Accepted values: "memory" (cleared on page reload), "session" (cleared when the browser tab is closed), "local" (persists across reloads and browser restarts). Default is "memory".

IDs

class ansys.solutions.dash_super_components.InputForm.InputFormIds#

Bases: AIOIds

Provides IDs for the subcomponents of InputForm.

classmethod description(aio_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form description.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

row_indexstr, int, or _Wildcard

The unique row index of the description (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a description subcomponent of the input form

classmethod field(aio_id: str | Wildcard, field_type: str | Wildcard, field_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form field.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

field_typestr, or _Wildcard

The unique type of the field within the form (field[“type”]).

field_idstr, or _Wildcard

The unique identifier of the field within the form (field[“id”]).

row_indexstr, int, or _Wildcard

The unique row index of the field within the form (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a field subcomponent of the input form

classmethod field_div(aio_id: str | Wildcard, field_type: str | Wildcard, field_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form field div.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

field_typestr, or _Wildcard

The unique type of the field within the form (field[“type”]).

field_idstr, or _Wildcard

The unique identifier of the field within the form (field[“id”]).

row_indexstr, int, or _Wildcard

The unique row index of the field within the form (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a field div subcomponent of the input form

classmethod help(aio_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form help text.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

row_indexstr, int, or _Wildcard

The unique row index of the help text (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a help subcomponent of the input form

classmethod label(aio_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form label.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

row_indexstr, int, or _Wildcard

The unique row index of the label (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a label subcomponent of the input form

classmethod modal(aio_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form modal.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

row_indexstr, int, or _Wildcard

The unique row index of the modal (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a modal subcomponent of the input form

classmethod unit(aio_id: str | Wildcard, row_index: str | int | Wildcard) → dict[str, Any]#

Return the id for an input form unit.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

row_indexstr, int, or _Wildcard

The unique row index of the unit (row[“id”] or row number if row[“id”] is not present).

Returns:
dict[str, Any]

The unique id dictionary for a unit subcomponent of the input form