Back to buttons
"use client";

import * as React from "react";
import { motion, AnimatePresence } from "motion/react";

/* ── sound ── */
let _sa: AudioContext, _sb: AudioBuffer;
const tick = () => {
  if (typeof window === "undefined") return;
  if (!_sa) {
    _sa = new AudioContext();
    _sb = _sa.createBuffer(1, (_sa.sampleRate * 0.003) | 0, _sa.sampleRate);
    const d = _sb.getChannelData(0);
    for (let i = 0; i < d.length; i++)
      d[i] = (Math.random() * 2 - 1) * (1 - i / d.length) ** 4;
  }
  const s = _sa.createBufferSource();
  s.buffer = _sb;
  const g = _sa.createGain();
  g.gain.value = 0.08;
  s.connect(g).connect(_sa.destination);
  s.start();
};

/* ── theme ── */
const CSS = `
.vb{
  --vb-glass:linear-gradient(180deg,rgba(255,255,255,0.78),rgba(255,255,255,0.62));
  --vb-border:rgba(0,0,0,0.06);
  --vb-shadow:0 0 1px rgba(0,0,0,0.04),0 2px 8px rgba(0,0,0,0.04),inset 0 1px 0 rgba(255,255,255,0.8);
  --vb-hi:rgba(0,0,0,0.88);
  --vb-dim:rgba(0,0,0,0.35)
}
.dark .vb,[data-theme="dark"] .vb{
  --vb-glass:linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02));
  --vb-border:rgba(255,255,255,0.07);
  --vb-shadow:0 1px 3px rgba(0,0,0,0.08),inset 0 1px 0 rgba(255,255,255,0.04);
  --vb-hi:rgba(255,255,255,0.88);
  --vb-dim:rgba(255,255,255,0.3)
}`;

/* ── canvas pill helper ── */
function pill(
  ctx: CanvasRenderingContext2D,
  x: number,
  y: number,
  w: number,
  h: number,
  r: number,
) {
  const radius = Math.min(r, w / 2, h / 2);
  ctx.beginPath();
  ctx.moveTo(x + radius, y);
  ctx.lineTo(x + w - radius, y);
  ctx.arcTo(x + w, y, x + w, y + radius, radius);
  ctx.lineTo(x + w, y + h - radius);
  ctx.arcTo(x + w, y + h, x + w - radius, y + h, radius);
  ctx.lineTo(x + radius, y + h);
  ctx.arcTo(x, y + h, x, y + h - radius, radius);
  ctx.lineTo(x, y + radius);
  ctx.arcTo(x, y, x + radius, y, radius);
  ctx.closePath();
  ctx.fill();
}

/* ── component ── */
export interface VisualizerButtonProps {
  audioSrc: string;
  bars?: number;
  barWidth?: number;
  barGap?: number;
  barRadius?: number;
  height?: number;
  sound?: boolean;
  style?: React.CSSProperties;
}

