chat_sidebar

chat_sidebar(*content, history=MISSING, width=280, open='auto', resizable=True)

Configure a sidebar for :func:~shinychat.page_chat.

This creates a shinychat sidebar configuration, not a :class:shiny.ui.Sidebar. Raw Shiny sidebar objects cannot be passed to :func:~shinychat.page_chat or :func:~shinychat.chat_nav_panel.

Parameters

Name Type Description Default
*content TagChild HTML children to display in the sidebar. ()
history bool | MISSING_TYPE Whether to include the conversation-history view for the page’s chat. When omitted, page_chat() defaults to True and chat_nav_panel() defaults to False. MISSING
width 'CssUnit' Initial sidebar width. A positive number is interpreted as pixels; a string may use any valid CSS width. 280
open ChatSidebarOpen | bool Initial desktop state: "open", "closed", "always", or "auto". "always" prevents the sidebar from being collapsed. "auto" lets the page choose an initial state based on the sidebar role and restored history. True and False are aliases for "open" and "closed". 'auto'
resizable bool Whether the sidebar can be resized on desktop. True

Returns

Name Type Description
ChatSidebar A sidebar configuration for page_chat(sidebar=) or chat_nav_panel(sidebar=).

Examples

from shiny import ui
from shinychat import chat_sidebar

sidebar = chat_sidebar(
    ui.p("Project controls"),
    history=True,
    width=320,
    open="auto",
)

See Also

: Create a full-window chat page. : Add a page-specific sidebar.