PetalComponents.Showcase.Registry (petal_components v4.6.0)

Copy Markdown View Source

The index of every showcase module.

Hand-maintained (explicit over magic) - a test asserts that every PetalComponents.Showcase.* example module is listed here, so the list can't silently fall out of date. Surfaces use get/1 to resolve a slug from a route and all/0 to enumerate.

Summary

Functions

Every showcase module, sorted by title.

The showcase module for a slug (e.g. "border-beam"), or nil.

A {slug, title} list, handy for building navigation.

Functions

all()

@spec all() :: [module()]

Every showcase module, sorted by title.

get(slug)

@spec get(String.t() | atom()) :: module() | nil

The showcase module for a slug (e.g. "border-beam"), or nil.

index()

@spec index() :: [{String.t(), String.t()}]

A {slug, title} list, handy for building navigation.