export default function VisualizerButton({
  audioSrc,
  bars = 14,
  barWidth = 3,
  barGap = 2,
  barRadius = 1.5,
  height = 20,
  sound = true,
  style,
}: VisualizerButtonProps) {
  const canvasRef = React.useRef<HTMLCanvasElement>(null);
  const frameRef = React.useRef<number>(0);
  const audioRef = React.useRef<HTMLAudioElement | null>(null);
  const analyserRef = React.useRef<AnalyserNode | null>(null);
  const actxRef = React.useRef<AudioContext | null>(null);
  const srcRef = React.useRef<MediaElementAudioSourceNode | null>(null);
  const dataRef = React.useRef<Uint8Array<ArrayBuffer> | null>(null);
  const [playing, setPlaying] = React.useState(false);
  const cw = bars * barWidth + (bars - 1) * barGap;

  React.useEffect(() => {
    const el = new Audio(audioSrc);
    el.crossOrigin = "anonymous";
    audioRef.current = el;
    el.addEventListener("ended", () => setPlaying(false));
    return () => {
      el.pause();
      el.src = "";
    };
  }, [audioSrc]);

  React.useEffect(() => {
    const cvs = canvasRef.current;
    if (!cvs) return;
    const ctx = cvs.getContext("2d");
    if (!ctx) return;
    const dpr = window.devicePixelRatio || 1;
    cvs.width = Math.round(cw * dpr);
    cvs.height = Math.round(height * dpr);
    const t0 = performance.now();

    const paint = (now: number) => {
      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
      ctx.clearRect(0, 0, cw, height);
      const computed = getComputedStyle(cvs);
      ctx.fillStyle = computed.color;
      const t = (now - t0) / 1000;

      let hasFreq = false;
      if (playing && analyserRef.current) {
        const an = analyserRef.current;
        if (!dataRef.current || dataRef.current.length !== an.frequencyBinCount)
          dataRef.current = new Uint8Array(
            an.frequencyBinCount,
          ) as Uint8Array<ArrayBuffer>;
        an.getByteFrequencyData(dataRef.current);
        for (let j = 0; j < dataRef.current.length; j++) {
          if (dataRef.current[j] > 0) {
            hasFreq = true;
            break;
          }
        }
      }

      for (let i = 0; i < bars; i++) {
        const bx = i * (barWidth + barGap);
        let bh = 3;
        let alpha = 1;
        if (playing && hasFreq && dataRef.current) {
          const idx = Math.floor((i / bars) * dataRef.current.length);
          bh = Math.max(3, (dataRef.current[idx] / 255) * height * 0.95);
        } else if (playing) {
          bh = Math.max(
            3,
            Math.abs(Math.sin(t * 3.2 + i * 0.7)) * height * 0.92,
          );
        } else {
          alpha = 0.3;
        }
        ctx.globalAlpha = alpha;
        pill(ctx, bx, height - bh, barWidth, bh, barRadius);
      }
      ctx.globalAlpha = 1;
      frameRef.current = requestAnimationFrame(paint);
    };

    frameRef.current = requestAnimationFrame(paint);
    return () => cancelAnimationFrame(frameRef.current);
  }, [playing, bars, barWidth, barGap, barRadius, height, cw]);

  const toggle = () => {
    const audio = audioRef.current;
    if (!audio) return;
    if (playing) {
      audio.pause();
      setPlaying(false);
      if (sound) tick();
      return;
    }
    if (!actxRef.current) {
      try {
        const actx = new AudioContext();
        actxRef.current = actx;
        const source = actx.createMediaElementSource(audio);
        srcRef.current = source;
        const analyser = actx.createAnalyser();
        analyser.fftSize = 256;
        analyser.smoothingTimeConstant = 0.8;
        source.connect(analyser);
        analyser.connect(actx.destination);
        analyserRef.current = analyser;
      } catch {}
    }
    audio.play().catch(() => {});
    setPlaying(true);
    if (sound) tick();
  };

  return (
    <>
      <style dangerouslySetInnerHTML={{ __html: CSS }} />
      <motion.button
        className="vb"
        onClick={toggle}
        whileHover={{ scale: 1.04 }}
        whileTap={{ scale: 0.96 }}
        transition={{ type: "spring", stiffness: 500, damping: 30 }}
        style={{
          display: "inline-flex",
          alignItems: "center",
          gap: 8,
          padding: "10px 14px",
          borderRadius: 24,
          border: "1px solid var(--vb-border)",
          background: "var(--vb-glass)",
          boxShadow: "var(--vb-shadow)",
          backdropFilter: "blur(24px)",
          WebkitBackdropFilter: "blur(24px)",
          color: "var(--vb-hi)",
          cursor: "pointer",
          outline: "none",
          userSelect: "none",
          ...style,
        }}
      >
        <AnimatePresence mode="wait" initial={false}>
          {playing ? (
            <motion.svg
              key="pause"
              width="14"
              height="14"
              viewBox="0 0 24 24"
              fill="currentColor"
              initial={{ opacity: 0, scale: 0.5 }}
              animate={{ opacity: 1, scale: 1 }}
              exit={{ opacity: 0, scale: 0.5 }}
              transition={{ type: "spring", stiffness: 500, damping: 25 }}
            >
              <rect x="6" y="4" width="4" height="16" rx="1" />
              <rect x="14" y="4" width="4" height="16" rx="1" />
            </motion.svg>
          ) : (
            <motion.svg
              key="play"
              width="14"
              height="14"
              viewBox="0 0 24 24"
              fill="currentColor"
              initial={{ opacity: 0, scale: 0.5 }}
              animate={{ opacity: 1, scale: 1 }}
              exit={{ opacity: 0, scale: 0.5 }}
              transition={{ type: "spring", stiffness: 500, damping: 25 }}
            >
              <polygon points="5 3 19 12 5 21 5 3" />
            </motion.svg>
          )}
        </AnimatePresence>
        <canvas
          ref={canvasRef}
          style={{ display: "block", width: cw, height, color: "var(--vb-hi)" }}
        />
      </motion.button>
    </>
  );
}

