Looping marquee for banners and dividers—theme-aware, accessible, and seamless on any viewport width.
npx shadcn@latest add @iconiq/infiniteribbon"use client";
import { InfiniteRibbon } from "@/components/ui/infiniteribbon";
export function InfiniteRibbonPreview() {
return (
<div className="relative h-full min-h-[24rem] w-full overflow-hidden bg-white">
<div className="absolute top-1/2 left-1/2 z-0 w-[145%] max-w-none -translate-x-1/2 -translate-y-1/2">
<InfiniteRibbon rotation={5}
duration={42}
>
Build fast, responsive, and beautiful interfaces with ready-to-use components. Designed for developers.
</InfiniteRibbon>
</div>
<div className="absolute top-1/2 left-1/2 z-10 w-[145%] max-w-none -translate-x-1/2 -translate-y-1/2">
<InfiniteRibbon reverse rotation={-5}
duration={42}
>
Build fast, responsive, and beautiful interfaces with ready-to-use components. Designed for developers.
</InfiniteRibbon>
</div>
</div>
);
}childrenContent repeated across the moving ribbon. Short announcement copy works best because it stays legible while scrolling.
Type React.ReactNode
itemsOptional list of strings rendered with `separator` between each item instead of a single `children` node.
Type string[]
separatorDivider rendered between `items` entries.
Type React.ReactNode·Default " · "
repeatMinimum number of copies rendered per half of the seamless track. The component auto-expands this value when the viewport is wider than the measured segment.
Type number·Default 5
durationLoop duration in seconds for one half of the track. Ignored when `speed` is set. Values below 0.1 are clamped.
Type number·Default 10
speedOptional scroll speed in pixels per second. When set, loop duration is derived from the measured half-track distance.
Type number
reverseRuns the marquee from left to right instead of the default right-to-left movement.
Type boolean·Default false
rotationDegrees applied to an outer wrapper so additional transforms on the root do not conflict with diagonal banner layouts.
Type number·Default 0
variantBuilt-in surface tone mapped to Iconiq theme tokens instead of hard-coded colors.
Type "default" | "brand" | "warning"·Default "default"
gapSpacing between repeated segments.
Type number | string·Default "2rem"
pauseOnHoverPauses the animation while the ribbon is hovered or contains focused interactive content.
Type boolean·Default true
pauseWhenHiddenPauses the animation while the document tab is hidden to reduce unnecessary work.
Type boolean·Default true
fadeEdgesApplies a soft gradient mask at the viewport edges for a polished marquee fade.
Type boolean·Default false
selectableWhen false, repeated copy uses `select-none` so users cannot highlight moving text.
Type boolean·Default true
hrefTurns each repeated segment into a link. Only the first copy stays tabbable to avoid keyboard traps.
Type string
interactiveKeeps the animated track available to assistive tech. Defaults to `true` when `href` is provided.
Type boolean
aria-labelAccessible name for the announcement region. Falls back to joined `items` or plain-text `children`.
Type string
classNameOptional class names merged onto the root ribbon for positioning, spacing, or typography overrides.
Type string
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: none.
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.