Opening hours
Mon to Fri, 9 am to 6 pm.
컴포넌트 공방: 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.el.addressrx.el.articlerx.el.asiderx.el.blockquoterx.el.bodyrx.el.ddrx.el.del_rx.el.detailsrx.el.dialogrx.el.dlrx.el.dtrx.el.figcaptionrx.el.footerrx.el.h1 ~ h6rx.el.headrx.el.headerrx.el.hrrx.el.htmlrx.el.lirx.el.linkrx.el.mainrx.el.navrx.el.noscriptrx.el.olrx.el.portalrx.el.prerx.el.scriptrx.el.sectionrx.el.templaterx.el.titlerx.el.ul공식 문서
공방 주문서
가게 소식 글 한 편을 머리말, 본문, 곁다리 팁, 접히는 질문, 연락처 바닥글까지 의미 있는 HTML 구조로 짜 주세요.
문서의 구조와 배치를 맡는 HTML 요소들입니다. header·main·footer처럼 영역에 이름을 붙이는 것, 제목 h1~h6, 목록 ul·ol·dl, 펼치는 details까지 들어 있습니다.
div로도 같은 모양을 만들 수 있지만, 의미 있는 요소를 쓰면 화면 읽기 프로그램과 검색 엔진이 페이지의 구조를 이해합니다.
Mon to Fri, 9 am to 6 pm.
rx.el.article(
rx.el.header(rx.el.h2("Opening hours", font_weight="bold")),
rx.el.p("Mon to Fri, 9 am to 6 pm."),
rx.el.footer("Updated today", font_size="12px", color="gray"),
padding="12px",
border="1px solid gray",
border_radius="8px",
)구조 요소는 대부분 공통 속성만 있습니다. 고유 속성이 있는 ol(reversed)과 details(open)를 움직여 봅니다.
이 사이트는 Tailwind preflight가 목록 기호를 지우므로, 기호는 CSS list_style_type으로 되살립니다.
속성 바꿔 보기
Shown when the details element is open.
reversed
marker
summary
open
rx.el.div(
rx.el.ol(
rx.el.li("Mix"),
rx.el.li("Bake"),
rx.el.li("Serve"),
reversed=False,
list_style_type="decimal",
padding_left="2em",
),
rx.el.details(
rx.el.summary("More info", cursor="pointer"),
rx.el.p("Shown when the details element is open."),
open=False,
),
)| 속성 | 값 | 기본값 | 쓰임 |
|---|---|---|---|
start (ol) | 정수 | 1 | 첫 번호 |
reversed (ol) | True / False | False | 번호를 거꾸로 |
type (ol) | "1" "a" "A" "i" "I" | "1" | 번호 기호. preflight가 있으면 CSS list_style_type이 대신한다 |
open (details, dialog) | True / False | False | 펼침·열림 |
cite (blockquote, del_) | URL | 없음 | 인용·수정의 출처 |
date_time (del_) | 날짜 문자열 | 없음 | 지운 시각 |
rel href … (link) | 문자열 | 없음 | 외부 자원 연결(문서 머리용) |
async_ defer src … (script) | bool·문자열 | 없음 | 스크립트 태그(Script 페이지 참고) |
header는 머리, nav는 이동 메뉴, main은 본문, article은 따로 떼어도 뜻이 통하는 글, aside는 곁다리, section은 주제 묶음, footer는 바닥, address는 연락처입니다.
모두 스타일이 없는 상자라서, 배치는 display="grid"·"flex" 같은 CSS로 정합니다.
The main story goes here.
A themed section of the page.
rx.el.div(
rx.el.header(
rx.el.strong("Workshop"),
rx.el.nav(rx.el.span("Home"), rx.el.span("Parts"), rx.el.span("About"), display="flex", gap="12px"),
display="flex",
justify_content="space-between",
padding="8px",
background=rx.color("indigo", 3),
),
rx.el.main(
rx.el.article(rx.el.h3("Post title", font_weight="bold"), rx.el.p("The main story goes here.")),
rx.el.aside("Related links", padding="8px", background=rx.color("gray", 3)),
display="grid",
grid_template_columns="2fr 1fr",
gap="12px",
padding="8px",
),
rx.el.section(rx.el.p("A themed section of the page."), padding="8px", border_top="1px dashed gray"),
rx.el.footer(rx.el.address("hello@example.com"), padding="8px", font_size="13px", color="gray"),
border="1px solid gray",
border_radius="8px",
overflow="hidden",
)preflight 때문에 h1과 h3이 본문과 같은 크기로 나옵니다. 제목은 의미이고, 크기는 font_size로 따로 정합니다.
hr은 주제가 바뀌는 선, blockquote는 긴 인용(cite에 출처), pre는 공백과 줄바꿈을 그대로 지키는 글입니다.
del 요소는 파이썬 예약어와 겹쳐서 Reflex에서는 rx.el.del_로 씁니다(공식 문서의 목록에는 rx.el.Del로 적혀 있습니다). 짝인 rx.el.ins는 새로 넣은 글입니다.
Make it work, make it right, make it fast.
def hello():
print('hi')Price: $20 $15
rx.el.div(
rx.el.h1("h1 with no style"),
rx.el.h3("h3 with no style"),
rx.el.h2("h2 with style", font_size="24px", font_weight="bold"),
rx.el.hr(margin_y="8px"),
rx.el.blockquote(
"Make it work, make it right, make it fast.",
cite="https://wiki.c2.com/?MakeItWorkMakeItRightMakeItFast",
border_left="4px solid gray",
padding_left="12px",
font_style="italic",
),
rx.el.pre("def hello():\n print('hi')", padding="8px", background=rx.color("gray", 3)),
rx.el.p("Price: ", rx.el.del_("$20", date_time="2026-10-01"), " ", rx.el.ins("$15")),
)ul은 순서 없는 목록, ol은 번호 목록이고 항목은 li입니다. dl은 용어(dt)와 설명(dd)의 짝을 늘어놓는 설명 목록입니다.
rx.el.div(
rx.el.ul(rx.el.li("Apples"), rx.el.li("Pears"), list_style_type="disc", padding_left="1.5em"),
rx.el.ol(rx.el.li("Third"), rx.el.li("Fourth"), start=3, list_style_type="decimal", padding_left="1.5em"),
rx.el.dl(
rx.el.dt("Box", font_weight="bold"),
rx.el.dd("A container with no meaning.", margin_left="1.5em"),
rx.el.dt("Flex", font_weight="bold"),
rx.el.dd("A row or column of children.", margin_left="1.5em"),
),
display="flex",
gap="24px",
flex_wrap="wrap",
)details 안의 첫 summary가 제목이 되고, 누르면 브라우저가 알아서 펼치고 접습니다. State가 필요 없습니다.
dialog는 open 속성으로 엽니다. 이렇게 열면 뒤를 막지 않는 비모달 창이고, 화면을 덮는 모달 대화상자는 rx.dialog를 쓰는 편이 쉽습니다.
A box the browser opens and closes by itself.
class HtmlLayoutDialogState(rx.State):
is_open: bool = False
@rx.event
def toggle(self):
self.is_open = not self.is_open
rx.el.div(
rx.el.details(
rx.el.summary("What is details?", cursor="pointer"),
rx.el.p("A box the browser opens and closes by itself."),
),
rx.el.button(
"Toggle dialog",
on_click=HtmlLayoutDialogState.toggle,
padding="4px 12px",
border="1px solid gray",
border_radius="6px",
margin_top="12px",
),
rx.el.dialog(
rx.el.p("A non-modal dialog, opened by the open prop."),
open=HtmlLayoutDialogState.is_open,
padding="12px",
border="1px solid gray",
border_radius="8px",
top="40px",
),
position="relative",
min_height="150px",
)figcaption은 figure 안에서 그림, 표, 코드 같은 내용에 설명을 붙입니다.
rx.el.figure(
rx.el.img(src="https://picsum.photos/id/1080/320/160", alt="Strawberries", border_radius="6px"),
rx.el.figcaption("Fig. 1 - Fresh strawberries", font_size="13px", color="gray", margin_top="4px"),
width="320px",
)template 안의 내용은 화면에 그려지지 않고 복제해서 쓸 틀로만 남습니다. noscript는 자바스크립트가 꺼진 브라우저에서만 보입니다. Reflex 앱은 자바스크립트로 돌아가므로 여기서는 보이지 않습니다.
Only this line is visible.
rx.el.div(
rx.el.p("Only this line is visible."),
# rx.el.template(...) also keeps its content off the page, but React cannot
# hydrate children inside <template>, so it is left out of this live example.
rx.el.noscript("Please turn on JavaScript."),
)html, head, body, title, link, script, portal은 문서 전체나 머리 부분의 요소입니다. Reflex가 이미 이 틀을 만들어 주므로 페이지 안에서는 거의 쓰지 않고, 여기서도 코드로만 보입니다.
React 19는 본문에 둔 title·link를 문서 머리로 끌어올리므로, 페이지에 그리면 이 사이트의 탭 제목이 바뀌어 버립니다.
# Document-level and head elements: Reflex already renders these, so pages rarely use them
rx.el.html(...) # manifest attribute (removed in HTML5)
rx.el.head(...)
rx.el.body(...)
rx.el.title("Page title") # set page titles with @rx.page(title=...)
rx.el.link(rel="stylesheet", href="/styles.css") # add stylesheets with rx.App(stylesheets=[...])
rx.el.script(src="/my-script.js") # use rx.script for scripts (see the Script page)
rx.el.portal(...) # experimental element that never became a standard글 전체는 article, 제목과 날짜는 header, 본문은 section, 팁은 aside, 질문은 details, 연락처는 footer 안의 address입니다.
Three new dishes join the menu this week.
Yes, the soup and rolls are vegan.
rx.el.article(
rx.el.header(
rx.el.h1("Spring menu is here", font_size="22px", font_weight="bold"),
rx.el.p(rx.el.time("Mar 3, 2026", date_time="2026-03-03"), font_size="13px", color="gray"),
),
rx.el.section(
rx.el.p("Three new dishes join the menu this week."),
rx.el.ul(rx.el.li("Spring rolls"), rx.el.li("Pea soup"), rx.el.li("Lemon tart"), list_style_type="disc", padding_left="1.5em"),
margin_y="8px",
),
rx.el.aside("Tip: book a table early.", padding="8px", background=rx.color("amber", 3), border_radius="6px"),
rx.el.details(
rx.el.summary("Do you have vegan options?", cursor="pointer", font_weight="600"),
rx.el.p("Yes, the soup and rolls are vegan."),
margin_y="8px",
),
rx.el.hr(),
rx.el.footer(rx.el.address("12 Market St · hello@example.com"), font_size="13px", color="gray", margin_top="8px"),
padding="16px",
border="1px solid gray",
border_radius="10px",
max_width="420px",
)공방 노트
header·nav·main·article·section·aside·footer는 영역에 이름을 붙인다. 배치는 CSS로.
h1~h6은 의미일 뿐. preflight 아래에서는 크기를 font_size로 정한다.
ul·ol·li, dl·dt·dd. 목록 기호는 list_style_type, ol은 start·reversed.
details + summary는 State 없이 펼침. dialog의 open은 비모달, 모달은 rx.dialog.
del은 rx.el.del_. html·head·body·title·link는 Reflex가 맡으니 페이지에서는 쓰지 않는다.
새 교시·새 강의 소식 받기
이 강의에 새 교시가 더해지거나 이어지는 강의가 열리면 이메일로 알려 드려요.
R
ReflexKR
눌러 보며 배우는 파이썬과 Reflex. 모든 예제는 Reflex 0.10.0에서 직접 실행해 확인했습니다.
ReflexKR은 배너 광고 없이 무료로 운영돼요. 도움이 되셨다면 커피 한 잔으로 응원해 주세요.
© 2026 ReflexKR · Since 2026 · CC BY-NC 4.0
질문과 답변
이 교시에서 궁금한 점을 남겨 주세요. 모든 언어 페이지의 질문이 함께 모입니다.