Visualizer Button Demo

By Ruixen

Try the interaction, copy the React source files, or download the complete example.

About Visualizer Button Demo

Visualizer Button Demo is an animated React and Tailwind CSS button by Ruixen. Try the interaction, copy the React source, or download the example with creator credit.

Effects and categories
Hover effects, Animated
Using this example
Copy a TSX file or download the original source and standalone demo. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

registry/example/visualizer-button-demo.tsx

"use client";

import VisualizerButton from "@/registry/ruixenui/visualizer-button";

export default function VisualizerButtonDemo() {
  return (
    <div className="flex items-center justify-center min-h-[400px] gap-4">
      <VisualizerButton audioSrc="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" />
    </div>
  );
}

registry/ruixenui/visualizer-button.tsx

"use client";

import * as React from "react";
import { motion, AnimatePresence } from "motion/react";

/* ── sound ── */
let _sa: AudioContext, _sb: AudioBuffer;
const tick = () => {
  if (typeof window === "undefined") return;
  if (!_sa) {
    _sa = new AudioContext();
    _sb = _sa.createBuffer(1, (_sa.sampleRate * 0.003) | 0, _sa.sampleRate);
    const d = _sb.getChannelData(0);
    for (let i = 0; i < d.length; i++)
      d[i] = (Math.random() * 2 - 1) * (1 - i / d.length) ** 4;
  }
  const s = _sa.createBufferSource();
  s.buffer = _sb;
  const g = _sa.createGain();
  g.gain.value = 0.08;
  s.connect(g).connect(_sa.destination);
  s.start();
};

/* ── theme ── */
const CSS = `
.vb{
  --vb-glass:linear-gradient(180deg,rgba(255,255,255,0.78),rgba(255,255,255,0.62));
  --vb-border:rgba(0,0,0,0.06);
  --vb-shadow:0 0 1px rgba(0,0,0,0.04),0 2px 8px rgba(0,0,0,0.04),inset 0 1px 0 rgba(255,255,255,0.8);
  --vb-hi:rgba(0,0,0,0.88);
  --vb-dim:rgba(0,0,0,0.35)
}
.dark .vb,[data-theme="dark"] .vb{
  --vb-glass:linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02));
  --vb-border:rgba(255,255,255,0.07);
  --vb-shadow:0 1px 3px rgba(0,0,0,0.08),inset 0 1px 0 rgba(255,255,255,0.04);
  --vb-hi:rgba(255,255,255,0.88);
  --vb-dim:rgba(255,255,255,0.3)
}`;

/* ── canvas pill helper ── */
function pill(
  ctx: CanvasRenderingContext2D,
  x: number,
  y: number,
  w: number,
  h: number,
  r: number,
) {
  const radius = Math.min(r, w / 2, h / 2);
  ctx.beginPath();
  ctx.moveTo(x + radius, y);
  ctx.lineTo(x + w - radius, y);
  ctx.arcTo(x + w, y, x + w, y + radius, radius);
  ctx.lineTo(x + w, y + h - radius);
  ctx.arcTo(x + w, y + h, x + w - radius, y + h, radius);
  ctx.lineTo(x + radius, y + h);
  ctx.arcTo(x, y + h, x, y + h - radius, radius);
  ctx.lineTo(x, y + radius);
  ctx.arcTo(x, y, x + radius, y, radius);
  ctx.closePath();
  ctx.fill();
}

/* ── component ── */
export interface VisualizerButtonProps {
  audioSrc: string;
  bars?: number;
  barWidth?: number;
  barGap?: number;
  barRadius?: number;
  height?: number;
  sound?: boolean;
  style?: React.CSSProperties;
}

