REAVIZ

Hexagon map

Cards 79

About

Hexagon map large sized

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Hexagon map to your project and fits it to your theme.

Code

How Hexagon map is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import React from 'react';
import HexagonHeatmapReportCard from '@/components/ui/hexagon-map';

function HexagonHeatmapReportCardDemo() {
  const [isDarkMode, setIsDarkMode] = React.useState(false);

  const toggleDarkMode = () => {
    setIsDarkMode(prevMode => {
      const newMode = !prevMode;
      if (newMode) {
        document.documentElement.classList.add('dark');
      } else {
        document.documentElement.classList.remove('dark');
      }
      return newMode;
    });
  };

  React.useEffect(() => {
    const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
    const handleChange = (e: MediaQueryListEvent) => {
      setIsDarkMode(e.matches);
      if (e.matches) {
        document.documentElement.classList.add('dark');
      } else {
        document.documentElement.classList.remove('dark');
      }
    };

    setIsDarkMode(mediaQuery.matches);
    if (mediaQuery.matches) {
      document.documentElement.classList.add('dark');
    }
    
    mediaQuery.addEventListener('change', handleChange);
    return () => mediaQuery.removeEventListener('change', handleChange);
  }, []);

  return (
    <div className="flex flex-col items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900 p-4 transition-colors duration-300">
      <button 
        onClick={toggleDarkMode} 
        aria-pressed={isDarkMode}
        className="mb-4 px-4 py-2 bg-yellow-500 text-white rounded hover:bg-yellow-600 dark:bg-yellow-700 dark:hover:bg-yellow-800 transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-yellow-400"
      >
        Toggle Dark Mode ({isDarkMode ? 'On' : 'Off'})
      </button>
      <HexagonHeatmapReportCard />
    </div>
  );
}

export default HexagonHeatmapReportCardDemo;

Dependencies

More by REAVIZ

View all
  • Funnel Chart Big

    Funnel Chart Big

    156
  • Heat Map XL

    Heat Map XL

    117
  • Stacked Diverging bar

    Stacked Diverging bar

    96
  • Area Chart

    Area Chart

    96
  • Layered Chart XL

    Layered Chart XL

    89
  • Area Chart

    Area Chart

    72
  • Incident Report Large

    Incident Report Large

    60
  • Incident Bar Chart

    Incident Bar Chart

    57

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Photo Deck

    Photo Deck

    47
  • Folded Card

    Folded Card

    45
  • Statistics Card 10

    Statistics Card 10

    304
  • Statistics Card 2

    Statistics Card 2

    309
  • Statistics Card 7

    Statistics Card 7

    336
  • CTA Section

    CTA Section

    6
  • Liquid Glass Card

    Liquid Glass Card

    198