duck.etc.blueprints.welcome.ui.components.nav_footer¶
NavBar and Footer components — top navigation and bottom footer for the welcome page, both linking to the official Duck Framework properties. The navbar also surfaces a link to the project’s dashboard when one is registered.
Module Contents¶
Classes¶
Bottom footer with brand attribution and quick links. |
|
Sticky, glass-effect top navigation bar with brand mark and links. |
Functions¶
Attempts to resolve the project’s dashboard URL. |
API¶
- class duck.etc.blueprints.welcome.ui.components.nav_footer.Footer(element: Optional[str] = None, properties: Optional[Dict[str, str]] = None, props: Optional[Dict[str, str]] = None, style: Optional[Dict[str, str]] = None, inner_html: Optional[Union[str, str, float]] = None, children: Optional[List[duck.html.components.HtmlComponent]] = None, **kwargs)[source]¶
Bases:
duck.html.components.InnerComponentBottom footer with brand attribution and quick links.
Mirrors the navbar links so they remain reachable after scrolling through the full page, and includes the dashboard link when one is registered.
Initialization
Initialize an HTML component.
- Parameters:
element – The HTML element tag name (e.g., textarea, input, button). Can be None, but make sure element is returned by get_element method.
accept_inner_html – Whether the HTML component accepts an inner body (e.g., inner-body-here).
inner_html – Inner html to add to the HTML component. Defaults to None.
properties – Dictionary for properties to initialize the component with.
props – Just same as properties argument (added for simplicity).
style – Dictionary for style to initialize the component with.
**kwargs – Extra keyword arguments
- Raises:
HtmlComponentError – If ‘element’ is not a string or ‘inner_html’ is set but ‘accept_inner_html’ is False.
- build_brand() → duck.html.components.container.Container[source]¶
Returns the footer brand attribution text.
- Returns:
A Container with the brand markup.
- build_links() → duck.html.components.container.Container[source]¶
Returns the row of footer links, including a dashboard link when one is available for this project.
- Returns:
A Container holding the footer link anchors.
- class duck.etc.blueprints.welcome.ui.components.nav_footer.NavBar(element: Optional[str] = None, properties: Optional[Dict[str, str]] = None, props: Optional[Dict[str, str]] = None, style: Optional[Dict[str, str]] = None, inner_html: Optional[Union[str, str, float]] = None, children: Optional[List[duck.html.components.HtmlComponent]] = None, **kwargs)[source]¶
Bases:
duck.html.components.InnerComponentSticky, glass-effect top navigation bar with brand mark and links.
Links to the official site and docs open in a new tab. When the project registers a dashboard route, a “Dashboard” link is shown as the primary call to action.
Initialization
Initialize an HTML component.
- Parameters:
element – The HTML element tag name (e.g., textarea, input, button). Can be None, but make sure element is returned by get_element method.
accept_inner_html – Whether the HTML component accepts an inner body (e.g., inner-body-here).
inner_html – Inner html to add to the HTML component. Defaults to None.
properties – Dictionary for properties to initialize the component with.
props – Just same as properties argument (added for simplicity).
style – Dictionary for style to initialize the component with.
**kwargs – Extra keyword arguments
- Raises:
HtmlComponentError – If ‘element’ is not a string or ‘inner_html’ is set but ‘accept_inner_html’ is False.
- arrow_icon() → str[source]¶
Returns an inline SVG arrow-right icon for the dashboard link.
- Returns:
SVG string.
- build_brand() → duck.html.components.container.Container[source]¶
Returns the brand mark with animated pulse dot.
- Returns:
A Container rendered as an anchor to the official site.
- build_burger() → duck.html.components.container.Container[source]¶
Returns the hamburger button shown only on mobile.
Clicking it toggles the
wc-nav-openclass on the nav, which slides the link drawer into view and animates the burger bars into an X.- Returns:
A Container rendered as a
- build_links() → duck.html.components.container.Container[source]¶
Returns the navigation link list — shown inline on desktop and as a full-width drawer on mobile.
- Returns:
A Container holding the navigation link anchors.
- build_toggle_script() → duck.html.components.container.Container[source]¶
Returns an inline script that wires the burger button toggle.
The script is intentionally tiny — it just flips the
wc-nav-openclass and syncsaria-expanded. All visual logic lives in CSS.- Returns:
A Container rendered as a