export default function VisualizerButton({
  audioSrc,
  bars = 14,
  barWidth = 3,
  barGap = 2,
  barRadius = 1.5,
  height = 20,
  sound = true,
  style,
}: VisualizerButtonProps) {
  const canvasRef = React.useRef<HTMLCanvasElement>(null);
  const frameRef = React.useRef<number>(0);
  const audioRef = React.useRef<HTMLAudioElement | null>(null);
  const analyserRef = React.useRef<AnalyserNode | null>(null);
  const actxRef = React.useRef<AudioContext | null>(null);
  const srcRef = React.useRef<MediaElementAudioSourceNode | null>(null);
  const dataRef = React.useRef<Uint8Array<ArrayBuffer> | null>(null);
  const [playing, setPlaying] = React.useState(false);
  const cw = bars * barWidth + (bars - 1) * barGap;

  React.useEffect(() => {
    const el = new Audio(audioSrc);
    el.crossOrigin = "anonymous";
    audioRef.current = el;
    el.addEventListener("ended", () => setPlaying(false));
    return () => {
      el.pause();
      el.src = "";
    };
  }, [audioSrc]);

  React.useEffect(() => {
    const cvs = canvasRef.current;
    if (!cvs) return;
    const ctx = cvs.getContext("2d");
    if (!ctx) return;
    const dpr = window.devicePixelRatio || 1;
    cvs.width = Math.round(cw * dpr);
    cvs.height = Math.round(height * dpr);
    const t0 = performance.now();

    const paint = (now: number) => {
      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
      ctx.clearRect(0, 0, cw, height);
      const computed = getComputedStyle(cvs);
      ctx.fillStyle = computed.color;
      const t = (now - t0) / 1000;

      let hasFreq = false;
      if (playing && analyserRef.current) {
        const an = analyserRef.current;
        if (!dataRef.current || dataRef.current.length !== an.frequencyBinCount)
          dataRef.current = new Uint8Array(
            an.frequencyBinCount,
          ) as Uint8Array<ArrayBuffer>;
        an.getByteFrequencyData(dataRef.current);
        for (let j = 0; j < dataRef.current.length; j++) {
          if (dataRef.current[j] > 0) {
            hasFreq = true;
            break;
          }
        }
      }

      for (let i = 0; i < bars; i++) {
        const bx = i * (barWidth + barGap);
        let bh = 3;
        let alpha = 1;
        if (playing && hasFreq && dataRef.current) {
          const idx = Math.floor((i / bars) * dataRef.current.length);
          bh = Math.max(3, (dataRef.current[idx] / 255) * height * 0.95);
        } else if (playing) {
          bh = Math.max(
            3,
            Math.abs(Math.sin(t * 3.2 + i * 0.7)) * height * 0.92,
          );
        } else {
          alpha = 0.3;
        }
        ctx.globalAlpha = alpha;
        pill(ctx, bx, height - bh, barWidth, bh, barRadius);
      }
      ctx.globalAlpha = 1;
      frameRef.current = requestAnimationFrame(paint);
    };

    frameRef.current = requestAnimationFrame(paint);
    return () => cancelAnimationFrame(frameRef.current);
  }, [playing, bars, barWidth, barGap, barRadius, height, cw]);

  const toggle = () => {
    const audio = audioRef.current;
    if (!audio) return;
    if (playing) {
      audio.pause();
      setPlaying(false);
      if (sound) tick();
      return;
    }
    if (!actxRef.current) {
      try {
        const actx = new AudioContext();
        actxRef.current = actx;
        const source = actx.createMediaElementSource(audio);
        srcRef.current = source;
        const analyser = actx.createAnalyser();
        analyser.fftSize = 256;
        analyser.smoothingTimeConstant = 0.8;
        source.connect(analyser);
        analyser.connect(actx.destination);
        analyserRef.current = analyser;
      } catch {}
    }
    audio.play().catch(() => {});
    setPlaying(true);
    if (sound) tick();
  };

  return (
    <>
      <style dangerouslySetInnerHTML={{ __html: CSS }} />
      <motion.button
        className="vb"
        onClick={toggle}
        whileHover={{ scale: 1.04 }}
        whileTap={{ scale: 0.96 }}
        transition={{ type: "spring", stiffness: 500, damping: 30 }}
        style={{
          display: "inline-flex",
          alignItems: "center",
          gap: 8,
          padding: "10px 14px",
          borderRadius: 24,
          border: "1px solid var(--vb-border)",
          background: "var(--vb-glass)",
          boxShadow: "var(--vb-shadow)",
          backdropFilter: "blur(24px)",
          WebkitBackdropFilter: "blur(24px)",
          color: "var(--vb-hi)",
          cursor: "pointer",
          outline: "none",
          userSelect: "none",
          ...style,
        }}
      >
        <AnimatePresence mode="wait" initial={false}>
          {playing ? (
            <motion.svg
              key="pause"
              width="14"
              height="14"
              viewBox="0 0 24 24"
              fill="currentColor"
              initial={{ opacity: 0, scale: 0.5 }}
              animate={{ opacity: 1, scale: 1 }}
              exit={{ opacity: 0, scale: 0.5 }}
              transition={{ type: "spring", stiffness: 500, damping: 25 }}
            >
              <rect x="6" y="4" width="4" height="16" rx="1" />
              <rect x="14" y="4" width="4" height="16" rx="1" />
            </motion.svg>
          ) : (
            <motion.svg
              key="play"
              width="14"
              height="14"
              viewBox="0 0 24 24"
              fill="currentColor"
              initial={{ opacity: 0, scale: 0.5 }}
              animate={{ opacity: 1, scale: 1 }}
              exit={{ opacity: 0, scale: 0.5 }}
              transition={{ type: "spring", stiffness: 500, damping: 25 }}
            >
              <polygon points="5 3 19 12 5 21 5 3" />
            </motion.svg>
          )}
        </AnimatePresence>
        <canvas
          ref={canvasRef}
          style={{ display: "block", width: cw, height, color: "var(--vb-hi)" }}
        />
      </motion.button>
    </>
  );
}

