Introducing Nuvyx UI v1.0.0

Docs
Animated Code Block

Animated Code Block

A code display component with real-time typing effects. Supports syntax highlighting and customizable themes.

FetchData.tsx

1
2
3
4
5
6
7
8
9
10
11
Typing...
0% complete

Installation

Usage

import { AnimatedCodeBlock } from "@/components/ui/animated-code-block";
<AnimatedCodeBlock
  code={`console.log("Hello world!");`}
  theme="dark"
  typingSpeed={50}
  showLineNumbers={true}
  autoPlay={true}
/>

Props

Animated Code Block

PropTypeDefaultDescription
codestring""The code to display and animate
themestring"dark"The visual theme (dark, terminal, cyberpunk, minimal)
typingSpeednumber50The speed of the typing animation in milliseconds
showLineNumbersbooleantrueWhether to show line numbers
highlightLinesnumber[][]Array of line numbers to highlight
titlestring""Title to display in the header
autoPlaybooleanfalseWhether to start the animation automatically
loopbooleanfalseWhether to loop the animation
blurEffectbooleanfalseWhether to add a terminal blur effect
showControlsbooleantrueWhether to show play/pause and copy controls
onCopy() => voidundefinedCallback function when code is copied
classNamestring""Additional CSS classes to apply