panel.layout.card module#

class panel.layout.card.Card(*objects, **params)[source]#

Bases: Column

A Card layout allows arranging multiple panel objects in a collapsible, vertical container with a header bar.

Reference: https://panel.holoviz.org/reference/layouts/Card.html

Example:

>>> pn.Card(
...     some_widget, some_pane, some_python_object,
...     title='Card', styles=dict(background='WhiteSmoke'),
... )

Methods

select([selector])

Iterates over the Viewable and any potential children in the applying the Selector.

Parameter Definitions


Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, design, height, min_width, min_height, max_width, max_height, margin, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visible

panel.viewable.Viewable: loading

panel.layout.base.ListLike: objects

panel.layout.base.ListPanel: scroll

panel.layout.base.Column: auto_scroll_limit, scroll_button_threshold, scroll_position, view_latest

css_classes = List(bounds=(0, None), default=['card'], label='Css classes', nested_refs=True)

CSS classes to apply to the overall Card.

active_header_background = String(allow_None=True, label='Active header background')

A valid CSS color for the header background when not collapsed.

button_css_classes = List(bounds=(0, None), default=['card-button'], label='Button css classes')

CSS classes to apply to the button element.

collapsible = Boolean(default=True, label='Collapsible')

Whether the Card should be expandable and collapsible.

collapsed = Boolean(default=False, label='Collapsed')

Whether the contents of the Card are collapsed.

header = Parameter(allow_None=True, label='Header')

A Panel component to display in the header bar of the Card. Will override the given title if defined.

header_background = String(default='', label='Header background')

A valid CSS color for the header background.

header_color = String(default='', label='Header color')

A valid CSS color to apply to the header text.

header_css_classes = List(bounds=(0, None), default=['card-header'], label='Header css classes')

CSS classes to apply to the header element.

hide_header = Boolean(default=False, label='Hide header')

Whether to skip rendering the header.

title_css_classes = List(bounds=(0, None), default=['card-title'], label='Title css classes')

CSS classes to apply to the header title.

title = String(default='', label='Title')

A title to be displayed in the Card header, will be overridden by the header if defined.

select(selector: type | Callable[[Viewable], bool] | None = None) list[Viewable][source]#

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters:
selector: type or callable or None

The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns:
viewables: list(Viewable)