You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,6 +50,7 @@ The legacy flat import path `solid-ui/components/button` still works, but the gr
49
50
|`fullWidth`|`full-width`|`boolean`|`false`| Expands the host and inner button to the available width. Useful for stacked mobile actions, form footers, or full-row menu buttons. |
50
51
|`icon`|`icon`|`string`|`''`| URL or data URL for a fallback `<img>` icon. |
51
52
|`iconPosition`|`icon-position`|`'start' \| 'end'`|`'start'`| Places the icon before or after the label. |
53
+
|`contentAlign`|`content-align`|`'start' \| 'center' \| 'end'`|`'center'`| Aligns the inner button content and label text without requiring `::part(button)` overrides. Useful for full-width list or menu buttons. |
52
54
|`handleClick`| n/a |`(event: MouseEvent) => void`|`undefined`| Property-only callback invoked on click. Native `click` events still bubble normally. |
53
55
54
56
### Slots
@@ -87,6 +89,8 @@ The legacy flat import path `solid-ui/components/button` still works, but the gr
87
89
|`--button-font-weight`|`var(--font-weight-bold, 600)`| Font weight applied to the button label |
88
90
|`--button-line-height`|`1`| Line height applied to the inner native button |
89
91
|`--button-justify-content`|`center`| Horizontal alignment of the button content |
92
+
|`--button-content-justify-content`|`var(--button-justify-content)`| Horizontal alignment used by the inner content wrapper |
93
+
|`--button-label-text-align`|`center`| Text alignment applied to the label region |
90
94
|`--button-box-shadow`|`none`| Base box shadow for the button |
@@ -134,6 +138,22 @@ The icon scale is intentionally flatter than the button-height scale:
134
138
-`md`: `16px` icon, matching the common menu, header, and button-leading icon size
135
139
-`lg`: `16px` icon by default, because the larger profile-pane buttons mostly keep the same leading-icon size rather than scaling the icon up
136
140
141
+
## Content alignment
142
+
143
+
By default, button content is centered.
144
+
145
+
Set `content-align="start"` or `content-align="end"` when the button needs to behave more like a full-row list item or menu action:
146
+
147
+
```html
148
+
<solid-ui-button
149
+
full-width
150
+
content-align="start"
151
+
label="Personal Address Book"
152
+
></solid-ui-button>
153
+
```
154
+
155
+
That attribute updates both the inner flex alignment and the label text alignment, so consumers should not usually need `::part(button)` just to left-align button text.
156
+
137
157
## Text size and text color
138
158
139
159
The component inherits the app's font family through `font: inherit`, so typeface decisions stay with the consuming app.
0 commit comments