Canvas Text

Animated text component with colorful curved lines rendered on canvas, clipped to the text shape.

Ship landing pages at

Installation

Run the following command

npx shadcn@latest add @aceternity/canvas-text

Examples

Standard

With text

Ship landing pages at

Props

PropTypeDefaultDescriptionRequired
textstring-The text to display with animated background.Yes
classNamestring""Additional CSS classes for the text element.No
backgroundClassNamestring"bg-white dark:bg-neutral-950"Tailwind classes to determine background color for dark mode.No
colorsstring[]["#ff6b6b", "#4ecdc4", "#45b7d1", "#96ceb4", "#ffeaa7", ...]Array of colors for the animated lines. Supports CSS variables.No
animationDurationnumber5Duration in seconds for one complete animation cycle.No
lineWidthnumber1.5Width of the animated lines in pixels.No
lineGapnumber10Vertical gap between lines in pixels.No
curveIntensitynumber60Intensity of the bezier curve animation.No
overlaybooleanfalseIf true, positions the component absolutely for overlay use cases.No

CSS Variable Colors

You can use Tailwind CSS variables for colors:

<CanvasText
  text="Colorful Text"
  colors={[
    "var(--color-blue-500)",
    "var(--color-sky-500)",
    "var(--color-violet-500)",
    "var(--color-teal-500)",
  ]}
/>

Dark Mode

The component automatically adapts to dark mode by detecting the backgroundClassName prop. Pass your page's background color classes to ensure proper rendering:

<CanvasText
  text="Dark Mode Ready"
  backgroundClassName="bg-white dark:bg-neutral-950"
/>

Build websites faster and 10x better than your competitors with

Aceternity UI Pro

Next.js 15, Tailwind CSS v4 and Motion for react powered templates

200+ templates and blocks combined

Ready to copy paste component blocks, save days of development time

Aceternity UI Pro Demo - Light Mode

Access an ever-growing collection of premium, meticulously crafted templates and Component Blocks.

A product by Aceternity
Building in public at @mannupaaji

© 2026 Aceternity Labs LLC. All Rights Reserved.