New DepthText v1.2.0 is out!

D e p t h
Text .js

CSS-based 3D text layers. No WebGL. No dependencies.

Only 4-6KB 60 FPS TypeScript Ready

Designed for
Modern Web

DepthText is built with performance and accessibility in mind, giving you the power of 3D without the weight of WebGL.

Lightweight

Only 4-6KB minified. No heavy dependencies, just pure vanilla JavaScript magic.

High Performance

Uses CSS 3D transforms and `requestAnimationFrame` for 60fps jank-free animations.

Interactive

Reacts to mouse movement, scroll, or gyroscope. Fully configurable sensitivity.

Live Examples

See DepthText in action with these interactive examples.

Basic Depth Effect

Simple 3D depth with mouse interaction.

Hello World

<h4 data-depth="1.2rem"
   data-depth-layers="8"
   data-depth-event="pointer">
  Hello World
</h4>

Scroll Parallax

Depth effect that reacts to page scrolling.

Scroll Me!

<h4 data-depth="2rem"
   data-depth-layers="12"
   data-depth-event="scroll">
  Scroll Me!
</h4>

Fade Layers

Layers fade out as they get deeper.

Fade Away

<h4 data-depth="1.5rem"
   data-depth-layers="10"
   data-depth-event="pointer"
   data-depth-fade="true">
  Fade Away
</h4>

Direction Control

Control the depth direction and rotation.

Reverse Spin

<h4 data-depth="1rem"
   data-depth-layers="15"
   data-depth-event="pointer"
   data-depth-event-rotation="45deg"
   data-depth-event-direction="reverse">
  Reverse Spin
</h4>

Advanced Examples

More complex implementations showing DepthText's flexibility.

Multiple Elements

Apply DepthText to multiple elements with different settings.

First Second Third

Custom Styling

Combine DepthText with custom CSS for unique effects.

Styled Text

Emoji & Mixed Content

Works perfectly with emojis and unicode.

🚀 Launch! 🌟

<h4 data-depth="1rem" data-depth-event="pointer"> 🚀 Launch! 🌟 </h4>

Why DepthText?

Compare with other 3D text solutions

Feature
DepthText
ztext.jsThree.jsCSS Only
Bundle Size4-6 KB~3 KB~600 KB0 KB
Pointer Events
Scroll Events~
TypeScript SupportN/A
Custom CSS Classes
Performance60 FPS60 FPSVariable60 FPS