**Button Component — LLM Reference** `Button` renders a fully styled, clickable button optimized for email clients. It supports background colors, borders, rounded corners, and advanced text styling with strong Outlook compatibility via MSO conditional comments. --- ## Position in the Document Tree ``` DocumentTree └── Section └── Container └── Column └── Text └── Button ← clickable call-to-action button └── Spacer ``` `Button` is a leaf node. It can be placed anywhere a child component is accepted. --- ## ComponentNode JSON Structure ```json { "id": "unique-string-id", "type": "ButtonComponent", "config": { "children": "Click Here", "innerLink": { "type": "url", "url": "https://example.com" }, "backgroundColor": "#3b82f6", "color": "#ffffff", "padding": "12px 28px", "borderRadius": "6px" } } ``` --- ## `ButtonConfig` — Full Property Reference | Property | Type | Required | Default | Description | |---------------------|-------------------------------------------|----------|-------------|-----------| | `children` | `string` / `ReactNode` | Yes | — | Button text content | | `innerLink` | `IInnerLink` | No | — | Preferred way to make button clickable | | `href` | `string` | No | — | Deprecated. Use `innerLink` instead | | `backgroundColor` | `string` | No | — | Button background color | | `color` | `string` | No | — | Text color | | `padding` | `string` | No | — | Inner padding (e.g. `"12px 24px"`) | | `borderRadius` | `string` | No | — | Border radius (e.g. `"6px"`, `"9999px"`) | | `border` | `BorderConfig` | No | — | Border configuration | | `width` | `string` | No | `"auto"` | Button width (e.g. `"200px"`, `"100%"`) | | `maxWidth` | `string` | No | — | Maximum width | | `justifyContent` | `"start" \| "center" \| "end"` | No | — | Horizontal alignment of the button | | `textAlign` | `"left" \| "center" \| "right"` | No | `"center"` | Text alignment inside button | | `fontSize` | `string` | No | — | Font size (e.g. `"16px"`) | | `fontWeight` | `string` | No | — | Font weight (`"400"`, `"700"`, `"bold"`) | | `fontStyle` | `string` | No | — | `"italic"` | | `fontFamily` | `string` | No | — | Font family | | `lineHeight` | `string` | No | — | Line height | | `letterSpacing` | `string` | No | — | Letter spacing | | `textTransform` | `string` | No | — | `"uppercase"`, `"capitalize"`, etc. | | `textDecoration` | `string` | No | — | Text decoration | | `opacity` | `string \| number` | No | — | Text opacity | --- ## `innerLink` Structure ```json "innerLink": { "type": "url" | "email" | "phone" | "anchor" | "page_top" | "page_bottom" | "none", "url"?: string, "email"?: string, "phone"?: string, "anchor"?: string, "target"?: "_blank" | "_self" } ``` --- ## How It Works - Uses nested tables for maximum email client compatibility. - Outlook Classic gets a separate MSO-wrapped table structure. - Border radius and background are handled carefully for Outlook support. - All text styling is applied via inline styles. - The button is always rendered as a link (``) when `innerLink`/`href` is provided. --- ## React Usage ```tsx import Button, { ButtonConfig } from './Button'; const config: ButtonConfig = { children: "Get Started Now", innerLink: { type: "url", url: "https://example.com", target: "_blank" }, backgroundColor: "#2563eb", color: "#ffffff", padding: "14px 32px", borderRadius: "8px", fontSize: "16px", fontWeight: "600" };