Text Component in CXTMS
Introduction
The Text Component is a fundamental element in CXTMS used for rendering various types of text content. It provides flexibility in displaying text with different styles and formats, making it essential for creating informative and well-structured user interfaces.
YAML Structure
component: text
props:
type: "p"
value: "Your text here"
options:
className: "custom-class"
Attribute Description
component: (string) Must be set to "text" to use this component type.props: (object) Contains the configuration properties for the text component.type: (string) Specifies the HTML element type for the text. Options include:h1,h2,h3,h4,h5,h6for headingspfor paragraphs (default)spanfor inline textdivfor block-level text
value: (string or object) The content to be displayed. Supports localization.options: (object) Additional configuration options.className: (string) CSS class names to apply to the text element.
Examples
Basic Text
component: text
props:
value: "This is a simple paragraph."
Heading with Custom Class
component: text
props:
type: "h2"
value: "Important Section Title"
options:
className: "section-title highlight-text"
Localized Text
component: text
props:
type: "p"
value:
en-US: "Welcome to CXTMS"
es-ES: "Bienvenido a CXTMS"
fr-FR: "Bienvenue sur CXTMS"
Dynamic Text with Variables
component: text
props:
type: "span"
value: "Current shipment status: {{ shipment.status }}"