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
Copy file name to clipboardExpand all lines: skills/sgds-components/reference/tab.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ No CSS styling modifications — custom properties and CSS parts are not exposed
29
29
-`variant` controls visual style: `underlined` (default) or `solid`. Set on `<sgds-tab-group>` — propagates to all child tabs.
30
30
-`orientation` controls layout: `horizontal` (default) or `vertical`. Set on `<sgds-tab-group>`.
31
31
-`density` controls spacing: `default` or `compact`. Set on `<sgds-tab-group>`.
32
+
-`fullWidth` on `<sgds-tab-group>` will stretch tab group to fill the whole width of its container. Only works if `orientation` is set to `horizontal`.
32
33
- Fires `sgds-tab-show` (with `event.detail.name`) when a tab is activated and `sgds-tab-hide` when it is deactivated.
33
34
- No public methods on `<sgds-tab-group>`.
34
35
@@ -50,7 +51,7 @@ No CSS styling modifications — custom properties and CSS parts are not exposed
50
51
51
52
-**`panel`/`name` matching**: the link between a tab and its panel is entirely string-based — a typo in either attribute results in a broken tab with no panel displayed. Always verify both values match exactly.
52
53
-**`active` attribute**: sets the initially active tab at render time only; once the tab group is interactive, active state is managed internally and the `active` attribute is not reactively updated.
53
-
-**`variant` and`density` propagation**: these are set on `<sgds-tab-group>` and automatically propagate to all child `<sgds-tab>` elements — do not set them on individual tabs.
54
+
-**`variant`, `orientation`,`density`, and `fullWidth` propagation**: these are set on `<sgds-tab-group>` and automatically propagate to all child `<sgds-tab>` elements — do not set them on individual tabs.
54
55
-**`sgds-tab-show` / `sgds-tab-hide`**: both events fire with `event.detail.name` (the panel name string) — use to lazy-load content, track analytics, or sync URL state with the active tab.
55
56
-**No public methods**: programmatic tab activation is not supported via methods — manage active state by adding/removing the `active` attribute on a `<sgds-tab>` directly if needed.
56
57
@@ -74,6 +75,8 @@ No CSS styling modifications — custom properties and CSS parts are not exposed
74
75
75
76
**Compact spacing?** → `density="compact"` on `<sgds-tab-group>`
76
77
78
+
**Stretch to fill whole width of container?** → `fullWidth` on `<sgds-tab-group>`
79
+
77
80
**Set initial active tab?** → Add `active` to the specific `<sgds-tab>`
78
81
79
82
**Set initial active tab (first loaded tab)?** → The first non-disabled tab is active by default
@@ -112,6 +115,14 @@ No CSS styling modifications — custom properties and CSS parts are not exposed
@@ -136,6 +147,7 @@ No CSS styling modifications — custom properties and CSS parts are not exposed
136
147
|`variant`|`underlined \| solid`|`underlined`| Visual style of the tab list |
137
148
|`orientation`|`horizontal \| vertical`|`horizontal`| Layout direction of the tabs |
138
149
|`density`|`default \| compact`|`default`| Spacing of the tab items |
150
+
|`fullWidth`| boolean |`false`| Sets whether tab group stretches to fill the whole width of its container. Only works if when `orientation` is set to `horizontal`|
139
151
140
152
### `<sgds-tab>`
141
153
@@ -173,7 +185,7 @@ No CSS styling modifications — custom properties and CSS parts are not exposed
173
185
**For AI agents**:
174
186
1.`<sgds-tab>` must have `slot="nav"` and its `panel` must exactly match a `<sgds-tab-panel>`'s `name`.
175
187
2.**Always add `ariaLabel`** to every `<sgds-tab>` — this is required for accessibility. The value should describe the tab's purpose (usually matches the visible label text).
176
-
3.`variant`, `orientation`, and `density` are set on `<sgds-tab-group>` — they propagate automatically to all child `<sgds-tab>` elements.
188
+
3.`variant`, `orientation`, `density`, and `fullWidth` are set on `<sgds-tab-group>` — they propagate automatically to all child `<sgds-tab>` elements.
177
189
4.`sgds-tab-show` and `sgds-tab-hide` both carry `event.detail.name` which is the panel name string.
178
190
5. To set the initially active tab, add `active` to one `<sgds-tab>` — if none are active, the first non-disabled tab is selected.
Copy file name to clipboardExpand all lines: stories/component-templates/Tab/additional.mdx
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,22 @@ By default, tabs are presented horizontally. Set `orientation` to `vertical` for
49
49
<Storyof={TabStories.OrientationSolid} />
50
50
</Canvas>
51
51
52
+
## Full Width
53
+
54
+
Tabs can be set to fill the full width of its container by setting the `fullWidth` attribute to `true`. The `fullWidth` attribute only takes effect if the `orientation` attribute is also set to `horizontal`.
55
+
56
+
### Underlined tabs (default)
57
+
58
+
<Canvasof={TabStories.UnderlinedFullWidth}>
59
+
<Storyof={TabStories.UnderlinedFullWidth} />
60
+
</Canvas>
61
+
62
+
### Solid tabs
63
+
64
+
<Canvasof={TabStories.SolidFullWidth}>
65
+
<Storyof={TabStories.SolidFullWidth} />
66
+
</Canvas>
67
+
52
68
## Tab events
53
69
54
70
The `sgds-tab-group` component emits custom events when tabs are shown or hidden, allowing you to perform side effects and track which tab is currently active.
0 commit comments