Skip to content

Sidebar Sections

panel_flowdash.sidebar

Public specification for navigation sections in the FlowDash sidebar rail and drawer.

An application or extension adds a navigation section (such as Reports or a Data catalog) by passing :class:SidebarSection objects to :class:~panel_flowdash.app.FlowDashApp via its sections parameter or by calling :meth:~panel_flowdash.app.FlowDashApp.add_section.

Every callback on a section (items, visible, path, view and :attr:SidebarAction.action) receives a :class:SidebarContext carrying the session's app, user (:class:~panel_flowdash.Identity) and section. Sections can also serve their own routes by setting both route and view: FlowDash then routes /<route> and /<route>/... to view(ctx, path) without registering them under Pages. Pass routed sections to :meth:~panel_flowdash.app.FlowDashApp.build_routes so direct loads and browser reloads resolve cleanly.

The built-in Dashboards navigation uses the same :class:SidebarSection mechanism (with id="dashboards" and order=0). Sidebar sections render only when FlowDashApp.nav_variant is "rail" (the default).

RESERVED_ROUTE_PREFIXES = frozenset({'access-denied', 'admin', 'autoload.js', 'components', 'dash', 'login', 'logout', 'metadata', 'static', 'ws'}) module-attribute

RESERVED_SECTION_IDS = frozenset({'home', 'components', 'pages', 'help', 'admin'}) module-attribute

_SECTION_ID_RE = re.compile('^[A-Za-z0-9][A-Za-z0-9_-]*$') module-attribute

__all__ = ['RESERVED_ROUTE_PREFIXES', 'RESERVED_SECTION_IDS', 'SidebarAction', 'SidebarContext', 'SidebarItem', 'SidebarSection'] module-attribute

FlowDashApp

Bases: Viewer

FlowDash application: scans a project directory and serves its pages and components.

add_data = param.ClassSelector(class_=DataAction, default=None, doc='\n An "add data" action shown after the Ask home\'s data chips, e.g.\n uploading a file or connecting a source.') class-attribute instance-attribute

admin_hidden_sections = param.List(default=[], item_type=str, doc="\n Project file section names hidden from the ``/admin`` navigation,\n e.g. when a host app places a section's settings view in its own page.") class-attribute instance-attribute

admin_section_redirects = param.Dict(default={}, doc='\n Map of ``/admin/<section>`` names to routes they moved to, e.g.\n ``{"mcp": "/data/integrations"}``. Listed sections are also hidden\n from the ``/admin`` sidebar, and opening ``/admin/<section>``\n redirects to the target route.') class-attribute instance-attribute

agent = param.Parameter(default=None, doc='\n The AI agent that helps the signed-in user build and change\n dashboards, with that user\'s rights (needs ``panel-flowdash[agent]``).\n None gives the default agent when `agent_model` (or the\n ``FLOWDASH_AGENT_MODEL`` environment variable) names a model and no\n agent otherwise; True requires a model; a string is the default\n agent\'s model, e.g. ``"openai:gpt-5"``; False turns the agent off; a\n ``pydantic_ai.Agent`` built with `panel_flowdash.agent.create_agent`\n (or taking ``FlowDashDeps``) is used as is.') class-attribute instance-attribute

agent_approval_rules = param.List(default=[], doc='\n More calls the agent needs the user\'s approval for, on top of saving,\n deleting, sharing and the sensitive components: tool names, or\n ``panel_agents.ApprovalRule`` objects for calls with particular\n arguments, e.g. ``ApprovalRule("run_command", when=lambda args:\n args["command"] == "action:refresh")``.') class-attribute instance-attribute

agent_authorize = param.Callable(default=None, doc='\n Called with the signed-in `Identity` to decide whether this session\n gets the agent, e.g. to roll it out to some groups first. None offers\n it to everyone when an agent is configured.') class-attribute instance-attribute

agent_model = param.String(default=None, allow_None=True, doc='\n The model of the default agent, e.g. ``"anthropic:<model>"`` or\n ``"openai:<model>"``. Defaults to the ``FLOWDASH_AGENT_MODEL``\n environment variable.') class-attribute instance-attribute

