# Marquee

- Page: https://jiguang132.com/resources/magic-ui/docs/marquee
- Resource: Magic UI (https://jiguang132.com/resources/magic-ui.md)
- All guides: https://jiguang132.com/resources/magic-ui/docs.md

Install: `npx shadcn@latest add https://jiguang132.com/r/magic-ui/marquee.json`

## Use case

Loop repeated child content horizontally or vertically.

## Native props used by the examples

Extracted from all local examples for this entry, grouped by imported module and native owner, including other Magic components used by compound demos. This is not an exhaustive API or a universal host variant. Inspect spread object declarations and the source types/defaults below.

| Owning component prop | Explanation | Example source |
| --- | --- | --- |
| `Marquee.pauseOnHover` (marquee) | Pause this marquee while hovered. | `examples/marquee-demo.tsx`、`examples/marquee-demo-vertical.tsx`、`examples/marquee-3d.tsx`、`examples/bento-demo.tsx` |
| `Marquee.className` (marquee) | Classes on this native component; initialize Tailwind and its required CSS first. | `examples/marquee-demo.tsx`、`examples/marquee-demo-vertical.tsx`、`examples/marquee-logos.tsx`、`examples/marquee-3d.tsx`、`examples/bento-demo.tsx` |
| `Marquee.children` (marquee) | Native child content; keep the owning component's text/element constraints. | `examples/marquee-demo.tsx`、`examples/marquee-demo-vertical.tsx`、`examples/marquee-logos.tsx`、`examples/marquee-3d.tsx`、`examples/bento-demo.tsx` |
| `Marquee.reverse` (marquee) | Reverse the owning effect's motion direction. | `examples/marquee-demo.tsx`、`examples/marquee-demo-vertical.tsx`、`examples/marquee-3d.tsx` |
| `Marquee.vertical` (marquee) | Make the marquee scroll vertically. | `examples/marquee-demo-vertical.tsx`、`examples/marquee-3d.tsx` |
| `BentoGrid.children` (bento-grid) | Native child content; keep the owning component's text/element constraints. | `examples/bento-demo.tsx` |
| `BentoCard....feature` (bento-grid) | Props spread from an example object: inspect its declaration and native types; the object name is not a prop. | `examples/bento-demo.tsx` |

## Interaction and state checks

- Marquee Demo — `marquee-demo`
- Marquee Vertical Demo — `marquee-demo-vertical`
- Marquee Logos — `marquee-logos`
- Marquee 3D — `marquee-3d`
- Bento Demo — `bento-demo`

These names identify real example entries, not new component props or extra components. Check pointer/keyboard behavior, themes, small screens and failures for the selected example. Decorative effects must not invent disabled/error/submission states. Complete example installation includes the actual dependency closure.

## Business integration boundary

pauseOnHover does not provide a keyboard pause control. Avoid duplicating focusable links in repeated content without an accessibility review.

## Host and motion setup

Initialize Tailwind CSS v4, semantic CSS variables and the dark variant; import the independent local Registry namespace. Reuse an existing next-themes Provider without substituting JGuang UI/Base UI/HeroUI APIs. Mount effects in view and unmount offscreen; provide static alternatives for unavailable Canvas/WebGL or failed remote media. Respect prefers-reduced-motion and verify timer/RAF/observer/listener cleanup: stopping CSS alone does not prove the engine stopped. Examples provide no backend, login, payment or real AI stream. This practical guide is bilingual; detailed upstream references and demo text retain their original language.


## Available examples

marquee-demo, marquee-demo-vertical, marquee-logos, marquee-3d, bento-demo

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.




## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>
<TabsContent value="cli">

```bash
npx shadcn@latest add @magicui/marquee
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Copy and paste the following code into your project.</Step>



<Step>Update the import paths to match your project setup.</Step>

<Step>Add the required CSS animations</Step>

Add the following animations to your global CSS file.

```css title="app/globals.css" showLineNumbers {2-3, 4-20}
@theme inline {
  --animate-marquee: marquee var(--duration) infinite linear;
  --animate-marquee-vertical: marquee-vertical var(--duration) linear infinite;

  @keyframes marquee {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(calc(-100% - var(--gap)));
    }
  }
  @keyframes marquee-vertical {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(calc(-100% - var(--gap)));
    }
  }
}
```

</Steps>

</TabsContent>

</Tabs>

## Examples

### Vertical



### 3D



## Usage

```tsx showLineNumbers
import { Marquee } from "@/components/ui/marquee"
```

```tsx showLineNumbers
<Marquee>
  <span>Next.js</span>
  <span>React</span>
  <span>TypeScript</span>
  <span>Tailwind CSS</span>
