duck.etc.blueprints.welcome.ui.components.stats_ticker

StatsTicker component — a horizontal row of animated count-up stats displayed between the hero and features sections.

Module Contents

Classes

StatsTicker

Displays key framework stats with count-up animation on scroll.

API

class duck.etc.blueprints.welcome.ui.components.stats_ticker.StatsTicker(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.InnerComponent

Displays key framework stats with count-up animation on scroll.

Stats are hardcoded marketing figures. They animate from zero on first viewport entry via IntersectionObserver in JS.

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.

STATS

[(‘Pure Python’, ‘100’, ‘%’), (‘Built-in Components’, ‘40’, ‘+’), (‘Lines to Hello World’, ‘5’, ‘’),…

build_stat(label: str, value: str, suffix: str) duck.html.components.container.Container[source]

Returns a single stat column with number and label.

Parameters:
  • label – Descriptive label shown below the number.

  • value – The numeric target for the count-up animation.

  • suffix – Optional character appended after the number (%, +, etc.).

Returns:

A Container styled as a stat item.

get_element() str[source]
Returns:

The HTML element tag for this component.

on_create() None[source]

Builds the stats ticker row with dividers between items.