Scroll area: Peek
Both lists have the same height. With peek, on the right, the box trims itself so the last visible item is cut partway through, which shows there is more to scroll before anyone tries. It never trims the box below half its height.
This adds the example as components/examples/scroll-area/peek.tsx, together with the Scroll area component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/scroll-area-peek.jsonTo add only the component, follow the Scroll area installation.
Props in this example
The Scroll area props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
peekTrim the height so the last visible item is cut partway. Mark items with data-scroll-area-item to choose which elements count. | boolean | false |
className | string | (state) => string | – |
Every prop is in the Scroll area API reference.
- Text
- Start at the bottom
- Horizontal
- Both axes
- Dynamic content
- On a colored surface
- Inside a sheet
- Without fade
- Right to left
See them all, with keyboard support and accessibility notes, on the Scroll area page.
- AccordionStacked headings that each reveal a panel, with height motion you can reverse mid-way and panels that stay searchable while closed.
- Aspect ratioA box that holds its shape before media loads, shimmers while loading, fades the media in and falls back when it fails.
- CarouselNative scroll-snap slides with momentum on touch, mouse dragging, arrow keys, dots, thumbnails and an autoplay that pauses when it should.
- CollapsibleA panel that shows and hides with height motion you can reverse mid-way, without jumping the layout.
- ResizablePanels you can drag apart, with a quiet divider that wakes up on hover, sizes that glide on reset or collapse, and layouts that persist.
- SeparatorA hairline that divides content horizontally or vertically, with an optional label and a decorative mode for purely visual lines.