Header Widgets#

class BasicHeader(header_level: Optional[int] = None, header_type: Optional[str] = None, header_text: Optional[str] = None, css_class: Optional[str] = None, css_id: Optional[str] = None, badge_text: Optional[str] = None, badge_class: Optional[str] = None, badge_rounded_pill: Optional[bool] = None, **kwargs)[source]#

Bases: TemplateWidget

The base header class, which contains the bulk of the functionality.

Keyword Arguments:
  • header_level – the header depth, as in h1, h2, h3…

  • header_type – the Boostrap 5 header class, either h-, or display-.

  • header_text – the text of the header.

  • css_class – any css classes to apply to the header.

  • css_id – an ID to add to the header div.

  • badge_text – text to add in a badge to the right of the main header text.

  • badge_class – the css class to add to the badge.

template_name: str = 'wildewidgets/header_with_controls.html'#

The name of the template to use to render this widget

class CardHeader(widget: Optional[Block] = None, **kwargs)[source]#

Bases: HeaderWithWidget

Provides a standard card header.

class HeaderWithCollapseButton(collapse_id: Optional[str] = None, button_text: Optional[str] = None, button_class: Optional[str] = None, **kwargs)[source]#

Bases: BasicHeader

Deprecated since version 0.13.45: Use HeaderWithWidget instead.

template_name: str = 'wildewidgets/header_with_collapse_button.html'#

The name of the template to use to render this widget

class HeaderWithFormButton(url: Optional[str] = None, button_text: Optional[str] = None, **kwargs)[source]#

Bases: BasicHeader

Header with a button that submits a form.

Deprecated since version 0.13.45: Use HeaderWithWidget instead.

template_name: str = 'wildewidgets/header_with_form_button.html'#

The name of the template to use to render this widget

class HeaderWithLinkButton(url: Optional[str] = None, link_text: Optional[str] = None, button_class: Optional[str] = None, **kwargs)[source]#

Bases: BasicHeader

Header with button that links to something.

Deprecated since version 0.13.45: Use HeaderWithWidget instead.

template_name: str = 'wildewidgets/header_with_link_button.html'#

The name of the template to use to render this widget

class HeaderWithModalButton(**kwargs)[source]#

Bases: BasicHeader

Deprecated since version 0.13.45: Use HeaderWithWidget instead.

template_name: str = 'wildewidgets/header_with_modal_button.html'#

The name of the template to use to render this widget

class HeaderWithWidget(widget: Optional[Block] = None, **kwargs)[source]#

Bases: BasicHeader

The base class for more complex headers with buttons or other widgets attached. It can be used stand-alone.

Keyword Arguments:

widget – the widget to add to the header.

add_collapse_button(**kwargs)[source]#

Add a form button to the end of the headers. The arguments are those of the wildewidgets.CollapseButton.

add_form_button(**kwargs)[source]#

Add a form button to the end of the headers. The arguments are those of the wildewidgets.FormButton.

Add a form button to the end of the headers. The arguments are those of the wildewidgets.LinkButton.

add_modal_button(**kwargs)[source]#

Add a modal button to the end of the headers. The arguments are those of the wildewidgets.ModalButton.

set_widget(widget: Block)[source]#

Add a widget to the header.

template_name: str = 'wildewidgets/header_with_widget.html'#

The name of the template to use to render this widget

class PageHeader(widget: Optional[Block] = None, **kwargs)[source]#

Bases: HeaderWithWidget

Provides a standard page header.

class WidgetListLayoutHeader(widget: Optional[Block] = None, **kwargs)[source]#

Bases: HeaderWithWidget

Provides a standard wildewidgets.WidgetListLayout header.