Skip to content
VenusUI
Get started

3D Text

Text extruded into 3D with stacked shadows that tilts on hover.

Preview

Installation

npx shadcn@latest add @venusui/text-3d

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/text-3d.tsx

Usage

The code behind the preview above.

text-3d-demo.tsx

import { Text3d } from "@/components/ui/text-3d"

export default function Text3dDemo() {
  return <Text3d text="DEPTH" className="text-7xl" />
}

API reference

PropTypeDefaultDescription
textstring—The text. Required.
as"h1" | "h2" | "h3" | "p" | "span""h2"Element to render.
depthnumber8Extrusion depth in layers (about one pixel each).
tiltbooleantrueTilt toward the viewer on hover.
classNamestring—Classes, e.g. a font size and color.

Only the props above.

Requirements

  • Tailwind CSS v4 and a browser with color-mix() support (all current browsers). Works in Server Components.

Customization

  • The face uses the text color and the sides darker mixes of it; set the color with a text class.
  • Large, bold, short words work best.

Accessibility

  • The text stays real text. Shadows are decorative.
  • No tilt with reduced motion.

Troubleshooting

The extrusion is hard to see.
Increase depth, or use a lighter background.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Cards arranged in a ring that turns in 3D, with buttons, arrow keys and announcements.

Loading preview

A CSS-only cube with six content faces that tumbles slowly and pauses on hover.

Loading preview

A tilted wall of vertically scrolling columns, for screenshots and showcases.