demo.tsx

export { default as default } from "@/registry/example/visualizer-button-demo";

CSS

/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
  :root, :host {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
      "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --spacing: 0.25rem;
    --default-transition-duration: 150ms;
    --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}
@layer base {
  *, ::after, ::before, ::backdrop, ::file-selector-button {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
  }
  html, :host {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }
  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }
  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }
  b, strong {
    font-weight: bolder;
  }
  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }
  small {
    font-size: 80%;
  }
  sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }
  sub {
    bottom: -0.25em;
  }
  sup {
    top: -0.5em;
  }
  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  :-moz-focusring:where(:not(iframe)) {
    outline: auto;
  }
  progress {
    vertical-align: baseline;
  }
  summary {
    display: list-item;
  }
  ol, ul, menu {
    list-style: none;
  }
  img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
  }
  img, video {
    max-width: 100%;
    height: auto;
  }
  button, input, select, optgroup, textarea, ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
  }
  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }
  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }
  ::file-selector-button {
    margin-inline-end: 4px;
  }
  ::placeholder {
    opacity: 1;
  }
  @supports (not (-webkit-appearance: -apple-pay-button))  or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentcolor;
      @supports (color: color-mix(in lab, red, red)) {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }
  textarea {
    resize: vertical;
  }
  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }
  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }
  ::-webkit-datetime-edit {
    display: inline-flex;
  }
  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }
  ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }
  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }
  :-moz-ui-invalid {
    box-shadow: none;
  }
  button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
    appearance: button;
  }
  ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
    height: auto;
  }
  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
}
@layer utilities {
  .block {
    display: block;
  }
  .flex {
    display: flex;
  }
  .inline-flex {
    display: inline-flex;
  }
  .min-h-\[400px\] {
    min-height: 400px;
  }
  .items-center {
    align-items: center;
  }
  .justify-center {
    justify-content: center;
  }
  .gap-4 {
    gap: calc(var(--spacing) * 4);
  }
  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }
  .outline {
    outline-style: var(--tw-outline-style);
    outline-width: 1px;
  }
  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }
}
:root {
  --background: #fff;
  --foreground: #111;
  --primary: #171717;
  --primary-foreground: #fff;
  --secondary: #eee;
  --secondary-foreground: #171717;
  --muted: #eee;
  --muted-foreground: #666;
  --accent: #eee;
  --accent-foreground: #171717;
  --border: #ddd;
  --input: #ddd;
  --ring: #777;
  --destructive: #dc2626;
  --destructive-foreground: #fff;
  --popover: #fff;
  --popover-foreground: #111;
  --success: #15803d;
  --success-foreground: #fff;
  --radius: .625rem;
  --hairline: 1px;
}
.dark {
  --background: #090909;
  --foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #171717;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted: #262626;
  --muted-foreground: #a3a3a3;
  --accent: #262626;
  --accent-foreground: #fafafa;
  --border: #333;
  --input: #333;
  --popover: #171717;
  --popover-foreground: #fafafa;
}
@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}
@property --tw-outline-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}
@layer properties {
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
    *, ::before, ::after, ::backdrop {
      --tw-border-style: solid;
      --tw-outline-style: solid;
    }
  }
}