@opentagcloud/react
v0.6.0
Published
React adapter for openTagCloud — a dependency-free, self-packing, SSR-friendly tag cloud. Works in Next.js (ships 'use client').
Maintainers
Readme
@opentagcloud/react
React adapter for openTagCloud — a dependency-free, self-packing, SSR-friendly tag cloud.
npm install @opentagcloud/reactimport { TagCloud, type TagCloudItem } from '@opentagcloud/react';
const items: TagCloudItem[] = [
{ label: 'JavaScript', weight: 95, href: '/tags/javascript' },
{ label: 'TypeScript', weight: 88 },
{ label: 'Rust', weight: 60 }, // no href → renders as a <span>
];
export function Page() {
return (
<div style={{ height: 320 }}>
<TagCloud items={items} />
</div>
);
}Works in Next.js as-is — the component ships 'use client', so it drops into
the App Router and still server-renders the justified no-JS fallback
(@opentagcloud/next is the same component under a Next-flavored name).
Props (items, minPx, maxPx, fill, className), theming custom
properties, and the layout algorithm are documented in the
project README.
License
MIT © Henry Koren
