The Component Workshop: Reflex's 100 Library Components
·
Course overview
Layout
·
Box
·
Flex
·
Stack
·
Grid
·
Container
·
Section
·
Center
·
Spacer
·
Separator
·
Card
·
Inset
·
Aspect Ratio
·
Fragment
Typography
·
Text
·
Heading
·
Link
·
Code
·
Markdown
·
Blockquote
·
Quote
·
Strong
·
Em
·
Kbd
Forms
·
Button
·
Input
·
Text Area
·
Checkbox
·
Switch
·
Radio Group
·
Select
·
Slider
·
Form
·
Upload
Data display
·
Badge
·
Avatar
·
Icon
·
Callout
·
List
·
Data List
·
Code Block
·
Progress
·
Spinner
·
Scroll Area
·
Moment
Disclosure
·
Tabs
·
Accordion
·
Segmented Control
Overlay
·
Tooltip
·
Popover
·
Hover Card
·
Dialog
·
Alert Dialog
·
Drawer
·
Dropdown Menu
·
Context Menu
·
Toast
Dynamic rendering
·
Cond
·
Match
·
Foreach
·
Auto Scroll
Media
·
Image
·
Audio
·
Video
Tables and data grids
·
Table
·
Data Table
·
Data Editor
Charts
·
Area Chart
·
Bar Chart
·
Line Chart
·
Composed Chart
·
Pie Chart
·
Radar Chart
·
Radial Bar Chart
·
Scatter Chart
·
Funnel Chart
·
Treemap
·
Sankey Chart
·
Error Bar
Chart parts
·
Axis
·
Cartesian Grid
·
Chart Tooltip
·
Legend
·
Label
·
Reference
·
Brush
Other chart libraries
·
Plotly
·
Pyplot
HTML elements
·
HTML
·
HTML Text
·
HTML Layout
·
HTML Forms
·
HTML Media
·
HTML Tables
·
SVG
Other tools
·
Theme
·
Skeleton
·
Clipboard
·
Html Embed
·
Script
·
Memo
rx.scroll_areaOfficial docs
Workshop order
Give the notification box a fixed height, and when notifications pile up, let them scroll inside the box only.
rx.scroll_area is a region whose content scrolls within a fixed size. It keeps the browser's native scrolling and only draws the scrollbars so they look the same in every browser. You need to set a height (or width) for scrolling to appear inside it.
rx.scroll_area(
rx.flex(
rx.text(
"Three fundamental aspects of typography are legibility, readability, and aesthetics. "
"Although in a non-technical sense legible and readable are often used synonymously, "
"typographically they are separate but related concepts."
),
rx.text(
"Legibility describes how easily individual characters can be distinguished from one another. "
"For instance, if a b and an h, or a 3 and an 8, are difficult to distinguish at small sizes, "
"this is a problem of legibility."
),
rx.text(
"Typographers are concerned with legibility insofar as it is their job to select the correct font to use. "
"Using only uppercase letters reduces legibility."
),
direction="column",
spacing="4",
padding_right="16px",
),
type="always",
scrollbars="vertical",
height="180px",
)The region below overflows both horizontally and vertically. scrollbars decides which direction scrolls, and type decides when the scrollbars show.
Try the props
type
scrollbars
rx.scroll_area(
rx.grid(
*[rx.card(rx.text("Card ", i)) for i in range(1, 41)],
columns="8",
spacing="2",
width="900px",
padding="8px",
),
type="hover",
scrollbars="both",
height="180px",
)| Prop | Values | Default | Use |
|---|---|---|---|
scrollbars | "vertical" "horizontal" "both" | "both" | Scroll direction |
type | "auto" "always" "scroll" "hover" | "hover" | When the scrollbars show |
scroll_hide_delay | Integer (milliseconds) | 600 | With scroll or hover, how long until the bars disappear after you stop |
height / width | CSS length | None | Size of the region; content that exceeds it scrolls |
scrollbars sets which axis scrolls. From the left: vertical only, horizontal only, and both. To scroll horizontally, the inner content must be wider than the region.
rx.grid(
rx.scroll_area(
rx.text("Vertical. " * 40, size="2", padding="8px", padding_right="24px"),
type="always",
scrollbars="vertical",
height="150px",
),
rx.scroll_area(
rx.text("Horizontal. " * 40, size="2", padding="8px", width="700px"),
type="always",
scrollbars="horizontal",
height="150px",
),
rx.scroll_area(
rx.text("Both ways. " * 60, size="2", padding="8px", width="400px"),
type="always",
scrollbars="both",
height="150px",
),
columns="3",
spacing="3",
)type decides when the scrollbars appear.
auto: only when the content overflows.always: always, whether it overflows or not.scroll: while you scroll in that direction.hover: while you scroll and while the mouse is over the region.rx.grid(
*[
rx.scroll_area(
rx.flex(
rx.text("type = '" + t + "'", weight="bold"),
rx.text("Legibility describes how easily individual characters can be distinguished. " * 4, size="2"),
direction="column",
spacing="2",
padding="8px",
padding_right="20px",
),
type=t,
scrollbars="vertical",
height="150px",
)
for t in ["auto", "always", "scroll", "hover"]
],
columns="4",
spacing="3",
)When type is "scroll" or "hover", scroll_hide_delay is the time in milliseconds before the bars disappear after you stop. Scroll both regions and let go to see the difference.
rx.grid(
rx.scroll_area(
rx.text("Hides fast. " * 50, size="2", padding="8px", padding_right="20px"),
type="scroll",
scroll_hide_delay=200,
height="120px",
),
rx.scroll_area(
rx.text("Stays for 3 seconds. " * 40, size="2", padding="8px", padding_right="20px"),
type="scroll",
scroll_hide_delay=3000,
height="120px",
),
columns="2",
spacing="3",
)The notification list inside the card has a fixed height. As notifications pile up the card stays the same size, and the scrollbar appears when you hover.
Notifications
rx.card(
rx.text("Notifications", weight="bold", margin_bottom="2"),
rx.scroll_area(
rx.vstack(
*[
rx.hstack(
rx.avatar(fallback=str(i), size="2", radius="full"),
rx.text("Order #" + str(1000 + i) + " has shipped.", size="2"),
align="center",
padding_right="16px",
)
for i in range(1, 16)
],
spacing="3",
),
type="hover",
scrollbars="vertical",
height="220px",
),
max_width="340px",
)Workshop notes
rx.scroll_area(content, height=…) scrolls only within a fixed size.
scrollbars: vertical · horizontal · both (default).
type: auto · always · scroll · hover (default); scroll_hide_delay sets the fade-out time.
Give the inner content a little padding_right so the scrollbar doesn't cover the text.
Get news about new lessons
We'll email you when this course gets new lessons or a follow-up course opens.
R
ReflexKR
Learn Python and Reflex by doing. Every example was run and verified on Reflex 0.10.0.
ReflexKR is free, with no banner ads. If it helped you, you can support it with a coffee. ☕ Buy us a coffee
Affiliate disclosure© 2026 ReflexKR · Since 2026 · CC BY-NC 4.0
Questions & answers
Ask anything about this lesson. Questions from every language version of this page appear together.