duck.native.components.page

Proxy module to duck.html.components.Page with additionals.

Module Contents

Classes

AppPage

Application specific page - this is just a better alternative to the default duck’s Page component.

Data

BASE_CSS

API

class duck.native.components.page.AppPage(request, disable_lively: bool = False, lazy: bool = True, document_event_handlers: Optional[list[Dict[str, Any]]] = None, add_theme_css: bool = True, *args, **kwargs)[source]

Bases: duck.html.components.page.Page

Application specific page - this is just a better alternative to the default duck’s Page component.

Initialization

Initialize the Page component.

Parameters:
  • request – The target HTTP request.

  • disable_lively – This disables Lively components for the page. Defaults to False.

  • lazy – This makes the page not aggressively load the page tree on initialization but let the system decide the right time to load the page. Defaults to True.

  • document_event_handlers – Document-level events to automatically bind. Each dictionary maps an event name to its handler and may include additional keyword arguments forwarded to document_bind(), e.g. document_event_handlers=[{"DOMContentLoaded": on_dom_loaded, **extra_kwargs}].

  • add_theme_css – Adds the CSS variables for the current global theme. Defaults to True.

add_default_body_components()[source]

Add default body components.

on_create()[source]
duck.native.components.page.BASE_CSS = <Multiline-String>