TextContent

TextContent is the content-source enum used by Text.
You encounter it when a text widget should either render a literal string directly or look up a translated string from the environment.

Example

use fission::prelude::*;
let title = Text::new(TextContent::Key("settings.title".into())).into();
let caption = Text::new(TextContent::Literal("Version 1.2.0".into())).into();

Choice table

Choice
Type
Meaning
Notes / default behavior
Literal(String)
TextContent
Render this exact string.
Good for dynamic values, ids, or already-translated text.
Key(String)
TextContent
Look up the string through the current locale in Env.i18n.
Missing keys render as MISSING:key in the checked-in implementation.

Specific advice

Use Key for product copy that should participate in internationalization. Use Literal for values that are already data, such as file names, counts, or user input.

Production checklist

For TextContent, review the fields that change behavior before treating the widget as finished: Literal(String), Key(String). The goal is to make the product rule visible in state and actions, not hidden inside ad-hoc construction code.
If this widget appears inside an interactive flow, keep the surrounding action binding in the parent component and test that the flow still has one clear reducer path.
Check the semantics tree for the user-facing label or role that makes this widget understandable without relying only on pixels.
Add at least one component or harness test that confirms the visible text, semantic role, action dispatch, and layout constraint that matter for this widget in context.
If a screen starts repeating the same TextContent setup, extract a named component around this widget. That keeps the reference API small while making product code easier to read and safer for generated code to copy.
Text, RichText, Theming and internationalization, and Env.
Fission
A cross-platform, GPU-accelerated user interface framework for Rust. MIT licensed.
Copyright (c) 2026 Fission
Ready to use today. Widget APIs are expected to remain stable; some runtime and shell APIs may change before 1.0.0.
Fission 0.7.0