Componentcharts0.57 KB gzipZero dependencies

Word Cloud

Word cloud with weight-based font sizing and hover accent.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add word-cloud

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { WordCloud } from "@/components/ui/word-cloud"; <WordCloud />

Source code

word-cloud.tsx + 1 helper

Zero 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 />
PropTypeDescription
wordsWordEntry[]Configures words. (Default: [])
maxFontSizenumberConfigures max font size. (Default: 28)
minFontSizenumberConfigures min font size. (Default: 11)
onWordClick(word: string) => voidCallback invoked on word click.