Skip to content

Component Text

MeowLynxSea edited this page Jan 24, 2026 · 4 revisions

Text

A simple text element that can optionally include an icon.

This is a convenience for “icon + label” inline content.

Example

use gpui::px;
use yororen_ui::component::{icon, text, IconName};

let view = text("Info").with_icon(icon(IconName::Info).size(px(14.)));

When to use

  • Inline icon + text rows
  • Small labels where a leading icon helps recognition

API

  • text("..."): constructor
  • id(...): stable identity
  • with_icon(icon): leading icon

Defaults

  • Layout: row (flex) with a small gap between icon and text

Notes

  • Use Label when you need tone/ellipsis/line clamping. Text is primarily for "icon + text".

Clone this wiki locally