# In View

> Reveal content as it scrolls into view, as one block or one child at a time.

Source: https://www.honestui.com/docs/animated/in-view

```tsx
import { ArrowDown } from "honestui/icons";

import { InView } from "@/registry/default/animated/in-view";

const features = [
  { title: "Realtime sync", detail: "Edits appear for everyone within a second." },
  { title: "Version history", detail: "Restore any change from the last 90 days." },
  { title: "Granular access", detail: "Share a single view without the whole workspace." },
  { title: "Audit log", detail: "Every export and permission change, recorded." },
];

export function InViewDemo() {
  return (
    <div className="h-80 w-full max-w-md overflow-y-auto rounded-xl border border-border bg-card [scrollbar-width:none]! [&::-webkit-scrollbar]:hidden!">
      <div className="flex h-72 flex-col items-center justify-center gap-2 text-[13px] text-muted-foreground">
        Scroll inside the card
        <ArrowDown className="size-4" />
      </div>
      <div className="px-5 pb-6">
        <InView once={false} preset="blur">
          <h3 className="text-base font-semibold tracking-tight text-foreground">Built for teams</h3>
          <p className="mt-1 text-[13px] leading-6 text-muted-foreground">
            Everything you need to work on the same thing at the same time.
          </p>
        </InView>
        <InView as="ul" once={false} preset="slide-up" stagger={0.08} className="mt-4 flex flex-col gap-2">
          {features.map((feature) => (
            <div key={feature.title} className="rounded-lg border border-border bg-background px-3 py-2.5">
              <p className="text-[13px] font-medium text-foreground">{feature.title}</p>
              <p className="mt-0.5 text-xs text-muted-foreground">{feature.detail}</p>
            </div>
          ))}
        </InView>
      </div>
    </div>
  );
}

```

## Overview [#overview]

In View plays an entrance when its element scrolls into the viewport. Choose a preset (`fade`, `slide-up`, `slide-down`, `blur`, or `scale`) or pass your own variants. With `stagger`, each direct child is wrapped and enters in turn, which suits lists, feature grids, and timelines.

By default the entrance plays once. Set `once={false}` to replay it whenever the element leaves and comes back. `amount` controls how much of the element must be visible before it starts, and `margin` grows or shrinks the viewport, so an entrance can begin a little before the element reaches the screen.

## Installation [#installation]

<CliBlock commands="[&#x22;in-view&#x22;]" />

## Usage [#usage]

```tsx
import { InView } from "@/components/animated/in-view"

<InView preset="blur">
  <h2>Built for teams</h2>
</InView>

<InView as="ul" preset="slide-up" stagger={0.08}>
  {features.map((feature) => (
    <FeatureCard key={feature.id} {...feature} />
  ))}
</InView>
```

When `as` is `ul` or `ol`, staggered children are wrapped in `li` elements, so pass the item content rather than your own `li`.

## Accessibility [#accessibility]

Content is hidden only visually until it enters, so it stays in the page for screen readers and search. Under reduced motion the entrance keeps a short fade and drops movement, blur, and scale.

Keep entrances short and avoid them on content people need immediately, such as the first screen of a page or an error message. Content revealed on scroll should never be the only place an important instruction appears.

## API Reference [#api-reference]


  ### `children`

type: `ReactNode`

Content to reveal.

  ### `as`

type: `&#x22;div&#x22; | &#x22;section&#x22; | &#x22;article&#x22; | &#x22;header&#x22; | &#x22;footer&#x22; | &#x22;ul&#x22; | &#x22;ol&#x22; | &#x22;li&#x22; | &#x22;span&#x22; | &#x22;p&#x22;` · default: `&#x22;div&#x22;`

Element to render.

  ### `preset`

type: `&#x22;fade&#x22; | &#x22;slide-up&#x22; | &#x22;slide-down&#x22; | &#x22;blur&#x22; | &#x22;scale&#x22;` · default: `&#x22;blur&#x22;`

Entrance style.

  ### `variants`

type: `Variants`

Custom motion variants with 

    `hidden`

     and 

    `visible`

     keys. Overrides 

    `preset`

    .

  ### `stagger`

type: `number` · default: `0`

Seconds between each direct child's entrance. 0 animates the wrapper as one block.

  ### `delay`

type: `number` · default: `0`

Seconds before the entrance starts.

  ### `duration`

type: `number` · default: `0.6`

Entrance duration in seconds.

  ### `once`

type: `boolean` · default: `true`

Play only the first time the element enters.

  ### `amount`

type: `&#x22;some&#x22; | &#x22;all&#x22; | number` · default: `0.25`

How much of the element must be visible.

  ### `margin`

type: `string`

Root margin, such as 

    `"0px 0px -10% 0px"`

    .

  ### `className`

type: `string`

Classes for the wrapper.

  ### `itemClassName`

type: `string`

Classes for each wrapped child when 

    `stagger`

     is set.
