Skip to content

Text

Display text with shared shaping and glyph pixels.

On this page

Available with egui, Masonry and GPUI through the same public component API. Platform input and accessibility coverage still have alpha limits.

Usage

Replace src/App.iru in a scaffolded project with this complete file, then run cargo run. Keep the scaffold's main.rs and build.rs; this file includes its state, handlers and scoped styles.

src/App.iru
<view>
    <Column class="example">
        <Text text="Enter a name to update the greeting." />
        <Input model:value={name} placeholder="Your name" />
        <Text text={format!("Hello, {}!", name)} class="greeting" />
    </Column>
</view>
<rust>
use inrux::prelude::*;

let name: String = "Rust developer".into();
</rust>
<style scoped>
.example {
    padding: 24px;
    gap: 16px;
}
.greeting {
    font-size: 24px;
    color: #b84200;
}
</style>

API Reference

Props

PropTypeDefaultDescription
textString-like expression""Text to display.

Common props

PropTypeDefaultDescription
idString-like expressionNot setStyle-selector identity; independent of retained mount identity.
classString-like expressionNot setWhitespace-separated stylesheet classes.
styleStyleNot setExplicit Rust style overrides for this node.
keyString-like expressionNot setRetained sibling identity; preserve it while reordering children.
widthSizeComponent styleExplicit width constraint; otherwise use the resolved style.
heightSizeComponent styleExplicit height constraint; otherwise use the resolved style.
paddingf32Component styleUniform padding in logical pixels; otherwise use the resolved style.
gapf32Component styleChild spacing in logical pixels; otherwise use the resolved style.

“Component style” means the attribute is omitted and the normal style cascade supplies the value. Application styles can override framework defaults.

Emits

EventPayloadDescription
——No component events are emitted.

Behavior

Text uses the common Parley/Swash provider. It inherits text color, size, named family and white-space policy. Normal text wraps to the available width; preformatted text preserves unwrapped geometry. A decorative Text node has no action handler.

Styling and limits

Register fonts before mounting. Font weight, line-height and tracking are not browser-complete CSS features in the alpha. System fallback coverage and native compositor output still need platform checks.

Read the detailed reference for validation and native integration details. The playgrounds include a working Text specimen with its surrounding state and reset controls.

Inrux · Built with Nuxt Content, IPEX, and Akaza UI.