nextui.dev
Home
Docs
Saved
Pricing
Components37
  • Forms & inputs7
  • Cards13
  • Buttons, badges & avatars8
  • Feedback & display6
  • Effects3
Agents17
  • Chat inputNew
  • Task checklistNew
  • ReasoningNew
  • Tool callNew
  • Tool approvalNew
  • SourcesNew
  • Agent timelineNew
  • Artifact panelNew
  • Streaming messageNew
  • Conversation shellNew
  • Voice agentNew
  • Voice orbNew
  • Thinking ring
  • Thinking waveNew
  • Thinking sparkle
  • Thinking bot
  • Prompt deckNew
Blocks20
  • Agent chatNew
  • Pill heroNew
  • Grid hero
  • Moodboard generatorNew
  • Waitlist heroNew
  • Intro bannerNew
  • Creative home heroNew
  • Chat heroNew
  • App shelfNew
  • Usage card
  • Design resultsNew
  • Pricing tiers
  • Dashboard home
  • The shiftNew
  • Launch perksNew
  • Testimonials
  • Quote
  • Team
  • Leads tableNew
  • Sign in
Pages10
  • ASCII workspace$49
  • CRM overviewNew
  • Marketing dashboardNew
  • Developer portfolio$49
  • Particle landing$49
  • Particle story$49
  • Statement converter$49
  • AI photo studio$49
  • Group card launch$49
  • Month-end storyNew
Themes9
  • Default
  • Ember
  • Ocean
  • Forest
  • Grape
  • Rose
  • Amber
  • Clay
  • Brutal
Upgrade
nextui.dev

nextui components, blocks and themes you install with one command.

Product

  • Components
  • Blocks
  • Themes
  • Pricing

Resources

  • Docs
  • Roadmap
  • GitHub

Legal

  • License
  • Privacy
  • Terms
  • Refunds

nextUI

[ 200 OK ] · nextUI

© 2026 NEXTUI • All rights reserved.

Upgrade
ComponentsEffectsPerspective text swap
Copy promptCopy prompt

Customize

The phrase shown before the swap

The phrase shown after the swap

Wait before the swap starts, in seconds

0.65s

Duration of each line's rotation, in seconds

0.8s

Delay between each line's animation, in seconds

0.12s

Camera distance for the 3D turn, in pixels; lower is more dramatic

1200px

JSX · copied with Copy prompt

<PerspectiveTextSwap
  beforeText={"Good ideas start small,\nsketched on the back of\na napkin after midnight."}
  afterText={"Great products ship when\nthat sketch becomes a\nscreen people love to use."}
  delay={0.65}
/>

Perspective text swapNew

Replaces one phrase with another in a soft, perspective-driven 3D turn.

Installation

Set your access key from API keys as NEXTUI_TOKEN in .env.local and add the @nextui namespace below to components.json once. Then every item installs by name. Each install counts as a copy on a free account.

$pnpm dlx shadcn@latest add @nextui/perspective-text-swap
1{
2 "registries": {
3 "@nextui": {
4 "url": "https://nextui.dev/r/{name}.json",
5 "headers": { "Authorization": "Bearer ${NEXTUI_TOKEN}" }
6 }
7 }
8}

Usage

1import { PerspectiveTextSwap } from "@/components/nextui/perspective-text-swap";
2
3export function HeroHeadline() {
4 return (
5 <h1 className="text-4xl font-medium tracking-tight">
6 <PerspectiveTextSwap
7 beforeText={"We design and build\nwebsites, brand systems,\nand digital products."}
8 afterText={"Whether you're launching\na product, rebuilding a\nbrand, or refreshing a site."}
9 />
10 </h1>
11 );
12}

API reference

Edit props live in the preview above, or see all 7 props
PropTypeDefaultDescription
beforeTextstring–The phrase shown before the swap
afterTextstring–The phrase shown after the swap
delaynumber1.8Wait before the swap starts, in seconds
durationnumber0.8Duration of each line's rotation, in seconds
staggernumber0.12Delay between each line's animation, in seconds
perspectivenumber1200Camera distance for the 3D turn, in pixels; lower is more dramatic
classNamestring–Extra classes applied to the animated text

Related

All components

Text highlightNew

Flip textNew

Chat inputNew

Sign in to see the code

Preview it freely. A free account copies code and prompts a few times a day.

Sign in