Componentcharts1.06 KB gzipZero dependencies
World Map
Stylized world map grid with region value intensity and hover readout.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add world-mapOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { WorldMap } from "@/components/ui/world-map"; <WorldMap />Source code
world-map.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxworld-map.tsx95 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CountryValue { /** ISO 2 harf kod */ code: string; value: number;} export interface WorldMapProps extends React.HTMLAttributes<SVGSVGElement> { data: CountryValue[]; /** Maximum density value for color scaling */ height?: number; onCountryHover?: (code: string | null) => void;} Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { WorldMap } from "@/components/ui/world-map"; <WorldMap />| Prop | Type | Description |
|---|---|---|
| data | CountryValue[] | Dataset array rendered in charts, grids, or tables. (Default: []) |
| height | number | Maximum density value for color scaling |
| onCountryHover | (code: string | null) => void | Callback invoked on country hover. |