R

ReflexKR

Reflex Docs

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

The Component Workshop: Reflex's 100 Library Components
Typography

Em

rx.text.em

Official 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.")

Props

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.

PropValuesDefaultUse
childstring, State value, componentrequiredThe 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).

The stressed word changes the meaning

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",
)

How it differs from plain italics (as_="i")

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",
)

It follows the outer text, and it nests

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",
)

Filling the order

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.

← Previous

Typography · Strong

Next →

Typography · Kbd

Get news about new lessons

We'll email you when this course gets new lessons or a follow-up course opens.

We collect: your email address · Purpose: news about new lessons or the launch of this course · Kept until: you ask us to remove it. We never use it for anything else or share it. Reply to any notice email and we'll delete it right away.

Questions & answers

Ask anything about this lesson. Questions from every language version of this page appear together.

Shown as plain text, without links or formatting.

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
한국어English日本語简体中文EspañolDeutsch

© 2026 ReflexKR · Since 2026 · CC BY-NC 4.0

Built with Reflex