Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Popover

A trigger button that reveals a floating panel.

with sc.Popover('Export requirements'):
    sc.RadioGroup('Mirror source', options=('PyPI', 'Local'))
    sc.Checkbox('Lock self', value=True)
ArgumentTypeMeaning
labelstr | PropertyTrigger label
widthsize keywordTrigger width, default 'content'
helpstr | PropertyTooltip on the trigger
enabledbool | PropertyWhether the trigger accepts clicks
panel_align'trigger' | 'row' | 'above'Panel placement
panel_max_heightintCap the panel height; it scrolls
visiblebool | PropertyWhether the trigger is shown

Properties: text, visible.

Signals: on_open, on_close.

Placement

  • 'trigger' (default): the panel opens under the trigger.
  • 'row': the panel stretches across the surrounding Row.
  • 'above': the panel opens above the trigger. Use this when the trigger sits at the bottom of a scrollable box, where a downward panel would be clipped.

Opening and closing

Open and close are handled in the browser and do not reach the server. Two signals report the ends:

@popover.on_open
def _():
    refresh_preview()

@popover.on_close
def _():
    clear_preview()

Calling popover.close() asks the client to fold the panel away while leaving the trigger in place. This is how a widget such as SingleTreeSelect dismisses its own panel after a Confirm.

Server-side state

The open / closed state lives in the browser; the server cannot read it. Use on_open and on_close when work should happen only while the panel is up.