InView
Viewport intersection trigger component wrapper.
1.5 KB
•Updated on September 3, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/hooks-components-in-viewUsage
Code
import { InView } from '@/components/in-view'
import { InView } from '@/components/in-view'```
```tsx
<InView fallback={<Skeleton />}>
<ExpensiveChart />
</InView>API Reference
Parameters / Props
| Prop | Type | Default | Description |
|---|---|---|---|
fallback | ReactNode | null | Out of view placeholder. |
children | ReactNode | required | Content when in view. |
Return Value
| Return Type | Description |
|---|---|
ReactNode | Rendered branch. |