Typography typography3dcreative

3D Stacked Text

Text layers that create a three-dimensional depth effect.

Preview

Component preview not available for: 3d-text-layer

Ensure the filename matches 3dTextLayer.astro

Usage

Copy the full block below to use this component with its imports.

astro
---
import { 3DStackedText } from 'astro-component-kit';
---

<3dTextLayer>Content</3dTextLayer>
--- import { 3DStackedText } from 'astro-component-kit'; --- <3dTextLayer>Content</3dTextLayer>

Manual Installation

If you are not using the npm package, create a new file src/components/lib/3DStackedText.astro and paste the following code:

astro
---
---
<div class="stack-3d"><slot /></div>
<style>
  .stack-3d { font-size: 4rem; font-weight: 900; color: #fff; position: relative; text-shadow: 1px 1px #6366f1, 2px 2px #6366f1, 3px 3px #6366f1, 4px 4px #6366f1; line-height: 1.1; }
  @media (max-width: 768px) { .stack-3d { font-size: 2.5rem; } }
</style>
--- --- <div class="stack-3d"><slot /></div> <style> .stack-3d { font-size: 4rem; font-weight: 900; color: #fff; position: relative; text-shadow: 1px 1px #6366f1, 2px 2px #6366f1, 3px 3px #6366f1, 4px 4px #6366f1; line-height: 1.1; } @media (max-width: 768px) { .stack-3d { font-size: 2.5rem; } } </style>

Quick Info

Category
Typography
Filename
3DStackedText.astro
Dependencies
None — pure Astro + CSS
Tags
typography3dcreative