chat_nav_panel

chat_nav_panel(
    title,
    *content,
    value=None,
    icon=None,
    sidebar=False,
    toolbar=None,
    content_width='min(680px, 100%)',
)

Configure a secondary navigation page for :func:~shinychat.page_chat.

The chat remains mounted on the home page while users navigate to this panel, preserving its current conversation and UI state.

Parameters

Name Type Description Default
title str Non-empty label shown in the page navigation. required
*content TagChild HTML children to display on the page. ()
value str | None Optional unique navigation value. Defaults to title. The value "__home__" is reserved for the main chat page. None
icon TagChild | None Optional HTML child displayed with the navigation label. None
sidebar bool | ChatSidebar Sidebar for this page. False shows no page-specific sidebar, True uses the default conversation-history sidebar, and a :class:~shinychat.types.ChatSidebar supplies a page-specific sidebar. A sidebar created without history= defaults to False here. Raw :class:shiny.ui.Sidebar objects are not supported. False
toolbar TagChild | None Toolbar for this page. None (the default) shows no page-scoped toolbar. An HTML child, typically :func:shiny.ui.toolbar, supplies a page-specific toolbar. None
content_width 'CssUnit' Maximum width for the panel content. Content is centered and receives responsive inline padding. "100%", "100vw", and "100dvw" create a full-bleed panel without component-provided inline padding. 'min(680px, 100%)'

Returns

Name Type Description
ChatNavPanel A navigation-panel configuration for page_chat(pages_navbar=).

Examples

from shiny import ui
from shinychat import chat_nav_panel, chat_sidebar

settings = chat_nav_panel(
    "Settings",
    ui.input_switch("compact", "Compact answers"),
    value="settings",
    sidebar=chat_sidebar(ui.p("Display options")),
)

See Also

: Add navigation panels to a chat page. : Configure a panel’s sidebar.