One engine, every framework
The Svelte, React, Vue, Angular, SolidJS, and Next.js adapters all use the same deterministic layout shown here — click a tag to open its npm package.
Basic JavaScript
Mount into any element with openTagCloud.mount().
CSS theming
Change two custom properties and the cloud fits right in.
Per-tag color
Use color to reveal categories without changing the layout.
Playground
Three settings, one cloud. density and
fillFactor interact, which is easier to feel than to
read about: raise fill factor to 1 and density stops
appearing to do anything, because the layout grows the type to
absorb whatever space tighter packing just freed up. Pull fill
factor down and the same density changes become obvious.
Words never overlap at any combination, and the layout is deterministic — the same three values always produce the same cloud.
How tightly words cluster. 0 spreads them evenly, 1 packs them around the centre and leaves the corners empty. Default 0.5.
How much of the box to claim. 1 grows the type until the cloud fills it — when crowded the ramp can outgrow the box and a word spills past the edge, by design. 0 keeps the authored size. The library default is 0.75; this demo starts at 0.6 so density stays visible.
How many words to pack. Tags that survive a change keep their position, so adding and removing words animates rather than reshuffling.
No-build custom element
A complete cloud from one <otc-tag-cloud> tag.
Full example pages
Complete, viewable pages straight from the repository — open them to see each integration running on its own.
- Svelte component demo — the prerendered SvelteKit demo app: sizing, theming, and per-tag color.
-
Vanilla / no-build — a
single script tag:
mount()and the<otc-tag-cloud>custom element. -
Right-to-left — the layout
mirrors automatically under
dir="rtl".