apps/docs/content/docs/react/migration/(components)/scroll-shadow.mdx
In v2, ScrollShadow was a wrapper component:
import { ScrollShadow } from "@heroui/scroll-shadow";
export default function App() {
return (
<ScrollShadow>
</ScrollShadow>
);
}
In v3, ScrollShadow has the same basic structure but with more configuration options:
import { ScrollShadow } from "@heroui/react";
export default function App() {
return (
<ScrollShadow>
</ScrollShadow>
);
}
v2: Imported from @heroui/scroll-shadow package
v3: Imported from @heroui/react unified package
v2: visibility prop controlled shadow placement
v3: Enhanced visibility prop with more options and onVisibilityChange callback
v2: Shadow size was fixed or limited customization
v3: size prop allows custom shadow size in pixels
v3: New props available:
size - Shadow size in pixels (default: 40)offset - Scroll offset before showing shadows (default: 0)isEnabled - Enable/disable shadow detection (default: true)hideScrollBar - Hide scrollbar while maintaining scroll functionalityvariant - Shadow effect type (default: fade)onVisibilityChange - Callback when shadow visibility changes<Tabs items={["v2", "v3"]}>
<Tab value="v2">
tsx <ScrollShadow> </ScrollShadow>
</Tab>
<Tab value="v3">
tsx <ScrollShadow size={80} className="max-h-[400px]"> </ScrollShadow>
</Tab>
</Tabs>
<Tabs items={["v2", "v3"]}>
<Tab value="v2">
tsx <ScrollShadow visibility="bottom"> </ScrollShadow>
</Tab>
<Tab value="v3">
```tsx
import { useState } from "react";
import { ScrollShadow } from "@heroui/react";
function App() {
const [visibility, setVisibility] = useState("none");
return (
<>
<p>Shadow state: {visibility}</p>
<ScrollShadow
onVisibilityChange={setVisibility}
className="max-h-[400px]"
>
</ScrollShadow>
</>
);
}
```
<Tabs items={["v2", "v3"]}>
<Tab value="v2">
tsx <ScrollShadow> </ScrollShadow>
</Tab>
<Tab value="v3">
tsx <ScrollShadow variant="fade" className="max-h-[400px]"> </ScrollShadow>
</Tab>
</Tabs>
@heroui/scroll-shadow to @heroui/react@heroui/react