use fission::prelude::*;
// In view setup: keep a translated message whole rather than concatenating
// English fragments whose order may not work in another language.
let tokens = &cx.view.env().theme.tokens;
let failed = RichTextRun::new(cx.tr("sync.failed"))
.weight(tokens.typography.font_weight_bold)
.color(tokens.colors.error);
// In the Compose view:
RichText(runs: vec![failed])
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
text | String | Text for this run. | Required. |
style | TextRunStyle | Fully resolved style for the run. | Defaults to TextRunStyle::default(). Builder helpers usually feel nicer than editing this directly. |
semantics_label | Option<String> | Accessibility label override for this run. | Defaults to None. |
semantics_identifier | Option<String> | Semantic identifier override for this run. | Defaults to None. |
spell_out | Option<bool> | Whether assistive technology should spell out the run. | Defaults to None. |