# Text Component — LLM Reference `Text` is the **primary typography primitive** in this email builder. It renders styled text content inside a table/TD structure for email client compatibility. It accepts an HTML string via `config.text` (with link styles injected automatically) and supports the full range of CSS text properties, padding, background color, and an Outlook-safe `maxWidth` constraint. --- ## Position in the Document Tree ``` DocumentTree └── Section └── Container └── Column / Row └── Text ← leaf component, renders styled text ``` `Text` is a leaf node — it does not have structural children in the component tree. It sits at the end of the layout hierarchy inside a `Column`, `Row`, or directly inside a `Container` cell. --- ## ComponentNode JSON Structure ```json { "id": "unique-string-id", "type": "TextComponent", "config": { "text": "

Hello world

", "padding": "16px 24px", "color": "#111827", "textAlign": "left", "fontFamily": "Arial, sans-serif", "fontSize": "16px", "fontWeight": "400", "fontStyle": "normal", "lineHeight": "1.6", "letterSpacing": "0px", "textTransform": "none", "textDecoration": "none", "backgroundColor": "#ffffff", "opacity": 1, "whiteSpace": "normal", "wordBreak": "break-all", "maxWidth": "480px", "direction": "ltr" } } ``` --- ## `TextConfig` — Full Property Reference ### Content | Property | Type | Description | |---|---|---| | `text` | `string` | HTML string rendered via `dangerouslySetInnerHTML`. Link styles are automatically injected to match the text's color and decoration. | ### Layout | Property | Type | Example | Description | |---|---|---|---| | `padding` | `string` | `"16px 24px"` | Applied to the containing ``. This is the only layout spacing on Text — there is no `margin`. | | `maxWidth` | `string` | `"480px"` | Constrains content width using an Outlook-safe `
` + table pattern. The outer `` stays at `width: 100%`. See **`maxWidth` behavior** below. | ### Typography | Property | Type | Example | Description | |---|---|---|---| | `color` | `string` | `"#111827"` | Text color | | `textAlign` | `"left" \| "center" \| "right" \| "justify"` | `"center"` | Horizontal text alignment. Also applied as the HTML `align` attribute on the `` for Outlook. | | `fontFamily` | `string` | `"Georgia, serif"` | Font stack. Use web-safe fonts or fonts declared in the email ``. | | `fontSize` | `string` | `"16px"` | Font size | | `fontWeight` | `string` | `"700"` | Font weight. Use numeric strings (`"400"`, `"700"`) or keywords (`"bold"`). | | `fontStyle` | `string` | `"italic"` | Font style | | `lineHeight` | `string \| number` | `"1.5"` or `"24px"` | Line height. Unitless values (e.g. `1.5`) are preferred for email compatibility. | | `letterSpacing` | `string` | `"0.5px"` | Letter spacing | | `textTransform` | `string` | `"uppercase"` | Text transform: `"uppercase"`, `"lowercase"`, `"capitalize"`, `"none"` | | `textDecoration` | `string` | `"underline"` | Text decoration: `"underline"`, `"line-through"`, `"none"` | | `direction` | `string` | `"rtl"` | Text direction: `"ltr"`, `"rtl"` | | `verticalAlign` | `string` | `"super"` | Vertical alignment within inline flow: `"sub"`, `"super"`, `"middle"`, etc. | | `whiteSpace` | `string` | `"nowrap"` | White-space handling: `"normal"`, `"nowrap"`, `"pre"`, `"pre-wrap"` | | `wordBreak` | `string` | `"break-word"` | Word break: `"break-all"`, `"break-word"`, `"keep-all"`, `"normal"`. **Defaults to `"break-all"`** if not set. | ### Visual | Property | Type | Example | Description | |---|---|---|---| | `backgroundColor` | `string` | `"#fef9c3"` | Background color of the text block's containing `` | | `opacity` | `string \| number` | `0.7` | Opacity of the inner content div | | `listStyle` | `string` | `"disc"` | List style (informational — consumed by builder UI, not directly applied as CSS by this component) | --- ## HTML Content Rules for `config.text` The `text` property accepts an HTML string, but **only a restricted subset of HTML is permitted**. These rules exist to ensure consistent rendering across email clients and to avoid conflicts with the styles already applied by `TextConfig`. ### Permitted block-level tags Only standard typographic block elements are allowed: - `

` — paragraph - `