shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Multi Section
Sheet with Sticky Header and Footer for React
A right-side product sheet whose middle scrolls between a header and a footer that stay in place.
Header and footer stay put, the middle scrolls. SheetContent is a flex column, the body takes the free height with flex-1 overflow-y-auto, and a Separator marks each edge of the scrolling part. Add to Wishlist and Add to Cart stay in reach however far people scroll.
Preview
Installation
FAQ
How do the header and footer stay in place?
They don't need position: sticky. SheetContent is a flex column, and only the body between them scrolls, with flex-1 overflow-y-auto.
What are the lines above and below the body?
Two Separators, one after SheetHeader and one before SheetFooter. They show where the scrolling part starts and ends.
What's in the scrolling body?
Three sections, Description, Specifications and Reviews, each with an h4 heading. Specifications is a list of four lines.
What do the footer buttons do?
Nothing yet: Add to Wishlist (outline) and Add to Cart are plain Buttons. Wire them to your cart, and close the sheet by controlling its open state if adding should dismiss it:
Pass open to Sheet; onOpenChange receives the next boolean.
Related
- Sheet with Scrollable ContentA right-side sheet whose list of 20 items
- Sheet with Header, Content, and FooterA right-side sheet in three parts: a
- Product Details SheetA right-side sheet with a product image
- Basic ScrollArea Scroll AreaA basic vertical scroll area for long
- Standard DialogA share dialog with a read-only link, a
- Sheet with Action Buttons in FooterA right-side task sheet with name