# Scroll Text Reveal

> Words brighten one by one as the paragraph scrolls into view.

```tsx
import { ScrollTextReveal } from '@brand-studio/ui';

export default function ScrollTextRevealDemo() {
  return (
    <div style={{ padding: '30vh 0' }}>
      <ScrollTextReveal text="We roast on Tuesdays, ship on Wednesdays, and answer every email ourselves. Scroll slowly: each word brightens as it reaches the middle of the screen." />
    </div>
  );
}
```

## Installation

```sh
npm install @brand-studio/ui
```

React 18 or 19 is a peer dependency. Import the stylesheet once and wrap the app in a brand theme:

```tsx
import '@brand-studio/ui/styles.css';
import { BrandTheme, ScrollTextReveal } from '@brand-studio/ui';
import brand from './brand.json';

<BrandTheme palette={brand.tokens} mode="system">
  {/* your app */}
</BrandTheme>
```

## Usage

```tsx
import { ScrollTextReveal } from '@brand-studio/ui';
```

```tsx
<ScrollTextReveal text="We roast on Tuesdays…" />
```

## Accessibility

- Uses CSS scroll-driven animation. Browsers without it, and readers who prefer reduced motion, see the text at full strength.
- The text stays one paragraph for screen readers.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `text` | `string` | – |
| `as?` | `React.ElementType` | – |
| `className?` | `string` | `''` |

Source: https://brandstudio.js.org/docs/components/scroll-text-reveal/
