Documentation
¶
Overview ¶
Package skeleton provides shimmer placeholders rendered with pure CSS.
Use a skeleton during server-side data loads or while a signal-driven island fetches replacement HTML — render the skeleton in the initial HTML, then swap it for the real content when the data resolves.
All variants are visually-only: aria-hidden="true" so screen readers skip them and assistive tech announces the surrounding container's loading state instead.
CSP note: when Width or Height is set on Config, the resulting HTML carries a `style="inline-size:…;block-size:…"` attribute which a strict CSP (`default-src 'self'` without `style-src 'unsafe-inline'`) will block. For strict-CSP hosts, leave Width/Height empty (use the CSS defaults) or pass a custom Class and define the size in your stylesheet.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Style = registry.RegisterStyle("skeleton", styleFn)
Style is the registered stylesheet handle. New's outermost element goes through Style.WrapHTML so the data-fui-comp marker is emitted and the runtime auto-loads the CSS on first appearance.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Variant Variant // default: Line
Width string // CSS length, e.g. "100%", "12rem". Defaults vary by variant.
Height string // CSS length. Default depends on variant.
Count int // number of repeated lines (Line variant only). Default: 1.
Class string
ID string
}
Config configures a skeleton.