agent_model_settings = param.Dict(default=None, allow_None=True, doc='\n pydantic-ai model settings for every request to the agent, e.g.\n ``{"temperature": 0}``, merged over the agent\'s own.') class-attribute instance-attribute

agent_models = param.List(default=[], doc='\n Models the person using the assistant may pick from, in a small\n select below the chat\'s input that shows when there are two or\n more: pydantic-ai model strings such as ``"openai:<model>"``, dicts\n with an ``id`` and optional ``label`` and ``description`` (e.g. a\n cost hint), or ``panel_agents.ModelChoice`` objects. `agent_model`\n is the default and is offered first if it is not listed; without\n it the first model is the default. Defaults to the\n ``FLOWDASH_AGENT_MODELS`` environment variable, a comma-separated\n list of ``id`` or ``id=label``. Each id is offered once. A model\n whose provider package or API key is missing is listed disabled\n with the reason under its label. The pick applies from the next\n request and the browser remembers it.') class-attribute instance-attribute

agent_palette = param.Boolean(default=True, doc='\n Whether the agent gets the command palette as tools (list_commands\n and run_command), e.g. to open a dashboard or refresh it. Turn it off\n for an agent with a narrow job, whose requests then do not carry\n their schemas.') class-attribute instance-attribute

agent_placeholder_hint = param.Callable(default=None, doc="\n Called with a node's component id and its instance (None before it\n is built) for a `panel_flowdash.report.PlaceholderHint`: the input\n a node's data arrives on, followed first when the agent is pointed\n at the data a view shows, and a note for the agent. Consulted for\n components that do not declare one with\n ``__flowdash_placeholder_hint__``.") class-attribute instance-attribute

agent_report_context = param.Callable(default=None, doc="\n Called with the session's `DashboardOps` for text the agent's\n get_report tool adds after FlowDash's own catalogue of the data\n placeholders can read, fenced as data, e.g. what the columns mean.\n Return None to add nothing.") class-attribute instance-attribute

agent_sensitive_components = param.List(default=[], item_type=str, doc='\n Ids or glob patterns (``"Sources/*"``) of components whose config can\n reach outside the dashboard, such as a SQL source or one fetching a\n URL; former ids of a renamed component count too. The agent needs the\n user\'s approval to place one, preview or load YAML that places one,\n change its config or connect an edge into it.') class-attribute instance-attribute

agent_session property

The session's assistant: its runners, drawer and approval policy; None without an agent.

agent_starters = param.Callable(default=None, doc="\n The questions the assistant offers when a new dashboard opens, with\n Ask on, until its first request. Called with a read-only\n `panel_flowdash.agent.StarterContext` (the person's identity, the\n dashboard, whether it is blank or from a template, and the tables\n they may place), it returns a list of question strings, or an\n awaitable of one, e.g. from a data catalogue's tables; at most three\n are shown. Returning None offers the default questions, and an empty\n list none. Without a hook the defaults ask about the data sources the\n person may place, by title (`panel_flowdash.agent.default_starter_questions`).") class-attribute instance-attribute

auth_config = param.ClassSelector(class_=AuthConfig, doc='\n Project-level authorization configuration controlling group discovery,\n the admin groups and the default access policy.') class-attribute instance-attribute

breakpoints = param.List(default=[768, 1200], doc='Responsive breakpoints for the tile grid.') class-attribute instance-attribute

chats = param.Boolean(default=False, doc='\n Whether people\'s chats are listed: a Chats section in the rail lists\n the signed-in person\'s chats, newest first, and ``/chats`` lists them\n with Rename and Delete. A chat is a dashboard of kind ``"chat"``,\n private to its owner and left out of every dashboard listing; it\n opens on the Explore view.') class-attribute instance-attribute

component_libraries = param.List(default=[], item_type=str, doc='\n Installed libraries whose components the editor offers next to the\n project\'s own: module names, e.g. ``"my_library"``, or\n ``"module:attribute"`` naming a mapping of component id to\n component, a list of components or a single one. A module offers\n its ``__flowdash_components__``, or else every object it exports\n that ``@register`` marks as a component. Their permissions and\n `authorize_component` apply as for the project\'s components. An id\n that the project, the built-in components or another library\n already uses raises a ``ComponentLibraryError``.') class-attribute instance-attribute

