Search or type a command
3
index.ts
utils.ts
styles.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import { useState, useEffect, useCallback } from 'react';
import type { FC, ReactNode } from 'react';

/**
 * Button component with blur effects and multiple variants
 * @param props - The button properties
 * @returns A styled button element
 */
interface ButtonProps {
  label: string;
  onClick: () => void;
  variant?: 'primary' | 'secondary' | 'danger';
  disabled?: boolean;
  children?: ReactNode;
}

const BUTTON_SIZES = {
  small: 24,
  medium: 32,
  large: 48,
} as const;

export const Button: FC<ButtonProps> = ({
  label,
  onClick,
  variant = 'primary',
  disabled = false,
  children,
}) => {
  const [isHovered, setIsHovered] = useState<boolean>(false);
  const [clickCount, setClickCount] = useState(0);

  useEffect(() => {
    if (clickCount > 10) {
      console.warn('Too many clicks!');
    }
  }, [clickCount]);

  const handleClick = useCallback(() => {
    if (!disabled) {
      setClickCount(prev => prev + 1);
      onClick();
    }
  }, [disabled, onClick]);

  // Regular expression for validation
  const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
export const Button: FC<ButtonProps> = ({
CHAT
How can I help you today?
Add blur effects to the UI
PROBLEMS
OUTPUT
DEBUG CONSOLE
TERMINAL
'variant' is declared but never read. [ts(6133)]
Cannot find module './missing' [ts(2307)]
main 0 0 1 1
Ln 15, Col 24 Spaces: 2 UTF-8 TypeScript
Preferences: Open Settings
File: Open File...
Go to File...
Preferences: Color Theme
useState React Hook
useEffect React Hook
useCallback React Hook
userName string
MAX_COUNT number
ButtonProps interface
const useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>]

Returns a stateful value, and a function to update it.

Extension Installed
Theme 2026 has been successfully installed. Reload to apply?

Save Changes?

Do you want to save the changes you made to styles.css?

1 of 3
useState(initialState): [S, Dispatch]
initialState: The initial state value or a function that returns it.
Drag overlays by their handle to test blur over different colors