LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Transforms

Perspective

Also called CSS perspective

A CSS property that sets how far the viewer sits from a 3D scene, so rotated elements look deep up close and flatter from far away.

const features = [
  { title: 'Live preview', text: 'See each change the moment it lands.' },
  { title: 'One-click publish', text: 'Ship to your own domain in seconds.' },
  { title: 'Data browser', text: 'Browse and edit rows without SQL.' }
];

export function FeatureGrid() {
  return (
    // perspective on the parent gives every card one shared vanishing point.
    <div className='grid gap-4 perspective-[900px] sm:grid-cols-3'>
      {features.map((feature) => (
        <article
          key={feature.title}
          // Tailwind's hover: only applies on devices that can hover, so touch skips the tilt.
          className='rounded-2xl border bg-background p-6 shadow-sm transition-transform duration-300 ease-out motion-safe:hover:-rotate-y-12'
        >
          <h3 className='font-semibold'>{feature.title}</h3>
          <p className='mt-1 text-sm text-muted-foreground'>{feature.text}</p>
        </article>
      ))}
    </div>
  );
}
Make the feature cards tilt in 3D on hover: put perspective: 900px on the grid so every card shares one vanishing point, then rotate the hovered card with rotateY(-12deg) over 300ms with an ease-out curve. Skip the tilt on touch devices and when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is Perspective?

Without perspective, rotateY(50deg) just squeezes an element horizontally and it looks flat. perspective: 800px on the parent places a virtual viewer 800px from the screen: the edge that turns toward you grows and the far edge shrinks. Smaller values put the viewer closer and exaggerate the depth; larger values make it subtler.

There are two ways to add it. The perspective property on a parent gives all of its children one shared vanishing point, so a row of tilted cards looks like one scene. The perspective() function inside an element's own transform gives just that element its own, and it must come before the rotation in the list. perspective-origin moves the vanishing point.

Values between 600 and 1200px feel natural for cards and flips; 200 to 400px looks dramatic and distorted. If a 3D rotation looks flat, a missing perspective is usually the reason.

Related terms

All terms

3D flip

A card that turns over in 3D to reveal a second face on its back, built with `rotateY` and `backface-visibility: hidden`.

3D tilt card

A card that tips in 3D as the mouse moves over it, often with a moving glare, so it feels like a physical object in your hand.

Rotate

A CSS transform that turns an element around its transform origin by an angle, such as `rotate(45deg)`.

Parallax scrolling

A scroll effect where background layers move slower than the foreground, which creates a sense of depth as the page scrolls.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit
perspective

none

perspective

400px