configure_layout = param.Callable(default=None, doc='\n Optional callback invoked on every navigation with\n (app, content, route). Use it to set `app.sidebar` and\n `app.contextbar` for the page currently being served.') class-attribute instance-attribute

contextbar = Children(default=[], doc='Items prepended to the contextbar.') class-attribute instance-attribute

contextbar_open = param.Boolean(default=False, doc='Whether the contextbar is open.') class-attribute instance-attribute

controls_position = param.Selector(default='top', objects=['top', 'left'], doc='\n Where a dashboard\'s controls (components registered with\n ``sidebar=True``) go unless the dashboard\'s settings say otherwise:\n "top" in a slim row above the tiles, "left" in a collapsible panel\n beside them. Passed to the editor, see `FlowDash.controls_position`.') class-attribute instance-attribute

data_chips = param.Callable(default=None, doc="\n Lists the data the Ask home offers to ask about, as chips: called with\n the session's :class:`~panel_flowdash.auth.Identity`, it returns\n :class:`~panel_flowdash.home.DataChip` objects or mappings with\n ``id``, ``label`` and an optional ``group``. The chips picked when\n asking are stored on the chat as its scope, which the Explore agent\n is told (``FlowDashDeps.scope``); keeping to it is up to the host's\n tools. None offers no chips.") class-attribute instance-attribute

data_overview = param.Callable(default=None, doc='\n Describes the project\'s data in the Ask home\'s "Your data" card:\n called with the session\'s :class:`~panel_flowdash.auth.Identity`, it\n returns anything Panel can show, e.g. the sources, their tables and\n columns, or an awaitable of it. It is called like\n ``suggest_questions``: a coroutine function is awaited on the\n session\'s event loop and a plain function runs on a worker thread,\n so a slow hook never holds up the page, and the card appears once it\n answers. None, a hook returning None or a hook that fails leaves the\n card out. The card is left out at phone width.') class-attribute instance-attribute

default_allow property

Whether pages, components and data without access rules are open to everyone.

editor property

The session's dashboard editor, None until the app has built it.

editor_class = param.ClassSelector(class_=FlowDash, default=FlowDash, is_instance=False, doc="\n The `FlowDash` subclass instantiated as the app's editor. Read once at\n construction; the same editor is reused for every dashboard.") class-attribute instance-attribute

editor_options = param.Dict(default={}, doc="\n Extra keyword arguments passed through to the `editor_class`\n constructor, e.g. `value_repr` or `popup_trigger`. Entries override\n the defaults the app derives from its own parameters (such as\n `breakpoints` and `notifications`), and `toolbar_extra` items are\n placed after the app's Share button. `authorize_component`,\n `authorize_dashboard`, `authorize_rename`, `components`, `store`, `user` and\n `include_page_dialog` are supplied\n by the app and raise a ValueError if given here.\n `dashboard`, `editable` and `read_only` are accepted but then managed\n by the app's routing and authorization. Read once at construction;\n the same editor is reused for every dashboard, so later changes have\n no effect.") class-attribute instance-attribute

explore_agent = param.Parameter(default=None, doc="\n The AI agent the Explore view asks, which answers questions about\n the data behind the open dashboard, separately from the assistant\n in the drawer, which edits it. Each has its own runs, and the\n picked model is shared. None gives the default Explore agent on the\n assistant's model (see `panel_flowdash.agent.create_explore_agent`)\n whenever there is an assistant; False turns asking in the Explore\n view off, leaving it a read-only record of the dashboard's turns; a\n ``pydantic_ai.Agent`` taking ``FlowDashDeps`` is used as is.") class-attribute instance-attribute

header_layout = param.Selector(default='compact', objects=['compact', 'full'], doc='\n How a dashboard\'s title, health and actions are laid out unless the\n dashboard\'s settings say otherwise. "compact" puts them in the top bar\n next to the breadcrumb (with the default "rail" navigation) and\n shrinks the search field to an icon; "full" shows them in a row of\n their own under the top bar, with a large title, the description and\n when the dashboard was last refreshed. Passed to the editor, see\n `FlowDash.header_layout`.') class-attribute instance-attribute

