ui.card_header

ui.card_header(*args, container=tags.div, **kwargs)

Card header container

A general container for the "header" of a card. This component is designed to be provided as a direct child to card.

The header has a different background color and border than the rest of the card.

Parameters

*args: TagChild | TagAttrs = ()

Contents to the header container. Or tag attributes that are supplied to the resolved Tag object.

container: TagFunction = tags.div

Method for the returned Tag object. Defaults to div.

**kwargs: TagAttrValue = {}

Additional HTML attributes for the returned Tag.

Returns

Type Description
CardItem A CardItem object.

See Also

  • card for creating a card component.
  • card_footer for creating a footer within the card.

Examples

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file: app.py
from shiny import App, ui

app_ui = ui.page_fluid(
    ui.card(
        ui.card_header("This is the header"),
        ui.p("This is the body."),
        ui.p("This is still the body."),
        ui.card_footer("This is the footer"),
        full_screen=True,
    )
)


app = App(app_ui, server=None)