Skip to content

widgets

Widgets shared by the panels: section headers and tooltip icon buttons.

js_string

js_string(value)

Return value as a single quoted JS string literal for a Vue template.

The literal contains no quote, brace or angle bracket, so it is safe in a template interpolation, in a Vue expression and in an HTML attribute; text of descriptors and file names reaches the client this way.

Parameters:

Name Type Description Default
value str

text to quote.

required

Returns:

Type Description
str

The JS string literal, e.g. 'heart'.

js_text

js_text(value)

Return a template interpolation which renders value as escaped text.

section_header

section_header(
    icon,
    label,
    state_var,
    *,
    prefix="",
    suffix="margin-bottom:6px;",
    action=None,
)

Render a collapsible section header toggling the boolean state_var, with icon, label and chevrons; prefix and suffix are CSS before and after the flex rule, action builds a widget between label and chevrons; returns None.

icon_button

icon_button(
    tooltip, *, v_if=None, location="bottom", **btn
)

Render a compact text-variant VBtn inside a VTooltip; tooltip is the static text or a one-element binding tuple, v_if gates the tooltip, location places it, btn kwargs go to the VBtn; returns None.