Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelog
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone Select
Forms
Address InputCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverShare DialogSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSetup ChecklistSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadar chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX EditorDOCX ViewerExcel ViewerFile SystemImage compareImage CropperImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Background PatternGravity LettersMarqueeText AnimateText Rotate
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Marketing Sections
App Download SectionBlog Cards SectionCTA SectionFAQ SectionFeature GridFeature ShowcaseHero SectionIntegrations SectionLogo CloudMarketing FooterMarketing HeaderMarketing SectionNewsletter SectionPricing SectionStats SectionSteps SectionTeam SectionTestimonials SectionTimeline SectionVideo Section
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAPI Keys PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowPost Listing WizardPricing PageRegister PageSettings PageUsers Admin Page
Templates
About PageAcademy PageAccessibility PageAffiliate PageAI Product PageBlog PageBlog Post PageBug Bounty PageCareers PageChangelog PageCommunity PageCompare PageContact PageCustomer Story PageCustomers PageDemo Booking PageDevelopers PageDocs Home PageDownload PageEnterprise PageEvents PageExperts PageFAQ PageFeature PageGlossary PageHelp Article PageHelp Center PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePress PageProduct Tour PagePromo PageReferral PageResearch Report PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageSwitch PageTemplate Gallery PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Text & Effects

Text Rotate

Text & Effects

Text Rotate React component for Tailwind CSS v4

Text AnimateAction Sheet
Live props
Behavior
interval2500ms
paused
loop
pauseOnHover
Appearance
effect
by
stagger25ms
tone
color
highlight
Layout
as
State
defaultIndex
Code
import { TextRotate } from "@/components/ui/text-rotate"

<TextRotate />
  1. Home
  2. Components
  3. Text & Effects
  4. Text Rotate
Pro

Text Rotate React component for Tailwind CSS v4

v1.0.0·Added in 1.10.0

A rotating word for headlines that cycles through a list of words or short phrases in place, inside a sentence that reflows to fit each one.

Every few seconds the word slides, fades, blurs or flips to the next one, letter by letter if you like, while the sentence reflows to fit it. Hover or focus it to hold the current word when pauseOnHover is on. It waits while the tab is hidden or the text is off screen, screen readers hear the full list once, and with reduced motion on the current word simply stays.

Text Rotate is a Pro React component in the React effect components category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add text-rotate, together with Motion presets, Tones, UIProvider and useControllableState and the npm package motion.

Add to a project

Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup

npx wingo-ui@latest add text-rotate

Pro item: the CLI needs a Pro account. See plans

Usage

Import TextRotate from @/components/ui/text-rotate.

import { TextRotate } from "@/components/ui/text-rotate"

export function Hero() {
  return (
    <h1 className="text-5xl font-semibold tracking-tight">
      Ship <TextRotate words={["faster", "smarter", "together"]} tone="brand" highlight="pill" />
    </h1>
  )
}

// Letter by letter with a 3D flip:
// <TextRotate words={["design", "build", "launch"]} effect="flip" by="char" />

Props

  • wordsdefault "["faster", "smarter", "together"]"
    string[]

    The words or short phrases to cycle through, in order. A single word just sits still.

  • intervaldefault 2500
    number

    Milliseconds each word stays on screen before the next one comes in.

  • effectdefault "slide-up"
    "slide-up" | "slide-down" | "fade" | "blur" | "flip"

    How words swap. Slides and the 3D flip move on a snappy spring; fade and blur cross-fade on a smooth one.

  • bydefault "word"
    "word" | "char"

    word swaps the whole word at once; char staggers its letters in and out.

  • staggerdefault 25
    number

    With by="char", milliseconds between one letter and the next.

  • tonedefault "inherit"
    "inherit" | "neutral" | "brand" | "success" | "warning" | "danger" | "info"

    Color of the rotating word. inherit keeps the color of the sentence around it; the tones use the readable soft-foreground shade.

  • colordefault ""
    string

    Any CSS color for the rotating word and its highlight. Replaces the tone. Leave empty to use the tone.

  • highlightdefault "none"
    "none" | "underline" | "pill"

    Decoration behind the word that resizes with it: a soft underline, or a rounded pill tinted with the tone.

  • pauseddefault false
    boolean

    Stops the timer and keeps the current word. Changing index still swaps words.

  • loopdefault true
    boolean

    Starts over after the last word. Turn it off to stop on the last one, for a sentence that settles.

  • pauseOnHoverdefault false
    boolean

    Holds the current word while a mouse is over it or keyboard focus is inside it.

  • asdefault "span"
    "span" | "div"

    The root element. span sits inline in a sentence; div for a word on its own line.

  • defaultIndexdefault 0
    number

    The word shown first when the rotation runs on its own.

  • index
    number

    The shown word, for a controlled rotation. Pair it with onIndexChange; the timer still asks for the next index.

  • onIndexChange
    (index: number) => void

    Called with the next index whenever the word changes, from the timer or from outside.

  • classNames
    Partial<Record<"word" | "char" | "highlight", string>>

    Extra classes for the rotating word, each letter in char mode, and the highlight box around it.

  • className
    string

    Extra classes for the root element.

  • ref
    Ref<HTMLElement> (a useRef object or an (el) => void callback)

    The root element.

Parts

  • TextRotateEffect

    type

    The effect names: "slide-up" | "slide-down" | "fade" | "blur" | "flip".

  • TextRotateBy

    type

    The animated unit: "word" | "char".

  • TextRotateHighlight

    type

    The decoration: "none" | "underline" | "pill".

  • TextRotateTone

    type

    A tone from lib/tones, or "inherit" to keep the surrounding text color.

  • TextRotateSlot

    type

    The keys of classNames: "word" | "char" | "highlight".

  • TextRotateProps

    type

    The props of TextRotate, plus every attribute of the root element.

Examples

Hero headline

The default slide-up inside an h1; the line reflows as words change length.

Brand pill

tone="brand" with highlight="pill" and a blur swap; pauseOnHover holds the word under the mouse.

Letter flip

by="char" with the 3D flip; each letter turns over 35ms after the one before it.

Controlled with buttons

index and onIndexChange put the rotation in your hands; paused turns the timer off.

Inside a paragraph

A longer phrase in running text, cross-fading every 3 seconds and wrapping on narrow screens.

Dependencies

motionmotiontonesui-configuse-controllable-state

Files

  • components/ui/text-rotate.tsx

FAQ

Is the React Text Rotate component free?

The preview, props and docs are free; copying the source needs a Pro plan. See plans.

How do I install Text Rotate?

Run npx wingo-ui@latest add text-rotate. It also adds the Wingo UI items it builds on (Motion presets, Tones, UIProvider and useControllableState) and the npm package motion. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/text-rotate.

See also

Text AnimateHero SectionGravity LettersToneslib

More React effect components

Background PatternMarquee
All 5 React effect components
PreviousText AnimateNext Action Sheet
Ship faster, smarter, togetherfaster with Wingo UI

A new word every 2.5s