Skip to content

module

catalogue

Documentation for every component family: a summary, a live usage example, and each part's props and events. Drives the component catalogue page and the language server's hovers, completions and prop checks.

Every part also takes COMMON props: class (merged with the part's own classes — yours win), as (render another element), unstyled (only your classes), and plain attributes and DOM event handlers, which go to its root element.

Anything showing data also takes SOURCE_PROPS, and charts take CHART_PROPS. A part's own entry for one of them wins, for the few where it means something more.

Structs

  • Doc

    Documentation for a family of parts.

  • Part

    One component of a family (CardTitle in the Card family).

  • Prop

    One prop a part reads.

Functions

demo_photo

pub fn demo_photo(name: &str) -> String

A generated landscape (an SVG data URI) for examples and placeholders: dunes, aurora, ocean, forest, canyon, city or nebula.

demo_scope

pub fn demo_scope() -> Scope

Sample data and state used by every [Doc::usage].

doc

pub fn doc(name: &str) -> Option<&'static Doc>

A family by name.

docs

pub fn docs() -> &'static [Doc]

Every family's documentation, in catalogue order.

find_part

pub fn find_part(name: &str) -> Option<(&'static Doc, &'static Part)>

Any part by component name, with its family.

forwarded

pub fn forwarded(name: &str) -> bool

Attributes forwarded to a part's root element.

Constants

CATEGORIES

pub const CATEGORIES: &[&str] = _;

The catalogue's categories, in display order.

CHART_EVENTS

pub const CHART_EVENTS: &[(&str, &str)] = _;

Events every chart emits.

CHART_PROPS

pub const CHART_PROPS: &[Prop] = _;

Props every chart takes.

COMMON

pub const COMMON: &[Prop] = _;

Props every part accepts.

SOURCE_EVENTS

pub const SOURCE_EVENTS: &[(&str, &str)] = _;

Events everything reading a data source emits.

SOURCE_PROPS

pub const SOURCE_PROPS: &[Prop] = _;

Props everything that shows data takes: where the data comes from, how to read it, and how it keeps up to date.