home = param.Selector(default='launcher', objects=['launcher', 'explore'], doc='\n What ``/`` shows. ``"launcher"`` shows the launcher, Browse, which is\n also at ``/browse``. ``"explore"`` shows a switch between Ask, a\n composer that starts a chat about the project\'s data, and Browse; the\n choice each person made last is the one they land on. ``"explore"``\n turns `chats` on. A `home_dashboard` is shown on ``/`` instead of either.') class-attribute instance-attribute

home_dashboard = param.String(default=None, doc="\n Dashboard shown on the homepage ('/'). Accepts a dashboard id or\n title. When unset, the homepage shows the dashboard grid launcher.") class-attribute instance-attribute

identity property

Who the session is signed in as (see auth_config), None until the app has resolved it.

include_builtin_components = param.Boolean(default=True, doc='Include built-in widget components in the dashboard editor.') class-attribute instance-attribute

is_admin property

Whether this session administers the project (cached per session).

Use this for showing or hiding UI. Before performing a privileged write or admin action, re-check with :meth:still_admin, which re-reads the project file and permissions.

mcp_secret_env_vars = param.List(default=None, allow_None=True, item_type=str, doc='\n Allowlist of glob patterns or variable names permitted in ``${VAR}``\n secret references inside ``flowdash.yaml``\'s ``mcp:`` section. When\n None, reads ``FLOWDASH_MCP_SECRET_ENV_VARS`` (comma-separated) or\n defaults to ``["FLOWDASH_MCP_*"]``.') class-attribute instance-attribute

mcp_servers = param.Dict(default={}, doc='\n Programmatic MCP servers keyed by server id: each value is a\n `panel_flowdash.mcp.MCPServerConfig`, a config mapping or a ready-made\n pydantic-ai toolset / FastMCP server. Code-defined servers take\n precedence over identically named entries in ``flowdash.yaml`` and\n appear locked in the admin UI.') class-attribute instance-attribute

mcp_stdio_commands = param.List(default=None, allow_None=True, doc='\n Allowlist of full argv prefixes that ``stdio`` MCP servers configured in\n ``flowdash.yaml`` or the admin UI may launch. Each entry is a command\n string (e.g. ``"/opt/mcp/docs-server --readonly"``) or an argv sequence\n (e.g. ``["/usr/local/bin/my-mcp", "--mode", "read"]``); path entries must\n be absolute. A configured server must match the whole prefix and only\n trailing arguments beyond it are free. Allowlisting a package launcher\n or interpreter without a pinned subcommand/script prefix grants arbitrary\n code execution to anyone who can edit ``flowdash.yaml`` or is an app\n admin. When None, reads the comma-separated ``FLOWDASH_MCP_STDIO_COMMANDS``\n environment variable; when empty, file/UI ``stdio`` servers are denied.') class-attribute instance-attribute

mcp_stdio_env = param.List(default=None, allow_None=True, item_type=str, doc='\n Allowlist of subprocess environment variable names that file/UI ``stdio``\n MCP servers may set in ``env:``. When None, reads the comma-separated\n ``FLOWDASH_MCP_STDIO_ENV`` environment variable; when empty, file/UI\n ``stdio`` servers cannot inject environment variables.') class-attribute instance-attribute

nav_variant = param.Selector(default='rail', objects=['left', 'menubar', 'rail', 'right'], doc="\n How navigation is rendered. 'rail' shows a navigation rail on the left\n (Home, Dashboards, Components, Pages, Help) and a breadcrumb with a\n dashboard switcher in the top bar; on narrow screens the rail moves\n behind a menu button. 'left' and 'right' dock a MenuList in a drawer\n on that side of the page; 'menubar' places a MenuBar in the page\n header with quick-action icons alongside it.") class-attribute instance-attribute

notifications = param.Boolean(default=True, doc='\n Whether to surface user-facing messages as Panel notifications. When\n disabled (or when no notification area exists) messages are logged.') class-attribute instance-attribute

overlay property

A layout for overlays an embedder adds, such as their own dialogs.

Laid out beside the main content of every page, in the page's palette rather than the header's, so a pmui.Dialog appended here opens over the page and follows the light and dark theme. Unlike page_dialog(), whose content components replace, what is appended here stays across navigation and keeps its own state. Content that is not modal, such as a banner, appears at the bottom of the page's main area.

