Guide
Getting started
Two files, one script tag, no build step.
1. Add the files
Or take one component and the core only — every component has its own pair of files in dist/components/:
2. Mount a component
Three ways in, in order of precedence — later sources win, so a data attribute overrides the JSON block beneath it.
Data attributes
Attribute names are the prop name in kebab-case, and values are coerced to the prop's declared type — so data-count="12" arrives as a number.
A JSON block
For anything with arrays or objects. This is also the form a CMS should emit.
JavaScript
3. Build a whole page
One JSON document describes an entire link-in-bio page. This is the form the starter templates use.
Validate it against dist/schemas/page.json before you ship it.
4. Theme it
Themes are values-only: token names are identical in light and dark, so switching one touches no component.
To avoid a flash of the wrong theme, set the attribute before first paint:
To restyle rather than re-theme, override the semantic tokens — never the palette ramps, and never a component's internals:
5. Listen for events
Scoping and conflicts
- Every custom property is prefixed
--lb-and every class is prefixedlb-. - Every selector is anchored to
.lb-cor.lb-page, so the kit styles nothing it did not render. - One global is exported:
LinkBio, aliasedLB. Nothing is added to any prototype. - Boot is guarded by
data-lb-booted, so including the script twice is harmless rather than double-binding every control.