コンポーネント工房: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.text.strong公式ドキュメント
工房の注文書
ファームウェア更新の案内文で、「ランプが緑色になるまで電源を抜かないでください」という部分が必ず読まれるようにしてください。
rx.text.strong は、文の中で「この部分が重要だ」という意味を表します。HTML の <strong> タグになり、太字で表示されます。警告、締め切り、金額のように見落としてはいけない部分に使います。
The most important thing to remember is, stay positive.
rx.text("The most important thing to remember is, ", rx.text.strong("stay positive"), ".")Strong にはサイズや色のような見た目のプロパティがありません。周りの rx.text のサイズと色に従い、太さだけを加えます。そのためこのページには、プロパティの実習台の代わりに State で動く例があります。
| プロパティ | 値 | 既定値 | 用途 |
|---|---|---|---|
| 子 | 文字列、State の値、コンポーネント | 必須 | 重要な部分の文字 |
このほか id、title、lang などの HTML 共通属性と基本イベントを受け取ります。
2行は同じように太く見えます。しかし rx.text.strong は <strong> タグなので「重要だ」という意味が HTML に残り、weight="bold" は見た目が太いだけです。スクリーンリーダーや検索エンジンはその意味を読み取ります。単にデザインのために太くするなら weight、内容が重要だから太くするなら Strong を選びます。
Semantic: Do not unplug during the update.
Visual only: Do not unplug during the update.
rx.flex(
rx.text("Semantic: ", rx.text.strong("Do not unplug during the update"), "."),
rx.text("Visual only: ", rx.text("Do not unplug during the update", weight="bold", as_="span"), "."),
direction="column",
spacing="3",
)Strong の部分も、周りの文字のサイズと色をそのまま使います。
Small gray text with strong part.
Large crimson text with strong part.
rx.flex(
rx.text("Small gray text with ", rx.text.strong("strong part"), ".", size="2", color_scheme="gray"),
rx.text("Large crimson text with ", rx.text.strong("strong part"), ".", size="5", color_scheme="crimson"),
direction="column",
spacing="3",
)子に State の値を入れると、値が変わったときに強調部分も変わります。配送方法を選ぶと、到着までの日数が太字で切り替わります。
Your order arrives in 3 days.
class StrongShippingState(rx.State):
option: str = "Standard"
@rx.var
def days(self) -> str:
return {"Express": "1 day", "Standard": "3 days", "Economy": "7 days"}[self.option]
@rx.event
def choose(self, value: str):
self.option = value
rx.flex(
rx.flex(
rx.button("Express", size="1", variant=rx.cond(StrongShippingState.option == "Express", "solid", "soft"),
on_click=StrongShippingState.choose("Express")),
rx.button("Standard", size="1", variant=rx.cond(StrongShippingState.option == "Standard", "solid", "soft"),
on_click=StrongShippingState.choose("Standard")),
rx.button("Economy", size="1", variant=rx.cond(StrongShippingState.option == "Economy", "solid", "soft"),
on_click=StrongShippingState.choose("Economy")),
spacing="2",
),
rx.text("Your order arrives in ", rx.text.strong(StrongShippingState.days), ".", size="4"),
direction="column",
align="start",
spacing="3",
)案内文全体は普通の文字のままにして、必ず守るべき一節だけを rx.text.strong で包みます。1つの段落に強調が多いと、かえって何も目立たなくなります。
Keep the device connected. Do not unplug it until the light turns green, or the update will fail.
rx.callout.root(
rx.callout.icon(rx.icon("triangle-alert")),
rx.callout.text(
"Keep the device connected. ",
rx.text.strong("Do not unplug it until the light turns green"),
", or the update will fail.",
),
color_scheme="amber",
)工房ノート
rx.text.strong("…") は重要な部分(<strong>)。rx.text の中に子として入れる。
見た目のプロパティはなく、周りの文字のサイズ・色に太さだけを加える。
意味が重要なら Strong、デザイン上太くしたいだけなら weight="bold"。
強調は1つの段落に1つくらいに控える。
新しい授業・講座のお知らせを受け取る
この講座に授業が追加されたり、続きの講座が公開されたりしたらメールでお知らせします。
R
ReflexKR
触って学ぶPythonとReflex。すべての例はReflex 0.10.0で実際に動かして確認しています。
ReflexKRはバナー広告なし・無料で運営しています。役に立ったら、コーヒー一杯で応援してください。 ☕ コーヒーで応援する
アフィリエイトと支援について© 2026 ReflexKR · Since 2026 · CC BY-NC 4.0
質問と回答
この回について気になることを書き込んでください。すべての言語のページの質問がここに集まります。