Code

CodeBlock

Syntax-highlighted code block with line numbers, copy button, and language support using Shiki.

use-debounce.ts
import { useState, useCallback } from 'react';
export function useDebounce<T>(value: T, delay: number): T {  const [debouncedValue, setDebouncedValue] = useState(value);
  useEffect(() => {    const timer = setTimeout(() => setDebouncedValue(value), delay);    return () => clearTimeout(timer);  }, [value, delay]);
  return debouncedValue;}

Props

PropTypeDefaultDescription
codestring-The code content to display
languageBundledLanguage-Programming language for syntax highlighting
showLineNumbersbooleanfalseWhether to display line numbers
classNamestring-Additional CSS classes

Import

import { CodeBlock, CodeBlockHeader, CodeBlockContent, CodeBlockCopyButton } from '@blastx/ui-ai';