-
Notifications
You must be signed in to change notification settings - Fork 54
Add docs for POS > PWC > Tab components #3658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cappslock
merged 1 commit into
2026-01-rc
from
12-16-add_docs_for_pos_pwc_tab_components
Dec 17, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+4.03 KB
packages/ui-extensions/docs/surfaces/point-of-sale/screenshots/tab-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.35 KB
packages/ui-extensions/docs/surfaces/point-of-sale/screenshots/tab-thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions
92
packages/ui-extensions/src/surfaces/point-of-sale/components/Tabs/Tabs.doc.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; | ||
|
|
||
| const data: ReferenceEntityTemplateSchema = { | ||
| name: 'Tabs', | ||
| description: | ||
| 'The `Tabs` component organizes content into separate views, allowing merchants to switch between related information without leaving the current page. Use tabs when you need to present multiple categories of content in a space-efficient manner.' + | ||
| '\n\nTabs consist of a tab list containing clickable tab buttons and corresponding tab panels that display the content. Only one panel is visible at a time, reducing cognitive load and keeping the interface clean.', | ||
| thumbnail: 'tab-thumbnail.png', | ||
| isVisualComponent: true, | ||
| type: '', | ||
| definitions: [ | ||
| { | ||
| title: 'Tabs Properties', | ||
| description: | ||
| 'Configure the following properties on the `Tabs` component.', | ||
| type: 'Tabs', | ||
| }, | ||
| { | ||
| title: 'Tabs Events', | ||
| description: | ||
| 'The `Tabs` component provides event callbacks for handling user interactions. Learn more about [handling events](/docs/api/polaris/using-polaris-web-components#handling-events).', | ||
| type: 'TabsEvents', | ||
| }, | ||
| { | ||
| title: 'TabList', | ||
| description: | ||
| 'The `TabList` component contains the tab buttons. It must be a direct child of the `Tabs` component.', | ||
| type: 'TabListJSXProps', | ||
| }, | ||
| { | ||
| title: 'Tab', | ||
| description: | ||
| 'The `Tab` component represents an individual tab button. It must be placed within a `TabList` and should use the `controls` property to associate it with a corresponding `TabPanel`.', | ||
| type: 'Tab', | ||
| }, | ||
| { | ||
| title: 'TabPanel', | ||
| description: | ||
| 'The `TabPanel` component contains the content for each tab. It must have an `id` that matches the `controls` property of the corresponding `Tab`.', | ||
| type: 'TabPanel', | ||
| }, | ||
| ], | ||
| category: 'Polaris web components', | ||
| subCategory: 'Layout and structure', | ||
| defaultExample: { | ||
| image: 'tab-default.png', | ||
| description: | ||
| 'Organize content into tabs using the `Tabs` component with `TabList`, `Tab`, and `TabPanel` components. This example shows a basic tabbed interface with two tabs.', | ||
| codeblock: { | ||
| title: 'Create a tabbed interface', | ||
| tabs: [ | ||
| { | ||
| code: './examples/default.html', | ||
| language: 'html', | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| subSections: [ | ||
| { | ||
| type: 'Generic', | ||
| anchorLink: 'accessibility', | ||
| title: 'Accessibility', | ||
| sectionContent: ` | ||
| - **Provide accessibility labels:** Use the \`accessibilityLabel\` prop on the \`Tabs\` component to describe the purpose of the tab group. | ||
| - **Ensure keyboard navigation:** The component supports arrow key navigation between tabs and Enter/Space to activate tabs. | ||
| - **Connect tabs and panels:** Always use matching \`controls\` (on Tab) and \`id\` (on TabPanel) properties to maintain proper ARIA relationships. | ||
| `, | ||
| }, | ||
| ], | ||
| related: [], | ||
| examples: { | ||
| description: 'Learn how to handle tab change events.', | ||
| examples: [ | ||
| { | ||
| description: | ||
| 'Subscribe to the `onChange` event to respond when merchants select different tabs. This example shows how to handle tab changes and capture the selected tab value in real time, enabling dynamic behavior based on which tab is active.', | ||
| codeblock: { | ||
| title: 'Handle tab change events', | ||
| tabs: [ | ||
| { | ||
| code: './examples/event-handling.html', | ||
| language: 'html', | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| }; | ||
|
|
||
| export default data; |
14 changes: 14 additions & 0 deletions
14
packages/ui-extensions/src/surfaces/point-of-sale/components/Tabs/examples/default.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <s-tabs defaultValue="tab1"> | ||
| <s-tab-list> | ||
| <s-tab controls="tab1">Tab 1</s-tab> | ||
| <s-tab controls="tab2">Tab 2</s-tab> | ||
| </s-tab-list> | ||
|
|
||
| <s-tab-panel id="tab1"> | ||
| <s-text>Content for Tab 1</s-text> | ||
| </s-tab-panel> | ||
|
|
||
| <s-tab-panel id="tab2"> | ||
| <s-text>Content for Tab 2</s-text> | ||
| </s-tab-panel> | ||
| </s-tabs> |
22 changes: 22 additions & 0 deletions
22
...ges/ui-extensions/src/surfaces/point-of-sale/components/Tabs/examples/event-handling.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <s-tabs | ||
| defaultValue="details" | ||
| onChange={(event) => console.log('Tab changed to:', event.currentTarget.value)} | ||
| > | ||
| <s-tab-list> | ||
| <s-tab controls="details">Details</s-tab> | ||
| <s-tab controls="history">History</s-tab> | ||
| <s-tab controls="notes">Notes</s-tab> | ||
| </s-tab-list> | ||
|
|
||
| <s-tab-panel id="details"> | ||
| <s-text>Customer details and information</s-text> | ||
| </s-tab-panel> | ||
|
|
||
| <s-tab-panel id="history"> | ||
| <s-text>Order and purchase history</s-text> | ||
| </s-tab-panel> | ||
|
|
||
| <s-tab-panel id="notes"> | ||
| <s-text>Customer notes and comments</s-text> | ||
| </s-tab-panel> | ||
| </s-tabs> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be value not default value? This seem like an attempt of a controlled component?