package = param.String(default=None, doc='\n Importable package that `project_dir` is, if any. Modules are then named\n `<package>.<Section>.<name>` instead of relative to `project_dir`.') class-attribute instance-attribute

page_options = param.Dict(default={}, doc="\n Extra keyword arguments passed through to the underlying\n `panel_material_ui.Page`, overriding the app's own defaults.\n ``favicon`` and ``apple_touch_icon`` set the page's icons; without\n them both are generated from ``logo``, if there is one.") class-attribute instance-attribute

project = param.ClassSelector(class_=(Project, str, os.PathLike), default=None, doc="\n The project file (``flowdash.yaml``) whose sections configure the\n app, as a path or a loaded `panel_flowdash.project.Project`. A path\n is loaded when the app is created, with the project directory and\n the component registry as the loaders' context, raising\n `ProjectError` with the file, line and column of each problem. See\n the project file reference.") class-attribute instance-attribute

project_dir = param.Path(doc='Path to the project directory.') class-attribute instance-attribute

propagate_failures = param.Boolean(default=False, doc='\n Carry a failing output or edge transform downstream instead of leaving\n the connected inputs on their last value. Passed to the embedded\n editor, see `FlowDash.propagate_failures`.') class-attribute instance-attribute

sections = param.List(default=[], item_type=SidebarSection, doc='\n Navigation sections shown in the rail and narrow-screen drawer (when\n ``nav_variant="rail"``), each a :class:`~panel_flowdash.SidebarSection`.\n The built-in Dashboards section (``id="dashboards"``, ``order=0``) is\n registered automatically unless a section with ``id="dashboards"`` is\n supplied here. Assigning ``app.sections = [...]`` keeps the built-in\n Dashboards section, deduplicates by ``id`` and sorts in ascending\n ``order`` (custom sections default to ``100``). Use :meth:`add_section`,\n :meth:`remove_section` and :meth:`refresh_sections` to manage sections\n at runtime.') class-attribute instance-attribute

settings_class = param.ClassSelector(class_=DashboardSettings, default=DashboardSettings, is_instance=False, doc='\n The dashboard-wide settings class handed to the editor. Subclass\n `DashboardSettings` to persist application-specific values with each\n dashboard.') class-attribute instance-attribute

settings_sources = param.Dict(default={}, doc='\n Where parameters given in code come from, by name, e.g.\n ``{"home_dashboard": "__init__.py", "title": "--title"}``. The admin\n view names it on each setting the parameter locks. `flowdash serve`\n fills it in.') class-attribute instance-attribute

sidebar = Children(default=[], doc='Items prepended to the sidebar.') class-attribute instance-attribute

store = param.ClassSelector(class_=BaseAssetStore, doc='Dashboard store instance for persistence.') class-attribute instance-attribute

suggest_questions = param.Callable(default=None, doc="\n Suggests questions on the Ask home: called with the list of\n :class:`~panel_flowdash.home.DataChip` picked (empty when none is),\n it returns a few questions, or an awaitable of them. A question is a\n string, or a mapping with its ``text``, the ``columns`` it uses\n (shown below it) and an optional Material ``icon``. Called again\n whenever the chips picked change. A coroutine function is awaited\n on the session's event loop and a plain function runs on a worker\n thread, so neither blocks the page; only the newest call's\n questions are shown, and a call that fails keeps the last ones.\n A plain function may run while an older call is still running and\n alongside the session's own work, so it must be thread-safe (make\n it ``async`` to run on the event loop instead), and the awaitable\n it returns must be a coroutine, not a future bound to a loop.\n None suggests nothing.") class-attribute instance-attribute

templates = param.Boolean(default=True, doc="\n Offer dashboard templates when someone creates a dashboard: the ones\n panel-flowdash ships with and those in the project's ``templates/``\n folder, see :mod:`panel_flowdash.templates`.") class-attribute instance-attribute

title = param.String(default='FlowDash', doc='Application title shown in the browser tab.') class-attribute instance-attribute

tool_authorize = param.Callable(default=None, doc='\n Called with ``(identity, tool_name)`` to decide whether the agent may\n offer and call *tool_name* in this session. MCP tools are named\n ``mcp_<server>__<tool>`` (see `panel_flowdash.mcp.parse_mcp_tool_name`).\n Returning False hides the tool from the model and refuses execution;\n exceptions fail closed (False). Read dynamically before each run so\n host apps may attach or wrap it after construction.') class-attribute instance-attribute

