Get Started
Components
- Accordion
- Attachment
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Code Block
- Collapsible
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Label
- Marker
- Message
- Number Flow
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Slider
- Sonner
- Spinner
- Switch
- Tooltip
- Separator
- Sheet
- Tabs
- Textarea
- Toggle
- Toggle Group
- Trace
AI Elements
Libraries
Utilities
Item 1
Item 2
Item 3
export function ScrollFadeOverflow() {
return (
<div className="mx-auto w-full max-w-xs overflow-hidden rounded-2xl border">
<div className="scroll-fade no-scrollbar overflow-y-auto">
<div className="flex flex-col gap-1.5 p-1.5">
{Array.from({ length: 3 }, (_, index) => (
<div
className="bg-muted rounded-lg px-3 py-2.5 text-sm"
key={index}
>
Item {index + 1}
</div>
))}
</div>
</div>
</div>
);
}Scroll fade adds a mask-image gradient to the edges of a scroll container so content dissolves into the background when there is more content beyond the visible area.
Usage
| Class | Styles |
|---|---|
scroll-fade | Fade on both vertical edges, scroll-aware. |
scroll-fade-x | Fade on both horizontal edges, scroll-aware. |
scroll-fade-t | Fade on the top edge only. |
scroll-fade-b | Fade on the bottom edge only. |
scroll-fade-l | Fade on the left edge only. |
scroll-fade-r | Fade on the right edge only. |
scroll-fade-s | Fade on the logical start edge. |
scroll-fade-e | Fade on the logical end edge. |
scroll-fade-none | Remove the fade. |
No Overflow, No Fade
Item 1
Item 2
Item 3
export function ScrollFadeOverflow() {
return (
<div className="mx-auto w-full max-w-xs overflow-hidden rounded-2xl border">
<div className="scroll-fade no-scrollbar overflow-y-auto">
<div className="flex flex-col gap-1.5 p-1.5">
{Array.from({ length: 3 }, (_, index) => (
<div
className="bg-muted rounded-lg px-3 py-2.5 text-sm"
key={index}
>
Item {index + 1}
</div>
))}
</div>
</div>
</div>
);
}Horizontal
Design
Engineering
Marketing
Product
Research
Sales
Support
Operations
Finance
Legal
People
Security
const tags = [
"Design",
"Engineering",
"Marketing",
"Product",
"Research",
"Sales",
"Support",
"Operations",
"Finance",
"Legal",
"People",
"Security",
];
export function ScrollFadeHorizontal() {
return (
<div className="mx-auto w-full max-w-xs overflow-hidden rounded-2xl border">
<div className="scroll-fade-x no-scrollbar overflow-x-auto">
<div className="flex w-max gap-1.5 p-1.5">
{tags.map((tag) => (
<div
className="bg-muted shrink-0 rounded-lg px-3 py-2.5 text-sm"
key={tag}
>
{tag}
</div>
))}
</div>
</div>
</div>
);
}Edges
Inbox triage
Design review
API contract
QA pass
Launch notes
Metrics follow-up
Inbox triage
Design review
API contract
QA pass
Launch notes
Metrics follow-up
Design
Engineering
Marketing
Product
Research
Sales
Support
Operations
Design
Engineering
Marketing
Product
Research
Sales
Support
Operations
const items = [
"Inbox triage",
"Design review",
"API contract",
"QA pass",
"Launch notes",
"Metrics follow-up",
];
const tags = [
"Design",
"Engineering",
"Marketing",
"Product",
"Research",
"Sales",
"Support",
"Operations",
];
function Items() {
return (
<div className="flex flex-col gap-1.5 p-1.5">
{items.map((item) => (
<div className="bg-muted rounded-lg px-3 py-2.5 text-sm" key={item}>
{item}
</div>
))}
</div>
);
}
function Tags() {
return (
<div className="flex w-max gap-1.5 p-1.5">
{tags.map((tag) => (
<div
className="bg-muted shrink-0 rounded-lg px-3 py-2.5 text-sm"
key={tag}
>
{tag}
</div>
))}
</div>
);
}
export function ScrollFadeEdge() {
return (
<div className="mx-auto flex max-w-xs min-w-0 flex-col gap-6">
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade-t no-scrollbar h-36 overflow-y-auto">
<Items />
</div>
</div>
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade-b no-scrollbar h-36 overflow-y-auto">
<Items />
</div>
</div>
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade-s no-scrollbar overflow-x-auto">
<Tags />
</div>
</div>
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade-e no-scrollbar overflow-x-auto">
<Tags />
</div>
</div>
</div>
);
}Fade Size
Use arbitrary value syntax [--scroll-fade-size:1rem] to change the fade depth.
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
function Items() {
return (
<div className="flex flex-col gap-1.5 p-1.5">
{Array.from({ length: 8 }, (_, i) => (
<div className="bg-muted rounded-lg px-3 py-2.5 text-sm" key={i}>
Item {i + 1}
</div>
))}
</div>
);
}
export function ScrollFadeSize() {
return (
<div className="mx-auto flex w-full max-w-xs flex-col gap-6">
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade no-scrollbar h-48 overflow-y-auto [--scroll-fade-size:1rem]">
<Items />
</div>
</div>
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade no-scrollbar h-48 overflow-y-auto [--scroll-fade-size:6rem]">
<Items />
</div>
</div>
</div>
);
}Disable
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
function Items() {
return (
<div className="flex flex-col gap-1.5 p-1.5">
{Array.from({ length: 8 }, (_, i) => (
<div className="bg-muted rounded-lg px-3 py-2.5 text-sm" key={i}>
Item {i + 1}
</div>
))}
</div>
);
}
export function ScrollFadeNone() {
return (
<div className="mx-auto flex max-w-xs min-w-0 flex-col gap-6">
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade no-scrollbar h-48 overflow-y-auto">
<Items />
</div>
</div>
<div className="overflow-hidden rounded-2xl border">
<div className="scroll-fade no-scrollbar scroll-fade-none h-48 overflow-y-auto">
<Items />
</div>
</div>
</div>
);
}Fallback
Scroll-driven animations with static fallback for unsupported browsers.