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.text.emOfficial docs
Workshop order
In the coupon notice, put stress on the words "all" products and "including" sale items so they come through.
rx.text.em marks a word you would stress when speaking. It renders an HTML <em> tag and appears in an italic font. Use it when the meaning of a sentence depends on which word is stressed.
We had to do something about it.
rx.text("We ", rx.text.em("had"), " to do something about it.")Em has no styling props such as size or color. It follows the size and color of the surrounding rx.text. That is why this page has an example driven by State instead of a props lab.
| Prop | Values | Default | Use |
|---|---|---|---|
| child | string, State value, component | required | The text to stress |
It also takes common HTML attributes such as id, title and lang, plus the standard events. In the Radix theme, Em appears in an italic serif font (the theme's --em-font-family).
Click the word buttons below to change which word is stressed. Depending on the stressed word, "I never said she took it" means "someone else said it, not me" or "someone else took it, not her". Em is how you carry that difference in writing.
I never said she took it
class EmStressState(rx.State):
words: list[str] = ["I", "never", "said", "she", "took", "it"]
stressed: int = 1
@rx.event
def stress(self, i: int):
self.stressed = i
rx.flex(
rx.text(
rx.foreach(
EmStressState.words,
lambda w, i: rx.fragment(rx.cond(i == EmStressState.stressed, rx.text.em(w), rx.text(w, as_="span")), " "),
),
size="6",
),
rx.flex(
rx.foreach(
EmStressState.words,
lambda w, i: rx.button(
w,
size="1",
variant=rx.cond(i == EmStressState.stressed, "solid", "soft"),
on_click=EmStressState.stress(i),
),
),
spacing="2",
wrap="wrap",
),
direction="column",
spacing="3",
)When you only want slanted text without stress, as for book titles or foreign words, use rx.text(…, as_="i"). <em> keeps the meaning of emphasis in the HTML; <i> only changes the look.
Emphasis: I really liked it.
Italic only: Moby-Dick is a novel.
rx.flex(
rx.text("Emphasis: I ", rx.text.em("really"), " liked it."),
rx.text("Italic only: ", rx.text("Moby-Dick", as_="i"), " is a novel."),
direction="column",
spacing="3",
)Em also keeps the size and color of the surrounding text. Put Em inside Strong for a part that is both important and stressed.
Small: we had to.
Large: we had to.
Mixed: this is very very important.
rx.flex(
rx.text("Small: we ", rx.text.em("had"), " to.", size="2"),
rx.text("Large: we ", rx.text.em("had"), " to.", size="6", color_scheme="indigo"),
rx.text("Mixed: this is ", rx.text.strong("very ", rx.text.em("very")), " important."),
direction="column",
spacing="3",
)Leave the sentence as it is and wrap only the two words customers are likely to misread in Em.
The coupon works on any item in the store, including items already on sale.
rx.card(
rx.text(
"The coupon works on ",
rx.text.em("any"),
" item in the store, ",
rx.text.em("including"),
" items already on sale.",
size="3",
),
max_width="420px",
)Workshop notes
rx.text.em("…") marks a stressed word (<em>). Put it in an rx.text as a child.
It has no styling props and follows the size and color of the surrounding text.
For slanted text without meaning, use rx.text(…, as_="i").
Importance is rx.text.strong, spoken stress is rx.text.em. They can be nested.
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.