컴포넌트 공방: Reflex 라이브러리 100
·
강의 개요
레이아웃
·
Box
·
Flex
·
Stack
·
Grid
·
Container
·
Section
·
Center
·
Spacer
·
Separator
·
Card
·
Inset
·
Aspect Ratio
·
Fragment
타이포그래피
·
Text
·
Heading
·
Link
·
Code
·
Markdown
·
Blockquote
·
Quote
·
Strong
·
Em
·
Kbd
폼
·
Button
·
Input
·
Text Area
·
Checkbox
·
Switch
·
Radio Group
·
Select
·
Slider
·
Form
·
Upload
데이터 표시
·
Badge
·
Avatar
·
Icon
·
Callout
·
List
·
Data List
·
Code Block
·
Progress
·
Spinner
·
Scroll Area
·
Moment
펼침과 전환
·
Tabs
·
Accordion
·
Segmented Control
오버레이
·
Tooltip
·
Popover
·
Hover Card
·
Dialog
·
Alert Dialog
·
Drawer
·
Dropdown Menu
·
Context Menu
·
Toast
동적 렌더링
·
Cond
·
Match
·
Foreach
·
Auto Scroll
미디어
·
Image
·
Audio
·
Video
표와 데이터 그리드
·
Table
·
Data Table
·
Data Editor
차트
·
Area Chart
·
Bar Chart
·
Line Chart
·
Composed Chart
·
Pie Chart
·
Radar Chart
·
Radial Bar Chart
·
Scatter Chart
·
Funnel Chart
·
Treemap
·
Sankey Chart
·
Error Bar
차트 부품
·
Axis
·
Cartesian Grid
·
Chart Tooltip
·
Legend
·
Label
·
Reference
·
Brush
다른 차트 라이브러리
·
Plotly
·
Pyplot
HTML 요소
·
HTML
·
HTML Text
·
HTML Layout
·
HTML Forms
·
HTML Media
·
HTML Tables
·
SVG
그 밖의 도구
·
Theme
·
Skeleton
·
Clipboard
·
Html Embed
·
Script
·
Memo
rx.scroll_area공식 문서
공방 주문서
알림 상자는 높이를 고정하고, 알림이 많아지면 상자 안에서만 스크롤되게 해 주세요.
rx.scroll_area는 정해진 크기 안에서 내용을 스크롤하는 영역입니다. 브라우저의 기본 스크롤 기능을 그대로 쓰면서, 스크롤바만 모든 브라우저에서 같은 모양으로 그립니다. 높이(또는 너비)를 정해 주어야 그 안에서 스크롤이 생깁니다.
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",
)아래 영역은 가로·세로 모두 넘칩니다. scrollbars로 어느 방향을 스크롤할지, type으로 스크롤바가 언제 보일지 정합니다.
속성 바꿔 보기
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",
)| 속성 | 값 | 기본값 | 쓰임 |
|---|---|---|---|
scrollbars | "vertical" "horizontal" "both" | "both" | 스크롤할 방향 |
type | "auto" "always" "scroll" "hover" | "hover" | 스크롤바가 보이는 때 |
scroll_hide_delay | 정수(밀리초) | 600 | scroll·hover일 때 손을 뗀 뒤 막대가 사라지기까지의 시간 |
height / width | CSS 길이 | 없음 | 영역의 크기. 이것을 넘치는 내용이 스크롤된다 |
scrollbars는 스크롤할 축을 정합니다. 왼쪽부터 세로만, 가로만, 양쪽 모두입니다. 가로로 스크롤하려면 안쪽 내용이 영역보다 넓어야 합니다.
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은 스크롤바를 언제 보일지 정합니다.
auto: 내용이 넘칠 때만 보입니다.always: 넘치든 아니든 늘 보입니다.scroll: 그 방향으로 스크롤하는 동안 보입니다.hover: 스크롤하는 동안과 마우스를 영역 위에 올렸을 때 보입니다.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",
)type이 "scroll"이나 "hover"일 때, scroll_hide_delay는 손을 뗀 뒤 막대가 사라질 때까지의 시간(밀리초)입니다. 두 영역을 스크롤하고 손을 떼어 보면 차이가 보입니다.
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",
)카드 안의 알림 목록에 높이를 고정했습니다. 알림이 늘어도 카드 크기는 그대로이고, 마우스를 올리면 스크롤바가 나타납니다.
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",
)공방 노트
rx.scroll_area(내용, height=…)로 정해진 크기 안에서만 스크롤한다.
scrollbars: vertical · horizontal · both(기본).
type: auto · always · scroll · hover(기본). scroll_hide_delay로 사라지는 시간.
스크롤바가 글을 가리지 않게 안쪽 내용에 padding_right를 조금 준다.
새 교시·새 강의 소식 받기
이 강의에 새 교시가 더해지거나 이어지는 강의가 열리면 이메일로 알려 드려요.
R
ReflexKR
눌러 보며 배우는 파이썬과 Reflex. 모든 예제는 Reflex 0.10.0에서 직접 실행해 확인했습니다.
ReflexKR은 배너 광고 없이 무료로 운영돼요. 도움이 되셨다면 커피 한 잔으로 응원해 주세요.
© 2026 ReflexKR · Since 2026 · CC BY-NC 4.0
질문과 답변
이 교시에서 궁금한 점을 남겨 주세요. 모든 언어 페이지의 질문이 함께 모입니다.