Skip to main content

Text Widget

The Text widget is used to display static or dynamic content in your interface. It supports rich HTML content, dynamic data binding, and comprehensive styling options.

OverviewDirect link to Overview

The Text widget renders as a paragraph element that can display formatted text, HTML content, and dynamic values from your data models. It's highly configurable and supports responsive design patterns.

A Text widget at runtime: a heading and a paragraph holding two variables.
A Text widget at runtime: a heading and a paragraph holding two variables.

Configuration OptionsDirect link to Configuration Options

Global SettingsDirect link to Global Settings

Basic PropertiesDirect link to Basic Properties

  • Name: A descriptive name for your text widget
  • Variable/Model: The data model variable to bind this widget to (optional for static content)

Content ConfigurationDirect link to Content Configuration

  • Content: Click Edit to open the Content drawer, a rich HTML content editor for defining the text content; Save keeps it
    • Supports HTML formatting (bold, italic, lists, links, etc.)
    • Allows dynamic variable interpolation using {{variable_name}} syntax
    • Full WYSIWYG editor with formatting toolbar
The Content drawer: the text, with two variables, and the formatting toolbar.
The Content drawer: the text, with two variables, and the formatting toolbar.

Text AlignmentDirect link to Text Alignment

Configure how the text content is aligned within the widget with the Align Text field:

  • Justify Left: Align text to the left
  • Justify Center: Center the text horizontally
  • Justify Right: Align text to the right
  • Justify Start: Align text to the start (language-dependent), the default for a new widget
  • Justify End: Align text to the end (language-dependent)
  • Justify Text: Justify text with even spacing
A Text widget selected on the canvas and its Global card: name, variable, Align Text and Content.
A Text widget selected on the canvas and its Global card: name, variable, Align Text and Content.

Validation and VisibilityDirect link to Validation and Visibility

Screen-based ConfigurationDirect link to Screen-based Configuration

Configure widget behavior across different interface screens:

  • Available: Whether the widget is available on each screen
  • Visible: Control visibility with boolean values or dynamic conditions
  • Required: Set requirement status (typically not applicable for text widgets)
  • Disable: Control if the widget is disabled or collapsed
The Validation card of a page with two screens: the widget is available on the first one only.
The Validation card of a page with two screens: the widget is available on the first one only.

Advanced Visibility ConditionsDirect link to Advanced Visibility Conditions

Click Advanced Setting under the screens: each cell becomes a pencil that opens the Advanced Setting Condition dialog. With a screen selected in the All Screens selector above the canvas, the card lists that screen only, and the pencil of each line (Visible, Required, Disable) opens the dialog directly.

  • Use JavaScript expressions for dynamic visibility
  • Reference other form variables using {{variable_name}} syntax
  • Support for complex conditional logic
  • Apply sets the condition for this screen, Apply to All screens for every screen; Easy Setting goes back to the switches
The Advanced Setting Condition dialog.
The Advanced Setting Condition dialog.

Styling and LayoutDirect link to Styling and Layout

CSS ClassesDirect link to CSS Classes

The Style card of a Text widget holds the Class field. The other style properties are managed by the settings of the page (Page Settings).

  • Class: Add custom CSS classes for styling
  • Dynamic classes (the brush button next to Class): Use JavaScript expressions to apply conditional classes
    • Reference data models using models.variable_name
    • Support for conditional class application
The Style card of a Text widget.
The Style card of a Text widget.

Dynamic ContentDirect link to Dynamic Content

HTML Content SupportDirect link to HTML Content Support

The content editor supports full HTML formatting. For markup the toolbar does not offer, the Insert HTML button (an icon, in the overflow menu ⋮ when the toolbar lacks room) inserts an HTML snippet: the pencil opens its source and the check mark validates it.

An HTML snippet being edited in the Content drawer.
An HTML snippet being edited in the Content drawer.

Translated TextsDirect link to Translated Texts

