Componentcharts0.57 KB gzipZero dependencies
Word Cloud
Word cloud with weight-based font sizing and hover accent.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add word-cloudOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { WordCloud } from "@/components/ui/word-cloud"; <WordCloud />Source code
word-cloud.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxword-cloud.tsx50 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface WordEntry { word: string; weight: number;} export interface WordCloudProps extends React.HTMLAttributes<HTMLDivElement> { words: WordEntry[]; maxFontSize?: number; minFontSize?: number; onWordClick?: (word: string) => void;} /** Tag word cloud: weight-based font size + hover color changes. */Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { WordCloud } from "@/components/ui/word-cloud"; <WordCloud />| Prop | Type | Description |
|---|---|---|
| words | WordEntry[] | Configures words. (Default: []) |
| maxFontSize | number | Configures max font size. (Default: 28) |
| minFontSize | number | Configures min font size. (Default: 11) |
| onWordClick | (word: string) => void | Callback invoked on word click. |