</Marquee>
```

## Props

| Prop           | Type      | Default | Description                                                                  |
| -------------- | --------- | ------- | ---------------------------------------------------------------------------- |
| `className`    | `string`  | `-`     | The class name to apply to the component.                                    |
| `reverse`      | `boolean` | `false` | Whether or not to reverse the direction of the marquee.                      |
| `pauseOnHover` | `boolean` | `false` | Whether or not to pause the marquee when the user hovers over the component. |
| `vertical`     | `boolean` | `false` | Whether or not to display the marquee vertically.                            |
| `children`     | `node`    | `-`     | The content to display in the marquee.                                       |
| `repeat`       | `number`  | `4`     | The number of times to repeat the content.                                   |




## Complete example installation

The component command installs the component. Each example command also includes its actual imported components, native support UI, utilities and pinned dependencies. Helpers are not additional catalog components.

### Marquee Demo

```bash
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/marquee/marquee-demo.json
```

Default import: `@/components/magicui/examples/marquee-demo`

Dependencies: `clsx@2.1.1`, `tailwind-merge@3.6.0`

### Marquee Vertical Demo

```bash
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/marquee/marquee-demo-vertical.json
```

Default import: `@/components/magicui/examples/marquee-demo-vertical`

Dependencies: `clsx@2.1.1`, `tailwind-merge@3.6.0`

### Marquee Logos

```bash
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/marquee/marquee-logos.json
```

Default import: `@/components/magicui/examples/marquee-logos`

Dependencies: `clsx@2.1.1`, `tailwind-merge@3.6.0`

### Marquee 3D

```bash
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/marquee/marquee-3d.json
```

Default import: `@/components/magicui/examples/marquee-3d`

Dependencies: `clsx@2.1.1`, `tailwind-merge@3.6.0`

### Bento Demo

```bash
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/marquee/bento-demo.json
```

Default import: `@/components/magicui/examples/bento-demo`

Dependencies: `@radix-ui/react-icons@1.3.2`, `@radix-ui/react-slot@1.3.0`, `class-variance-authority@0.7.1`, `clsx@2.1.1`, `lucide-react@1.24.0`, `motion@12.42.2`, `react-day-picker@9.14.0`, `tailwind-merge@3.6.0`

### Minimal usage and theme

```tsx
import Demo from '@/components/magicui/examples/marquee-demo';
import { ThemeProvider } from 'next-themes';
export default function Example() {
  return <ThemeProvider attribute="class" defaultTheme="system" enableSystem><Demo /></ThemeProvider>;
}

```

Initialize Tailwind CSS v4, semantic color variables and the dark variant first. Reuse an existing next-themes provider rather than nesting another. Next Link examples require a Next.js environment; in static Vite projects adapt the demo links to your router without changing the native component API. Some media and tweets require network access. Examples do not supply authentication or backend services.


## Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.


```ts
Marquee({
  className,
  reverse = false,
  pauseOnHover = false,
  children,
  vertical = false,
  repeat = 4,
  ...props
}: MarqueeProps)
```



```ts
interface MarqueeProps extends ComponentPropsWithoutRef<"div"> {
  /**
   * Optional CSS class name to apply custom styles
   */
  className?: string
  /**
   * Whether to reverse the animation direction
   * @default false
   */
  reverse?: boolean
  /**
   * Whether to pause the animation on hover
   * @default false
   */
  pauseOnHover?: boolean
  /**
   * Content to be displayed in the marquee
   */
  children: React.ReactNode
  /**
   * Whether to animate vertically instead of horizontally
   * @default false
   */
  vertical?: boolean
  /**
   * Number of times to repeat the content
   * @default 4
   */
  repeat?: number
}
```


### Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.


```ts
// Marquee
reverse = false

// Marquee
pauseOnHover = false

// Marquee
vertical = false

// Marquee
repeat = 4
```


### Native and external types

External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.


```ts
ComponentPropsWithoutRef<"div">
React.ReactNode
```

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