The static texts of a Text widget go through the dictionary of the page at runtime: the translation of the whole content when the table has one, otherwise each piece of text between two tags or two {{ }} expressions, looked up on its own. A text with variables is therefore translated without being rewritten. See Title and Text widgets in Multi-Language.

ExpressionsDirect link to Expressions

  • {{firstName}} shows the variable firstName of the page. Inside a Loop, {{field}} reads the field of the current row
  • A broken expression no longer blanks the page. An expression that is not valid JavaScript ({{ 1 + }}) is shown as written, and one that fails when it is evaluated shows nothing; the rest of the page is displayed normally
  • The expressions that are not valid are listed in the browser console, under the message SoftyFlow: parts of this page are ignored because they are not valid

Secured ContentDirect link to Secured Content

At runtime, the content of a Text widget is displayed, not run:

  • The <script>, <iframe>, <object> and <embed> tags are shown as plain text
  • The on* attributes (onclick, onmouseover…) are removed
  • The javascript: links are neutralized

For an interaction, use a Button widget or an HTML widget.

Best PracticesDirect link to Best Practices

Content OrganizationDirect link to Content Organization

  1. Keep content concise: Text widgets work best with focused, clear messaging
  2. Use semantic HTML: Structure content with proper heading tags and paragraphs
  3. Plan for responsiveness: Consider how text will display on different screen sizes

Performance ConsiderationsDirect link to Performance Considerations

  1. Optimize HTML: Avoid excessive nesting and complex markup
  2. Efficient variable binding: Only bind necessary variables to reduce processing overhead
  3. Conditional rendering: Use visibility conditions to improve performance

AccessibilityDirect link to Accessibility

  1. Semantic markup: Use proper HTML elements for screen readers
  2. Color contrast: Ensure sufficient contrast for readability
  3. Font sizing: Use relative units for better accessibility

Technical ImplementationDirect link to Technical Implementation

Rendered OutputDirect link to Rendered Output

The text widget generates a <p> element with:

  • Unique ID and Vue.js reference
  • Conditional visibility binding
  • CSS classes (both static and dynamic)
  • Inline styles for alignment and spacing
  • Processed content with variable interpolation

Variable ProcessingDirect link to Variable Processing

  • Variables are automatically prefixed with models. in the rendering process
  • Supports nested object properties: {{user.profile.avatar}}
  • Safe variable access with optional chaining

TroubleshootingDirect link to Troubleshooting

Common IssuesDirect link to Common Issues

  1. Variables not displaying: Ensure variable names match exactly with your data model
  2. HTML not rendering: Check that HTML content is properly formatted
  3. Styling not applied: Verify CSS class names and dynamic class conditions
  4. Visibility issues: Review visibility conditions and variable references
  5. An expression is shown as written: It is not valid JavaScript; the browser console lists it (see Expressions)
  6. A script or an onclick does nothing: They are neutralized in a Text widget (see Secured Content)

Debugging TipsDirect link to Debugging Tips

  1. Test variable binding: Use simple variable references first, then add complexity
  2. Validate HTML: Ensure HTML content is well-formed
  3. Check console: Look for JavaScript errors in dynamic class expressions
  4. Preview different screens: Test visibility conditions across all configured screens

Example ConfigurationsDirect link to Example Configurations

Simple Static TextDirect link to Simple Static Text

  • Content: "Welcome to our application!"
  • Alignment: Center
  • Class: "welcome-message"

Dynamic User InformationDirect link to Dynamic User Information

  • Content: <h3>Hello, {{user.name}}</h3><p>Last login: {{user.lastLogin}}</p>
  • Alignment: Left
  • Visibility: {{user.isLoggedIn}} === true

Conditional StylingDirect link to Conditional Styling

  • Content: "{{notification.message}}"
  • Dynamic Classes: {{notification.type}} === 'error' ? 'text-danger' : 'text-info'
  • Alignment: Left

This comprehensive configuration system allows the Text widget to serve a wide range of content display needs while maintaining flexibility and performance.