trusted_proxies = param.List(default=[], item_type=str, doc="\n IP addresses of reverse proxies whose ``X-Forwarded-For`` header\n names the client. Without sign-in only a client on the server's own\n machine (a loopback address) gets admin rights, and by default that\n is decided by the socket's peer alone: a request that came through\n a proxy, i.e. has forwarding headers, is never local. List the proxy\n here to have the address it forwards checked instead; it must set\n or append ``X-Forwarded-For``, e.g. nginx's\n ``$proxy_add_x_forwarded_for``.") class-attribute instance-attribute

add_section(section)

Register a :class:~panel_flowdash.SidebarSection on this app.

If a section with the same id is already registered, it is replaced. Sections are ordered by their order key and the navigation rail and narrow-screen drawer (when nav_variant="rail") refresh immediately. Note that a routed section added after startup works for in-session navigation only; pass routed sections to :meth:build_routes so direct loads and browser reloads resolve.

assistant_allowed()

Whether the person still gets the assistant, with the permissions read again.

build_routes(project_dir=None, registry=None, **params) classmethod

Generate route mapping for pn.serve.

Registers HTTP routes for the built-in views, every registered page, and every routed :class:~panel_flowdash.SidebarSection supplied via sections (as a sequence or a zero-argument callable returning one) or defined on cls.param.sections.default. Routed sections added later inside a session with :meth:add_section work for in-session navigation only and return 404 on direct load or reload.

navigate(url)

Go to url: a route of the app in place, an http(s):// link in the browser.

notify(severity, message, duration=3000)

Show message to the person, e.g. notify("success", "Saved."), or log it.

severity is "success", "info", "warning" or "error". Without a notification area, e.g. in a session that has none, the message is logged; with notifications off it is dropped.

refresh_sections(section_id=None)

Re-fetch cached sidebar items and update the navigation rail and drawer.

Pass section_id to refresh a single section, or None to refresh every registered section. No-op when nav_variant != "rail" or when section_id is not registered.

remove_section(section_id)

Remove the section with id section_id, returning it or None if absent.

settings_project()

Return the project the admin view writes: project, or the project directory's file.

Without a project file it is flowdash.yaml in the project directory, or the working directory without one, created on the first save.

still_admin()

Whether this session is still an admin, with the project file read again.

A settings view a project section adds (settings_view) that saves on its own asks this before every save.

Identity dataclass

The resolved principal for a session.

groups = field(default_factory=frozenset) class-attribute instance-attribute

oauth_user = None class-attribute instance-attribute

system_user = None class-attribute instance-attribute

user instance-attribute

user_info = field(default_factory=dict) class-attribute instance-attribute

user_names property

All names this identity may be referenced by in a rule.

in_groups(groups)

Whether the identity belongs to any of groups.

is_user(users)

Whether the identity matches any of users (OAuth or system name).

SidebarAction dataclass

An optional create action (e.g. "+ New") shown at the end of a :class:SidebarSection.

Attributes:

Name Type Description
label str

Text shown for the action, e.g. "New report".

action Callable[[SidebarContext], Any] | str

Either a callable action(ctx: SidebarContext) invoked when clicked, or a route/URL string opened through the app's router (or in a new tab if external).

icon str

Material icon name shown beside the label. Defaults to "add".

action instance-attribute

icon = 'add' class-attribute instance-attribute

label instance-attribute

SidebarContext dataclass

Session context passed to :class:SidebarSection and :class:SidebarAction callables.

Attributes:

Name Type Description
app FlowDashApp

The session's :class:~panel_flowdash.app.FlowDashApp instance.

user Identity

The session's resolved :class:~panel_flowdash.Identity.

section SidebarSection

The :class:SidebarSection being evaluated.

app instance-attribute

is_admin property

Whether this session administers the project (cached per session).

Use this for showing or hiding UI. Before performing a privileged write or admin action, re-check with :meth:still_admin.

section instance-attribute

user instance-attribute

navigate(url)

Navigate this session to url.

Internal routes open through the app's router; external http:// and https:// URLs open in a new browser tab.

