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
| | | |
|---|
| | Render this exact string. | Good for dynamic values, ids, or already-translated text. |
| | 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.