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
{{ message }}
Repository navigation
Commit 9746189
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: frontend/purestack.studio/components/layout/tabs/tabs.mdx
+25-6Lines changed: 25 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ nav:
18
18
<Gridcolumns="1"columnsMd="3">
19
19
<Panelvariant="outline"bodyClass="p-3"><pclass="text-eyebrow mt-0">Selection</p><strong>One shared ref</strong><pclass="text-muted mb-0">Connect the active pane to forms, buttons and the rest of your app.</p></Panel>
20
20
<Panelvariant="outline"bodyClass="p-3"><pclass="text-eyebrow mt-0">State</p><strong>Panels stay mounted</strong><pclass="text-muted mb-0">Switch views without discarding a draft or resetting an input.</p></Panel>
21
-
<Panelvariant="outline"bodyClass="p-3"><pclass="text-eyebrow mt-0">Space</p><strong>Controls adapt</strong><pclass="text-muted mb-0">Overflow on narrow containers. A native selector on mobile.</p></Panel>
21
+
<Panelvariant="outline"bodyClass="p-3"><pclass="text-eyebrow mt-0">Space</p><strong>Controls adapt</strong><pclass="text-muted mb-0">Overflow on narrow containers. An optional native selector on mobile.</p></Panel>
`refresh()` rebuilds the generated buttons and selector; it keeps the existing panel content. Scope it to the root you changed. Also refresh after inserting or removing panes. A ref assignment updates the underlying radio binding, but the current runtime does not watch every component prop automatically.
130
+
`refresh()` rebuilds the generated buttons and selector; it keeps the existing panel content. Scope it to the root you changed. Also refresh after inserting or removing panes. A ref assignment updates the underlying radio binding, but the current runtime does not watch every component prop automatically. Changes to `mobileSelect` update the layout automatically and do not require a refresh.
131
131
132
132
Choose an enabled pane explicitly when disabling or removing the selected pane. This keeps the model and visible view aligned. The playground demonstrates that policy in its `refresh` action.
133
133
@@ -157,9 +157,23 @@ Change the example's width without resizing the page. On desktop, the More tabs
157
157
| --- | --- | --- |
158
158
| Wide viewport, enough container space | Horizontal buttons | Choose Full available width |
159
159
| Wide viewport, narrow container | Buttons plus More tabs | Choose 280px or 360px |
160
-
| Viewport at or below the framework's `sm` breakpoint (640px) | Native select | Open the page on a phone or resize the browser |
160
+
| Viewport at or below the framework's `sm` breakpoint (640px), with `mobileSelect` enabled | Native select | Enable Use a select on mobile in the playground, then resize the browser |
161
+
| Mobile viewport with `mobileSelect` disabled (default) | Buttons plus More tabs when needed | Leave Use a select on mobile unchecked in the playground |
161
162
162
-
Container width determines overflow. **Viewport width** determines compact mode. A 280px component inside a desktop page still uses the overflow menu. Selection and panel state survive either transition.
163
+
Container width determines overflow. When `mobileSelect` is enabled, **viewport width** determines compact mode. A 280px component inside a desktop page still uses the overflow menu. Selection and panel state survive either transition.
164
+
165
+
### Use a select on mobile
166
+
167
+
Tabs keep their buttons and overflow menu at every viewport width by default. Set `:mobileSelect="true"` on an individual Tabs to use a native select on mobile:
The default is `false`. In a Regor app, bind a boolean ref with `:mobileSelect="mobileSelect"`; changing it switches between the mobile select and tab buttons without rebuilding the component or resetting its selected pane. The playground's Use a select on mobile checkbox demonstrates this.
163
177
164
178
## Header slots, overrides and nested groups
165
179
@@ -206,7 +220,7 @@ All variant values are available in the playground: `none`, `solid`, `surface`,
@@ -220,6 +234,11 @@ All variant values are available in the playground: `none`, `solid`, `surface`,
220
234
<p>Set an enabled pane explicitly for predictable initial state. Without a valid checked pane, the enhanced runtime chooses the first enabled pane; the CSS-only fallback displays the first pane.</p>
<p>Set true to use a native select at viewport widths up to 640px. By default, Tabs retain their buttons and overflow menu on mobile.</p>
239
+
<p>Bind a boolean ref to change this per instance. The browser runtime updates the layout automatically and preserves the selected pane; no refresh is needed for this prop.</p>
0 commit comments