refresh(section_id=None)

Refresh cached section items; defaults to this section's id.

still_admin()

Whether this session is still an admin, with the project file read again.

SidebarItem dataclass

One destination listed inside a :class:SidebarSection.

Attributes:

Name Type Description
title str

Display label shown in the rail menu and narrow-screen drawer.

url str

App route (e.g. "/reports/q4" or "/reports/view?id=q1") opened through the app's router, or an external http:///https:// URL opened in a new tab.

subtitle str | None

Optional secondary text such as the owner or last updated time. Shown under the item title in the narrow-screen drawer; desktop rail menus show titles only (pmui.MenuButton does not render secondary text).

icon str | None

Optional Material icon name for the item.

icon = None class-attribute instance-attribute

subtitle = None class-attribute instance-attribute

title instance-attribute

url instance-attribute

SidebarSection dataclass

Specification for a navigation section in the FlowDash rail and drawer.

Sidebar sections render only with nav_variant="rail" (the default). A section may either:

  • list destinations via items and/or new_action (rendered as a menu in the desktop rail and an expanded group in the narrow drawer),
  • link directly to a landing route via path (rendered as a single button), or
  • pass a callable path(ctx) returning a route string or None to switch dynamically between direct-link mode and menu mode (as the built-in Dashboards section does for home_dashboard).

Setting both route and view lets the section serve its own routes at /<route> and /<route>/<subpath> through view(ctx, subpath) without appearing in Pages. When route and view are set without items, new_action or path, the section links directly to /<route>.

Attributes:

Name Type Description
id str

Unique section identifier (e.g. "dashboards", "reports"). Must start with an ASCII letter or digit and contain only ASCII letters, digits, "-" or "_". Built-in ids in :data:RESERVED_SECTION_IDS are rejected. Registering a section with an existing id replaces the earlier one.

label str

Heading displayed in the rail button, narrow-screen drawer and breadcrumbs.

icon str

Material icon name for the section (e.g. "space_dashboard").

items Callable[[SidebarContext], Sequence[SidebarItem]] | None

Optional callable items(ctx: SidebarContext) -> Sequence[SidebarItem] returning the destinations visible in this session. Results are cached per refresh and re-fetched when the section's menu or the narrow drawer opens or when :meth:~panel_flowdash.app.FlowDashApp.refresh_sections is called.

order float

Sort key controlling section order (ascending). Ties preserve registration order. The built-in Dashboards section uses 0; custom sections default to 100 so they appear after Dashboards.

new_action SidebarAction | None

Optional :class:SidebarAction (such as "+ New") placed at the end of the section's items.

visible Callable[[SidebarContext], bool] | None

Optional predicate visible(ctx: SidebarContext) -> bool deciding whether the section appears in the navigation and whether its route may be opened.

path str | Callable[[SidebarContext], str | None] | None

Optional landing route (or callable path(ctx: SidebarContext) -> str | None). A static string path cannot be combined with items or new_action; use route and view to serve a landing page alongside items, or a callable path(ctx) to switch modes dynamically.

route str | None

Optional URL prefix served by this section, e.g. "reports" for /reports and /reports/.... Leading and trailing slashes are stripped. Must be paired with view, must not use a prefix in :data:RESERVED_ROUTE_PREFIXES, and must not clash with a registry page section. Subpaths whose final segment is ws, metadata, autoload.js or static (or that contain a static/ segment) are reserved for Bokeh/Panel endpoints and cannot be reloaded directly. Pass routed sections to :meth:~panel_flowdash.app.FlowDashApp.build_routes for direct loads and reloads; routed sections added later via add_section() work in-session only.

view Callable[[SidebarContext, str], Any] | None

Optional callable view(ctx: SidebarContext, path: str) -> Viewable (sync or async) rendering /<route> (path == "") and /<route>/<subpath> (path == "<subpath>"). Must be paired with route.

icon instance-attribute

id instance-attribute

items = None class-attribute instance-attribute

label instance-attribute

new_action = None class-attribute instance-attribute

order = 100 class-attribute instance-attribute

path = None class-attribute instance-attribute

route = None class-attribute instance-attribute

view = None class-attribute instance-attribute

visible = None class-attribute instance-attribute