@porsche-design-system/components-angular 4.5.0 → 4.6.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/bin/pds-skill.js +259 -0
- package/fesm2022/porsche-design-system-components-angular.mjs.map +1 -1
- package/package.json +5 -2
- package/skill/SKILL.md +124 -0
- package/skill/references/components/p-accordion/examples/Default.ts +26 -0
- package/skill/references/components/p-accordion/examples/InteractiveElementsInSummary.ts +30 -0
- package/skill/references/components/p-accordion/examples/StickySummary.ts +26 -0
- package/skill/references/components/p-accordion/p-accordion.md +95 -0
- package/skill/references/components/p-ai-tag/examples/Default.ts +13 -0
- package/skill/references/components/p-ai-tag/examples/WithinCheckbox.ts +33 -0
- package/skill/references/components/p-ai-tag/examples/WithinFormLabel.ts +40 -0
- package/skill/references/components/p-ai-tag/examples/WithinImage.ts +16 -0
- package/skill/references/components/p-ai-tag/examples/WithinInputSearch.ts +15 -0
- package/skill/references/components/p-ai-tag/examples/WithinRadioGroup.ts +32 -0
- package/skill/references/components/p-ai-tag/examples/WithinTable.ts +94 -0
- package/skill/references/components/p-ai-tag/examples/WithinText.ts +17 -0
- package/skill/references/components/p-ai-tag/p-ai-tag.md +47 -0
- package/skill/references/components/p-banner/examples/Customization.ts +37 -0
- package/skill/references/components/p-banner/examples/Default.ts +26 -0
- package/skill/references/components/p-banner/p-banner.md +92 -0
- package/skill/references/components/p-button/examples/Default.ts +15 -0
- package/skill/references/components/p-button/examples/Form.ts +26 -0
- package/skill/references/components/p-button/examples/FormAttribute.ts +30 -0
- package/skill/references/components/p-button/p-button.md +118 -0
- package/skill/references/components/p-button-pure/examples/CustomClickableArea.ts +15 -0
- package/skill/references/components/p-button-pure/examples/Default.ts +15 -0
- package/skill/references/components/p-button-pure/examples/Form.ts +26 -0
- package/skill/references/components/p-button-pure/examples/FormAttribute.ts +30 -0
- package/skill/references/components/p-button-pure/p-button-pure.md +118 -0
- package/skill/references/components/p-button-tile/examples/ColorScheme.ts +18 -0
- package/skill/references/components/p-button-tile/examples/Default.ts +21 -0
- package/skill/references/components/p-button-tile/examples/FooterSlot.ts +32 -0
- package/skill/references/components/p-button-tile/examples/Hyphens.ts +38 -0
- package/skill/references/components/p-button-tile/examples/UiBehaviour.ts +44 -0
- package/skill/references/components/p-button-tile/p-button-tile.md +115 -0
- package/skill/references/components/p-canvas/examples/Default.ts +13 -0
- package/skill/references/components/p-canvas/p-canvas.md +91 -0
- package/skill/references/components/p-carousel/examples/Default.ts +26 -0
- package/skill/references/components/p-carousel/examples/DynamicSlides.ts +37 -0
- package/skill/references/components/p-carousel/examples/FlexibleWidths.ts +32 -0
- package/skill/references/components/p-carousel/examples/FocusOnCenterSlide.ts +65 -0
- package/skill/references/components/p-carousel/examples/Intl.ts +23 -0
- package/skill/references/components/p-carousel/examples/JumpToSlide.ts +50 -0
- package/skill/references/components/p-carousel/p-carousel.md +142 -0
- package/skill/references/components/p-checkbox/examples/Default.ts +13 -0
- package/skill/references/components/p-checkbox/examples/Form.ts +31 -0
- package/skill/references/components/p-checkbox/examples/Indeterminate.ts +16 -0
- package/skill/references/components/p-checkbox/examples/Slots.ts +57 -0
- package/skill/references/components/p-checkbox/examples/WrappedLabel.ts +27 -0
- package/skill/references/components/p-checkbox/p-checkbox.md +122 -0
- package/skill/references/components/p-crest/examples/CustomClickableArea.ts +13 -0
- package/skill/references/components/p-crest/examples/Default.ts +13 -0
- package/skill/references/components/p-crest/examples/Link.ts +13 -0
- package/skill/references/components/p-crest/p-crest.md +65 -0
- package/skill/references/components/p-display/examples/Color.ts +15 -0
- package/skill/references/components/p-display/examples/Default.ts +15 -0
- package/skill/references/components/p-display/examples/Semantics.ts +21 -0
- package/skill/references/components/p-display/examples/Size.ts +15 -0
- package/skill/references/components/p-display/examples/SizeResponsive.ts +15 -0
- package/skill/references/components/p-display/p-display.md +78 -0
- package/skill/references/components/p-divider/examples/Default.ts +13 -0
- package/skill/references/components/p-divider/examples/Responsive.ts +15 -0
- package/skill/references/components/p-divider/examples/Vertical.ts +15 -0
- package/skill/references/components/p-divider/p-divider.md +49 -0
- package/skill/references/components/p-drilldown/examples/CustomContent.ts +166 -0
- package/skill/references/components/p-drilldown/examples/Default.ts +119 -0
- package/skill/references/components/p-drilldown/p-drilldown.md +168 -0
- package/skill/references/components/p-fieldset/examples/Default.ts +15 -0
- package/skill/references/components/p-fieldset/examples/Required.ts +16 -0
- package/skill/references/components/p-fieldset/examples/SlottedLabel.ts +18 -0
- package/skill/references/components/p-fieldset/examples/SlottedMessage.ts +18 -0
- package/skill/references/components/p-fieldset/p-fieldset.md +88 -0
- package/skill/references/components/p-flag/examples/Default.ts +13 -0
- package/skill/references/components/p-flag/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-flag/examples/Size.ts +16 -0
- package/skill/references/components/p-flag/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-flag/p-flag.md +68 -0
- package/skill/references/components/p-flyout/examples/CustomStyling.ts +47 -0
- package/skill/references/components/p-flyout/examples/Default.ts +44 -0
- package/skill/references/components/p-flyout/examples/Form.ts +47 -0
- package/skill/references/components/p-flyout/examples/StickyTop.ts +44 -0
- package/skill/references/components/p-flyout/p-flyout.md +128 -0
- package/skill/references/components/p-heading/examples/Color.ts +15 -0
- package/skill/references/components/p-heading/examples/Default.ts +15 -0
- package/skill/references/components/p-heading/examples/Semantics.ts +21 -0
- package/skill/references/components/p-heading/p-heading.md +78 -0
- package/skill/references/components/p-icon/examples/Color.ts +16 -0
- package/skill/references/components/p-icon/examples/ColorCssVar.ts +13 -0
- package/skill/references/components/p-icon/examples/Custom.ts +13 -0
- package/skill/references/components/p-icon/examples/Default.ts +13 -0
- package/skill/references/components/p-icon/examples/Overview.ts +591 -0
- package/skill/references/components/p-icon/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-icon/examples/Size.ts +16 -0
- package/skill/references/components/p-icon/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-icon/p-icon.md +88 -0
- package/skill/references/components/p-inline-notification/examples/ActionButton.ts +29 -0
- package/skill/references/components/p-inline-notification/examples/Default.ts +13 -0
- package/skill/references/components/p-inline-notification/examples/EventHandling.ts +31 -0
- package/skill/references/components/p-inline-notification/p-inline-notification.md +74 -0
- package/skill/references/components/p-input-date/examples/Default.ts +13 -0
- package/skill/references/components/p-input-date/examples/Form.ts +31 -0
- package/skill/references/components/p-input-date/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-date/p-input-date.md +138 -0
- package/skill/references/components/p-input-email/examples/Default.ts +13 -0
- package/skill/references/components/p-input-email/examples/Form.ts +31 -0
- package/skill/references/components/p-input-email/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-email/p-input-email.md +142 -0
- package/skill/references/components/p-input-month/examples/Default.ts +13 -0
- package/skill/references/components/p-input-month/examples/Form.ts +31 -0
- package/skill/references/components/p-input-month/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-month/p-input-month.md +138 -0
- package/skill/references/components/p-input-number/examples/Default.ts +13 -0
- package/skill/references/components/p-input-number/examples/Form.ts +31 -0
- package/skill/references/components/p-input-number/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-number/p-input-number.md +146 -0
- package/skill/references/components/p-input-password/examples/Default.ts +13 -0
- package/skill/references/components/p-input-password/examples/Form.ts +31 -0
- package/skill/references/components/p-input-password/examples/Slots.ts +42 -0
- package/skill/references/components/p-input-password/examples/Toggle.ts +13 -0
- package/skill/references/components/p-input-password/p-input-password.md +141 -0
- package/skill/references/components/p-input-search/examples/AriaCombobox.ts +38 -0
- package/skill/references/components/p-input-search/examples/Default.ts +13 -0
- package/skill/references/components/p-input-search/examples/Form.ts +31 -0
- package/skill/references/components/p-input-search/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-search/p-input-search.md +178 -0
- package/skill/references/components/p-input-tel/examples/Default.ts +13 -0
- package/skill/references/components/p-input-tel/examples/Form.ts +31 -0
- package/skill/references/components/p-input-tel/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-tel/p-input-tel.md +141 -0
- package/skill/references/components/p-input-text/examples/Controlled.ts +36 -0
- package/skill/references/components/p-input-text/examples/Default.ts +13 -0
- package/skill/references/components/p-input-text/examples/Form.ts +31 -0
- package/skill/references/components/p-input-text/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-text/p-input-text.md +146 -0
- package/skill/references/components/p-input-time/examples/Default.ts +13 -0
- package/skill/references/components/p-input-time/examples/Form.ts +31 -0
- package/skill/references/components/p-input-time/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-time/p-input-time.md +140 -0
- package/skill/references/components/p-input-url/examples/Default.ts +13 -0
- package/skill/references/components/p-input-url/examples/Form.ts +31 -0
- package/skill/references/components/p-input-url/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-url/p-input-url.md +141 -0
- package/skill/references/components/p-input-week/examples/Default.ts +13 -0
- package/skill/references/components/p-input-week/examples/Form.ts +31 -0
- package/skill/references/components/p-input-week/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-week/p-input-week.md +138 -0
- package/skill/references/components/p-link/examples/Default.ts +15 -0
- package/skill/references/components/p-link/examples/FrameworkRouting.ts +17 -0
- package/skill/references/components/p-link/examples/Icon.ts +20 -0
- package/skill/references/components/p-link/p-link.md +101 -0
- package/skill/references/components/p-link-pure/examples/CustomClickableArea.ts +15 -0
- package/skill/references/components/p-link-pure/examples/Default.ts +15 -0
- package/skill/references/components/p-link-pure/examples/FrameworkRouting.ts +17 -0
- package/skill/references/components/p-link-pure/examples/Icon.ts +20 -0
- package/skill/references/components/p-link-pure/p-link-pure.md +110 -0
- package/skill/references/components/p-link-tile/examples/ColorScheme.ts +18 -0
- package/skill/references/components/p-link-tile/examples/Default.ts +21 -0
- package/skill/references/components/p-link-tile/examples/FooterSlot.ts +32 -0
- package/skill/references/components/p-link-tile/examples/Hyphens.ts +39 -0
- package/skill/references/components/p-link-tile/examples/UiBehaviour.ts +44 -0
- package/skill/references/components/p-link-tile/examples/WithVideo.ts +18 -0
- package/skill/references/components/p-link-tile/p-link-tile.md +105 -0
- package/skill/references/components/p-link-tile-product/examples/Default.ts +24 -0
- package/skill/references/components/p-link-tile-product/examples/FrameworkRouting.ts +27 -0
- package/skill/references/components/p-link-tile-product/p-link-tile-product.md +93 -0
- package/skill/references/components/p-modal/examples/AlertDialog.ts +41 -0
- package/skill/references/components/p-modal/examples/CustomStyling.ts +28 -0
- package/skill/references/components/p-modal/examples/Default.ts +41 -0
- package/skill/references/components/p-modal/examples/Scrollable.ts +45 -0
- package/skill/references/components/p-modal/p-modal.md +135 -0
- package/skill/references/components/p-model-signature/examples/CustomStyling.ts +17 -0
- package/skill/references/components/p-model-signature/examples/Default.ts +13 -0
- package/skill/references/components/p-model-signature/examples/MaskBlendMode.ts +35 -0
- package/skill/references/components/p-model-signature/examples/MaskImage.ts +15 -0
- package/skill/references/components/p-model-signature/examples/MaskVideo.ts +15 -0
- package/skill/references/components/p-model-signature/examples/SafeZone.ts +63 -0
- package/skill/references/components/p-model-signature/p-model-signature.md +62 -0
- package/skill/references/components/p-multi-select/examples/AsyncFilter.ts +149 -0
- package/skill/references/components/p-multi-select/examples/Default.ts +32 -0
- package/skill/references/components/p-multi-select/examples/Form.ts +38 -0
- package/skill/references/components/p-multi-select/examples/Optgroups.ts +45 -0
- package/skill/references/components/p-multi-select/examples/SelectedSlot.ts +103 -0
- package/skill/references/components/p-multi-select/examples/SetValue.ts +76 -0
- package/skill/references/components/p-multi-select/examples/Slots.ts +51 -0
- package/skill/references/components/p-multi-select/p-multi-select.md +197 -0
- package/skill/references/components/p-pagination/examples/Default.ts +13 -0
- package/skill/references/components/p-pagination/p-pagination.md +83 -0
- package/skill/references/components/p-pin-code/examples/CopyPaste.ts +13 -0
- package/skill/references/components/p-pin-code/examples/Default.ts +13 -0
- package/skill/references/components/p-pin-code/examples/Form.ts +31 -0
- package/skill/references/components/p-pin-code/examples/Slots.ts +42 -0
- package/skill/references/components/p-pin-code/p-pin-code.md +109 -0
- package/skill/references/components/p-popover/examples/Default.ts +17 -0
- package/skill/references/components/p-popover/examples/SlottedButton.ts +18 -0
- package/skill/references/components/p-popover/p-popover.md +116 -0
- package/skill/references/components/p-radio-group/examples/Default.ts +20 -0
- package/skill/references/components/p-radio-group/examples/Form.ts +38 -0
- package/skill/references/components/p-radio-group/examples/Slots.ts +72 -0
- package/skill/references/components/p-radio-group/p-radio-group.md +157 -0
- package/skill/references/components/p-scroller/examples/Default.ts +54 -0
- package/skill/references/components/p-scroller/examples/Height.ts +29 -0
- package/skill/references/components/p-scroller/examples/ScrollToPosition.ts +43 -0
- package/skill/references/components/p-scroller/p-scroller.md +93 -0
- package/skill/references/components/p-segmented-control/examples/Default.ts +29 -0
- package/skill/references/components/p-segmented-control/examples/Form.ts +37 -0
- package/skill/references/components/p-segmented-control/examples/Slots.ts +57 -0
- package/skill/references/components/p-segmented-control/examples/WithLabels.ts +29 -0
- package/skill/references/components/p-segmented-control/p-segmented-control.md +162 -0
- package/skill/references/components/p-select/examples/AsyncFilter.ts +149 -0
- package/skill/references/components/p-select/examples/Default.ts +32 -0
- package/skill/references/components/p-select/examples/Form.ts +38 -0
- package/skill/references/components/p-select/examples/Optgroups.ts +45 -0
- package/skill/references/components/p-select/examples/Required.ts +48 -0
- package/skill/references/components/p-select/examples/SelectedSlot.ts +130 -0
- package/skill/references/components/p-select/examples/SetValue.ts +71 -0
- package/skill/references/components/p-select/examples/Slots.ts +51 -0
- package/skill/references/components/p-select/examples/SlottedImages.ts +38 -0
- package/skill/references/components/p-select/p-select.md +194 -0
- package/skill/references/components/p-sheet/examples/Default.ts +33 -0
- package/skill/references/components/p-sheet/p-sheet.md +121 -0
- package/skill/references/components/p-spinner/examples/Color.ts +16 -0
- package/skill/references/components/p-spinner/examples/ColorCssVar.ts +13 -0
- package/skill/references/components/p-spinner/examples/Default.ts +13 -0
- package/skill/references/components/p-spinner/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-spinner/examples/Size.ts +16 -0
- package/skill/references/components/p-spinner/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-spinner/p-spinner.md +96 -0
- package/skill/references/components/p-stepper-horizontal/examples/Default.ts +26 -0
- package/skill/references/components/p-stepper-horizontal/examples/FrameworkImplementation.ts +107 -0
- package/skill/references/components/p-stepper-horizontal/p-stepper-horizontal.md +109 -0
- package/skill/references/components/p-switch/examples/Default.ts +21 -0
- package/skill/references/components/p-switch/p-switch.md +103 -0
- package/skill/references/components/p-table/examples/Advanced.ts +162 -0
- package/skill/references/components/p-table/examples/CaptionProperty.ts +40 -0
- package/skill/references/components/p-table/examples/CaptionSlot.ts +43 -0
- package/skill/references/components/p-table/examples/Default.ts +120 -0
- package/skill/references/components/p-table/examples/HideLabel.ts +40 -0
- package/skill/references/components/p-table/examples/LayoutFixed.ts +53 -0
- package/skill/references/components/p-table/examples/Sorting.ts +79 -0
- package/skill/references/components/p-table/p-table.md +189 -0
- package/skill/references/components/p-tabs/examples/ActiveTab.ts +29 -0
- package/skill/references/components/p-tabs/examples/Default.ts +29 -0
- package/skill/references/components/p-tabs/examples/Gradient.ts +114 -0
- package/skill/references/components/p-tabs/examples/Labelling.ts +29 -0
- package/skill/references/components/p-tabs/p-tabs.md +136 -0
- package/skill/references/components/p-tabs-bar/examples/Default.ts +29 -0
- package/skill/references/components/p-tabs-bar/examples/Gradient.ts +80 -0
- package/skill/references/components/p-tabs-bar/examples/Labelling.ts +29 -0
- package/skill/references/components/p-tabs-bar/examples/Links.ts +23 -0
- package/skill/references/components/p-tabs-bar/p-tabs-bar.md +181 -0
- package/skill/references/components/p-tag/examples/Default.ts +15 -0
- package/skill/references/components/p-tag/examples/Multiline.ts +17 -0
- package/skill/references/components/p-tag/examples/SlottedButton.ts +44 -0
- package/skill/references/components/p-tag/examples/SlottedLink.ts +44 -0
- package/skill/references/components/p-tag/p-tag.md +66 -0
- package/skill/references/components/p-tag-dismissible/examples/Default.ts +15 -0
- package/skill/references/components/p-tag-dismissible/p-tag-dismissible.md +75 -0
- package/skill/references/components/p-text/examples/Default.ts +15 -0
- package/skill/references/components/p-text/examples/Semantics.ts +21 -0
- package/skill/references/components/p-text/examples/Size.ts +15 -0
- package/skill/references/components/p-text/examples/SizeResponsive.ts +15 -0
- package/skill/references/components/p-text/p-text.md +68 -0
- package/skill/references/components/p-text-list/examples/Default.ts +31 -0
- package/skill/references/components/p-text-list/p-text-list.md +68 -0
- package/skill/references/components/p-textarea/examples/Default.ts +13 -0
- package/skill/references/components/p-textarea/examples/Form.ts +31 -0
- package/skill/references/components/p-textarea/examples/Slots.ts +42 -0
- package/skill/references/components/p-textarea/p-textarea.md +122 -0
- package/skill/references/components/p-toast/examples/Default.ts +23 -0
- package/skill/references/components/p-toast/p-toast.md +61 -0
- package/skill/references/components/p-wordmark/examples/CustomClickableArea.ts +13 -0
- package/skill/references/components/p-wordmark/examples/Default.ts +13 -0
- package/skill/references/components/p-wordmark/examples/Size.ts +13 -0
- package/skill/references/components/p-wordmark/p-wordmark.md +66 -0
- package/skill/references/icons.md +5 -0
- package/skill/references/styles/emotion.md +439 -0
- package/skill/references/styles/scss.md +402 -0
- package/skill/references/styles/tailwindcss.md +356 -0
- package/skill/references/styles/vanilla-extract.md +444 -0
- package/skill/references/stylesheets.md +331 -0
- package/skill/references/tokens.md +323 -0
- package/types/porsche-design-system-components-angular.d.ts +2 -2
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# p-tabs
|
|
2
|
+
|
|
3
|
+
The `p-tabs` component makes it easy to explore and switch between different views. You can organize and allow navigation between groups of content that are related and at the same level of hierarchy. The component handles the display of content according to the active tab and all accessibility attributes on your tab and tab content.
|
|
4
|
+
|
|
5
|
+
This variant does not support `a` tags and should not be used for navigation. If you need to update your window location have a look at [Tabs Bar](../p-tabs-bar/p-tabs-bar.md) component.
|
|
6
|
+
|
|
7
|
+
Basic implementation shows a tab list with buttons to switch between the content. For every `p-tabs-item` inside of the `p-tabs` component, a tab will be created. The assigned `label` property defines also the name of the button.
|
|
8
|
+
|
|
9
|
+
Every `p-tabs-item` holds a `slot` to display content which can be individually assigned.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use when there is a large amount of content that can be separated.
|
|
16
|
+
- Use to make the content accessible without reloading the page or compromising on space.
|
|
17
|
+
|
|
18
|
+
### Don't:
|
|
19
|
+
|
|
20
|
+
- Don't place more than six tabs within a group.
|
|
21
|
+
- Don't use more than two words for a tab label whenever possible.
|
|
22
|
+
- Don't use it for primary navigation.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Related Component
|
|
27
|
+
|
|
28
|
+
- [Tabs Bar](../p-tabs-bar/p-tabs-bar.md)
|
|
29
|
+
|
|
30
|
+
## Accessibility support
|
|
31
|
+
|
|
32
|
+
### Keyboard
|
|
33
|
+
|
|
34
|
+
| Key / state | Function |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `Tab` | - Moves focus to the active tab. - When the tab list contains the focus, moves focus to the next element in the tab sequence, which is the `tabpanel` element. |
|
|
37
|
+
| `Right Arrow`, `Left Arrow` | - Moves focus to the next tab. - Activates the newly focused tab. - If focus is on the last tab, moves focus to the first tab. |
|
|
38
|
+
| `Home`, `End` | - Moves focus to the first/last tab and activates it. |
|
|
39
|
+
|
|
40
|
+
### ARIA enhancements
|
|
41
|
+
|
|
42
|
+
#### External **ARIA** provided by the `aria` property:
|
|
43
|
+
|
|
44
|
+
| ARIA | Usage |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `aria-label="STRING"` | Defines a string value that labels the tablist. |
|
|
47
|
+
| `aria-description="STRING"` | Defines a string value that adds a more detailed description of the tablist. |
|
|
48
|
+
|
|
49
|
+
#### Internal **ARIA** that is managed by the component:
|
|
50
|
+
|
|
51
|
+
| ARIA | Usage |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `role="tablist"` | Indicates that the element serves as a container for a set of tabs. |
|
|
54
|
+
| `role="tab"` | Indicates the button serves as a tab control. |
|
|
55
|
+
| `role="tabpanel"` | Indicates the `tabs-item` serves as a container for tabpanel content. |
|
|
56
|
+
| `aria-label="STRING"` | Adds accessible name to the `tabs-item` based on the `label` property. |
|
|
57
|
+
| `aria-selected="BOOLEAN"` | Indicates whether the tab is selected and whether its associated tabpanel is visible. |
|
|
58
|
+
|
|
59
|
+
## Development considerations
|
|
60
|
+
|
|
61
|
+
### Labelling
|
|
62
|
+
|
|
63
|
+
When multiple tab groups appear on the same page, or when the purpose of the tabs is not clear from the visible tab labels alone, provide a descriptive accessible name for the tablist using the `aria` property, e.g.: `<p-tabs aria="{ 'aria-label': 'Some label for the tablist', 'aria-description': 'Some description for the tablist' }">`.
|
|
64
|
+
|
|
65
|
+
### Common do's and don'ts
|
|
66
|
+
|
|
67
|
+
- **Do** pass tablist ARIA through the `aria` prop when multiple tab groups appear on one page.
|
|
68
|
+
- **Do** use specific `label` text on each `p-tabs-item`.
|
|
69
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
70
|
+
- **Don't** use vague tab labels like "Details" without context.
|
|
71
|
+
|
|
72
|
+
## Limitations
|
|
73
|
+
|
|
74
|
+
Due to the nature of **Web Components** and **shadow DOM**, there are limitations when using some **ARIA** attributes to define relationships between elements across different shadow DOMs or shadow DOM/light DOM combinations.
|
|
75
|
+
|
|
76
|
+
| ARIA | Support |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `aria-controls` | 🚫 |
|
|
79
|
+
|
|
80
|
+
## API
|
|
81
|
+
|
|
82
|
+
### Properties
|
|
83
|
+
|
|
84
|
+
| Property | Type | Default | Description |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `activeTabIndex` | `number` | `0` | Sets the zero-based index of the currently active tab; update this prop to switch tabs programmatically. |
|
|
87
|
+
| `aria` | `TabsAriaAttribute` | `undefined` | Sets ARIA attributes on the tablist, such as `aria-label` and `aria-description`. |
|
|
88
|
+
| `background` | `'canvas'` `'surface'` `'frosted'` `'none'` | `'none'` | Sets the background color of the tabs bar. Use `frosted` only when placed on top of images, videos, or gradients. |
|
|
89
|
+
| `compact` | `boolean` | `undefined` | Reduces the tab height and padding for use in dense layouts where vertical space is limited. |
|
|
90
|
+
| `size` | `'small'` `'medium'`<br>`BreakpointCustomizable<TabsSize>` | `'small'` | Sets the font size of the tab labels using the PDS typographic scale. Supports responsive breakpoint values. |
|
|
91
|
+
| `weight` _(deprecated)_ | `'regular'` `'semi-bold'` | `'regular'` | @deprecated Will be removed in the next major release. Has no effect anymore. |
|
|
92
|
+
|
|
93
|
+
### Events
|
|
94
|
+
|
|
95
|
+
| Event | Type | Description |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `update` | `CustomEvent<TabsUpdateEventDetail>`<br>`{ activeTabIndex: number }` | Emitted when the user switches to a different tab, carrying the new `activeTabIndex` in the event detail. |
|
|
98
|
+
|
|
99
|
+
### Controlled properties
|
|
100
|
+
|
|
101
|
+
- `activeTabIndex` — a controlled prop, but the component also updates it internally. Listen for the `update` event to observe changes; you do not have to write the value back.
|
|
102
|
+
|
|
103
|
+
### Slots
|
|
104
|
+
|
|
105
|
+
| Slot | Required | Allowed tag names | Description |
|
|
106
|
+
| --- | --- | --- | --- |
|
|
107
|
+
| _(default)_ | no | — | Default slot for the `p-tabs-item` tags. |
|
|
108
|
+
|
|
109
|
+
## Sub-components
|
|
110
|
+
|
|
111
|
+
These tags are only valid inside the parent(s) listed under each one — often this component, but some are shared and list a different parent (e.g. a tag documented here via a common ancestor). Their APIs come from the same authoritative `component-meta` as the parent above.
|
|
112
|
+
|
|
113
|
+
### `p-tabs-item`
|
|
114
|
+
|
|
115
|
+
Allowed parent: `p-tabs`.
|
|
116
|
+
|
|
117
|
+
#### Properties
|
|
118
|
+
|
|
119
|
+
| Property | Type | Default | Description |
|
|
120
|
+
| --- | --- | --- | --- |
|
|
121
|
+
| `label` _(required)_ | `string` | `undefined` | Sets the label text displayed in the tab navigation button that the user clicks to activate this tab's content. |
|
|
122
|
+
|
|
123
|
+
#### Slots
|
|
124
|
+
|
|
125
|
+
| Slot | Required | Allowed tag names | Description |
|
|
126
|
+
| --- | --- | --- | --- |
|
|
127
|
+
| _(default)_ | no | — | Default slot for the tab content. |
|
|
128
|
+
|
|
129
|
+
## Examples
|
|
130
|
+
|
|
131
|
+
| Example | When to use | File |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
134
|
+
| Gradient color | If the amount of tabs exceeds the viewport, the component renders arrow-buttons to help with horizontal scrolling. | [./examples/Gradient.ts](./examples/Gradient.ts) |
|
|
135
|
+
| Active Tab | You may need to change the initial active tab. | [./examples/ActiveTab.ts](./examples/ActiveTab.ts) |
|
|
136
|
+
| Labelling | Use the `aria` property to provide an accessible name and optional description for the tablist. | [./examples/Labelling.ts](./examples/Labelling.ts) |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule, type TabsBarUpdateEventDetail } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-tabs-bar [activeTabIndex]="activeTabIndex" [aria]="{'aria-label': 'Some label for the tablist', 'aria-description': 'Some description for the tablist'}" (update)="onUpdate($event)">
|
|
8
|
+
<button type="button">
|
|
9
|
+
Tab One
|
|
10
|
+
</button>
|
|
11
|
+
<button type="button">
|
|
12
|
+
Tab Two
|
|
13
|
+
</button>
|
|
14
|
+
<button type="button">
|
|
15
|
+
Tab Three
|
|
16
|
+
</button>
|
|
17
|
+
</p-tabs-bar>
|
|
18
|
+
`,
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
22
|
+
})
|
|
23
|
+
export class ExampleComponent {
|
|
24
|
+
activeTabIndex = 0;
|
|
25
|
+
|
|
26
|
+
onUpdate(e: CustomEvent<TabsBarUpdateEventDetail>) {
|
|
27
|
+
this.activeTabIndex = e.detail.activeTabIndex;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule, type TabsBarUpdateEventDetail } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-tabs-bar [activeTabIndex]="activeTabIndex" [aria]="{'aria-label': 'Some label for the tablist', 'aria-description': 'Some description for the tablist'}" (update)="onUpdate($event)">
|
|
8
|
+
<button type="button">
|
|
9
|
+
Tab 0
|
|
10
|
+
</button>
|
|
11
|
+
<button type="button">
|
|
12
|
+
Tab 1
|
|
13
|
+
</button>
|
|
14
|
+
<button type="button">
|
|
15
|
+
Tab 2
|
|
16
|
+
</button>
|
|
17
|
+
<button type="button">
|
|
18
|
+
Tab 3
|
|
19
|
+
</button>
|
|
20
|
+
<button type="button">
|
|
21
|
+
Tab 4
|
|
22
|
+
</button>
|
|
23
|
+
<button type="button">
|
|
24
|
+
Tab 5
|
|
25
|
+
</button>
|
|
26
|
+
<button type="button">
|
|
27
|
+
Tab 6
|
|
28
|
+
</button>
|
|
29
|
+
<button type="button">
|
|
30
|
+
Tab 7
|
|
31
|
+
</button>
|
|
32
|
+
<button type="button">
|
|
33
|
+
Tab 8
|
|
34
|
+
</button>
|
|
35
|
+
<button type="button">
|
|
36
|
+
Tab 9
|
|
37
|
+
</button>
|
|
38
|
+
<button type="button">
|
|
39
|
+
Tab 10
|
|
40
|
+
</button>
|
|
41
|
+
<button type="button">
|
|
42
|
+
Tab 11
|
|
43
|
+
</button>
|
|
44
|
+
<button type="button">
|
|
45
|
+
Tab 12
|
|
46
|
+
</button>
|
|
47
|
+
<button type="button">
|
|
48
|
+
Tab 13
|
|
49
|
+
</button>
|
|
50
|
+
<button type="button">
|
|
51
|
+
Tab 14
|
|
52
|
+
</button>
|
|
53
|
+
<button type="button">
|
|
54
|
+
Tab 15
|
|
55
|
+
</button>
|
|
56
|
+
<button type="button">
|
|
57
|
+
Tab 16
|
|
58
|
+
</button>
|
|
59
|
+
<button type="button">
|
|
60
|
+
Tab 17
|
|
61
|
+
</button>
|
|
62
|
+
<button type="button">
|
|
63
|
+
Tab 18
|
|
64
|
+
</button>
|
|
65
|
+
<button type="button">
|
|
66
|
+
Tab 19
|
|
67
|
+
</button>
|
|
68
|
+
</p-tabs-bar>
|
|
69
|
+
`,
|
|
70
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
71
|
+
standalone: true,
|
|
72
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
73
|
+
})
|
|
74
|
+
export class ExampleComponent {
|
|
75
|
+
activeTabIndex = 0;
|
|
76
|
+
|
|
77
|
+
onUpdate(e: CustomEvent<TabsBarUpdateEventDetail>) {
|
|
78
|
+
this.activeTabIndex = e.detail.activeTabIndex;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule, type TabsBarUpdateEventDetail } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-tabs-bar [activeTabIndex]="activeTabIndex" [aria]="{'aria-label': 'Some label for the tablist', 'aria-description': 'Some description for the tablist'}" (update)="onUpdate($event)">
|
|
8
|
+
<button type="button">
|
|
9
|
+
Tab One
|
|
10
|
+
</button>
|
|
11
|
+
<button type="button">
|
|
12
|
+
Tab Two
|
|
13
|
+
</button>
|
|
14
|
+
<button type="button">
|
|
15
|
+
Tab Three
|
|
16
|
+
</button>
|
|
17
|
+
</p-tabs-bar>
|
|
18
|
+
`,
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
22
|
+
})
|
|
23
|
+
export class ExampleComponent {
|
|
24
|
+
activeTabIndex = 0;
|
|
25
|
+
|
|
26
|
+
onUpdate(e: CustomEvent<TabsBarUpdateEventDetail>) {
|
|
27
|
+
this.activeTabIndex = e.detail.activeTabIndex;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-tabs-bar>
|
|
8
|
+
<a href="https://porsche.com/page-1">
|
|
9
|
+
Page One
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://porsche.com/page-2">
|
|
12
|
+
Page Two
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://porsche.com/page-3">
|
|
15
|
+
Page Three
|
|
16
|
+
</a>
|
|
17
|
+
</p-tabs-bar>
|
|
18
|
+
`,
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
22
|
+
})
|
|
23
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# p-tabs-bar
|
|
2
|
+
|
|
3
|
+
The `p-tabs-bar` component is a styled button/link list for multiple purposes. You can use it with your framework router to ensure your **window location** updates on tab click, use it for **hash routing** and displaying content accordingly to the hash, as **skip navigation** to move on a longer page or to **change the state** of another element and therefore change the appearance of your content.
|
|
4
|
+
|
|
5
|
+
The component does not handle the display of your content. If you use the component you have to manually care for the content to be rendered beneath. To help with this task the component triggers an event called `update` with the index of the active tab.
|
|
6
|
+
|
|
7
|
+
If you intend to only change content on tab-click without location changes and you are fine that the content needs to be pre-rendered then we prepared a component which also handles the correct display of content according to the active tab. Have a look at the [Tabs](../p-tabs/p-tabs.md) component.
|
|
8
|
+
|
|
9
|
+
It is a controlled component. This means it does not contain any internal state, and you are in full control over its behavior.
|
|
10
|
+
|
|
11
|
+
> **Important note**
|
|
12
|
+
>
|
|
13
|
+
> For documentation purpose we use `<button>` tags in the examples below to make them clickable without changing the route. For route changes it is mandatory to use `<a>` tags with `href` in your application. And be aware of that it's not allowed to mix and match `<button>` with `<a>` tags as direct children in the component!
|
|
14
|
+
|
|
15
|
+
Basic implementation is a tab bar with tabs to switch between the content. Just put `<button>` tags if you need to change e.g. the state on tab-click or `<a>` tags, if you also have to manipulate the window location, inside the `<p-tabs-bar>` component and it will handle all styling behaviors.
|
|
16
|
+
|
|
17
|
+
In order to get notified when the active tabs change, you need to register an event listener for the `update` event which is emitted by `p-tabs-bar`.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Do:
|
|
22
|
+
|
|
23
|
+
- Use as an anchor navigation to jump to a section on a longer page.
|
|
24
|
+
- Use it to switch between different stages of content.
|
|
25
|
+
- Use it to show different types of elements.
|
|
26
|
+
|
|
27
|
+
### Don't:
|
|
28
|
+
|
|
29
|
+
- Don't place more than six tabs within a group.
|
|
30
|
+
- Don't use more than two words for a tab label whenever possible.
|
|
31
|
+
- Don't use it for primary navigation.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Related Component
|
|
36
|
+
|
|
37
|
+
- [Tabs](../p-tabs/p-tabs.md)
|
|
38
|
+
- [Pagination](../p-pagination/p-pagination.md)
|
|
39
|
+
|
|
40
|
+
## Accessibility support
|
|
41
|
+
|
|
42
|
+
### Keyboard
|
|
43
|
+
|
|
44
|
+
#### Tabs Bar as a tabbed interface
|
|
45
|
+
|
|
46
|
+
| Key / state | Function |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `Tab` | - Moves focus to the active tab. - When the tab list contains the focus, moves focus to the next element in the tab sequence, which is the `tabpanel` element. |
|
|
49
|
+
| `Right Arrow`, `Left Arrow` | - Moves focus to the next tab. - Activates the newly focused tab. - If focus is on the last tab, moves focus to the first tab. |
|
|
50
|
+
| `Home`, `End` | - Moves focus to the first/last tab and activates it. |
|
|
51
|
+
|
|
52
|
+
#### Tabs Bar as link list
|
|
53
|
+
|
|
54
|
+
| Key / state | Function |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `Tab`, `Shift-Tab` | Moves focus to next (or previous) focusable element. |
|
|
57
|
+
| `Enter` | Activates the link. |
|
|
58
|
+
|
|
59
|
+
### ARIA enhancements
|
|
60
|
+
|
|
61
|
+
#### External **ARIA** provided by the `aria` property:
|
|
62
|
+
|
|
63
|
+
| ARIA | Usage |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `aria-label="STRING"` | Defines a string value that labels the tablist when used as a tabbed interface. |
|
|
66
|
+
| `aria-description="STRING"` | Defines a string value that adds a more detailed description of the tablist. |
|
|
67
|
+
|
|
68
|
+
The `aria` property applies only when the component is used as a **tabbed interface** with `<button>` children. It is not applied when the component is used as a **link list** with `<a>` children.
|
|
69
|
+
|
|
70
|
+
#### Internal **ARIA** that is managed by the component:
|
|
71
|
+
|
|
72
|
+
| ARIA | Usage |
|
|
73
|
+
| --- | --- |
|
|
74
|
+
| `role="tablist"` | Indicates that the element serves as a container for a set of tabs. |
|
|
75
|
+
| `role="tab"` | Indicates the button serves as a tab control. |
|
|
76
|
+
| `aria-selected="BOOLEAN"` | Indicates whether the tab is selected and whether its associated tabpanel is visible. |
|
|
77
|
+
|
|
78
|
+
## Development considerations
|
|
79
|
+
|
|
80
|
+
### Labelling
|
|
81
|
+
|
|
82
|
+
When multiple tab bars appear on the same page, or when the purpose of the tabs is not clear from the visible tab labels alone, provide a descriptive accessible name for the tablist using the `aria` property, e.g.: `<p-tabs-bar aria="{ 'aria-label': 'Some label for the tablist', 'aria-description': 'Some description for the tablist' }">`.
|
|
83
|
+
|
|
84
|
+
### ARIA enhancements if used as a tabbed interface
|
|
85
|
+
|
|
86
|
+
The `p-tabs-bar` component is detached from the content (`tabpanel`) which belongs to the active tab. To be truly accessible you need to provide additional ARIA attributes, because every tab (`button`) needs an `aria-controls` attribute which points to the corresponding `id` of the `tabpanel`. The content placeholder needs the `role="tabpanel"` and the attribute `aria-labelledby` which points to the unique `id` of the corresponding tab (`button`).
|
|
87
|
+
|
|
88
|
+
You must also take care of the **focus handling** of the `tabpanel`. Therefore, the active tab panel must have a `tabindex="0"` to receive keyboard focus and the focus indicator must be styled accordingly. Use the provided focus style like this:
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<p-tabs-bar
|
|
92
|
+
aria="{ 'aria-label': 'Some label for the tablist', 'aria-description': 'Some description for the tablist' }"
|
|
93
|
+
active-tab-index="0"
|
|
94
|
+
>
|
|
95
|
+
<button type="button" id="tab-item-0" aria-controls="tab-panel-0">Tab One</button>
|
|
96
|
+
<button type="button" id="tab-item-1" aria-controls="tab-panel-1">Tab Two</button>
|
|
97
|
+
<button type="button" id="tab-item-2" aria-controls="tab-panel-2">Tab Three</button>
|
|
98
|
+
</p-tabs-bar>
|
|
99
|
+
<div id="tab-panel-0" role="tabpanel" tabindex="0" aria-labelledby="tab-item-0">
|
|
100
|
+
<p-text>Your content of Tab 1</p-text>
|
|
101
|
+
</div>
|
|
102
|
+
<div id="tab-panel-1" role="tabpanel" hidden tabindex="-1" aria-labelledby="tab-item-1">
|
|
103
|
+
<p-text>Your content of Tab 2</p-text>
|
|
104
|
+
</div>
|
|
105
|
+
<div id="tab-panel-2" role="tabpanel" hidden tabindex="-1" aria-labelledby="tab-item-2">
|
|
106
|
+
<p-text>Your content of Tab 3</p-text>
|
|
107
|
+
</div>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```scss
|
|
111
|
+
p-tabs-bar ~ [tabindex='0'][role='tabpanel'] {
|
|
112
|
+
@include pds-focus;
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### ARIA enhancements if used as a link list
|
|
117
|
+
|
|
118
|
+
#### Route based navigation
|
|
119
|
+
|
|
120
|
+
If the `p-tabs-bar` is used as a link list (navigation context), the semantics of that UI component changes completely - from a **tabbed interface** where content changes happen **on-site** to a **list of links** where content changes are **route-based**. Therefore, additional ARIA attributes **must not** be provided for tab identification. The `p-tabs-bar` component manages this also internally.
|
|
121
|
+
|
|
122
|
+
To enhance accessibility even further, wrap the `p-tabs-bar` in a `<nav>` element with an `aria-label` attribute. Additionally, an `aria-current="page"` attribute should be provided to the active link.
|
|
123
|
+
|
|
124
|
+
```html
|
|
125
|
+
<nav aria-label="Label for the navigation">
|
|
126
|
+
<p-tabs-bar>
|
|
127
|
+
<a href="https://porsche.com/page-1" aria-current="page">Page One</a>
|
|
128
|
+
<a href="https://porsche.com/page-2">Page Two</a>
|
|
129
|
+
<a href="https://porsche.com/page-3">Page Three</a>
|
|
130
|
+
</p-tabs-bar>
|
|
131
|
+
</nav>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### In-page jump navigation
|
|
135
|
+
|
|
136
|
+
If the `p-tabs-bar` is used as an in-page jump navigation, you should follow the same rules as for the route-based variant except that `aria-current="page"` should not be used.
|
|
137
|
+
|
|
138
|
+
### Common do's and don'ts
|
|
139
|
+
|
|
140
|
+
- **Do** pass tablist ARIA through the `aria` prop when using a tabbed interface.
|
|
141
|
+
- **Do** wrap route-based navigation in `<nav>` with a descriptive `aria-label`.
|
|
142
|
+
- **Do** wire `aria-controls`, `role="tabpanel"`, and `aria-labelledby` in the host application for tab interfaces.
|
|
143
|
+
- **Don't** add tab semantics when the component is used as a link list for route-based navigation.
|
|
144
|
+
|
|
145
|
+
## API
|
|
146
|
+
|
|
147
|
+
### Properties
|
|
148
|
+
|
|
149
|
+
| Property | Type | Default | Description |
|
|
150
|
+
| --- | --- | --- | --- |
|
|
151
|
+
| `activeTabIndex` | `number | undefined` | `undefined` | Sets the zero-based index of the currently active tab. Pass `undefined` to render all tabs in an unselected state. |
|
|
152
|
+
| `aria` | `TabsBarAriaAttribute` | `undefined` | Sets ARIA attributes on the tablist, such as `aria-label` and `aria-description`. |
|
|
153
|
+
| `background` | `'canvas'` `'surface'` `'frosted'` `'none'` | `'none'` | Sets the background color of the tabs bar. Use `frosted` only when placed on top of images, videos, or gradients. |
|
|
154
|
+
| `compact` | `boolean` | `undefined` | Reduces the tab height and padding for use in dense layouts where vertical space is limited. |
|
|
155
|
+
| `size` | `'small'` `'medium'`<br>`BreakpointCustomizable<TabsBarSize>` | `'small'` | Sets the font size of the tab labels using the PDS typographic scale. Supports responsive breakpoint values. |
|
|
156
|
+
| `weight` _(deprecated)_ | `'regular'` `'semi-bold'` | `'regular'` | @deprecated Will be removed in the next major release. Has no effect anymore. |
|
|
157
|
+
|
|
158
|
+
### Events
|
|
159
|
+
|
|
160
|
+
| Event | Type | Description |
|
|
161
|
+
| --- | --- | --- |
|
|
162
|
+
| `update` | `CustomEvent<TabsBarUpdateEventDetail>`<br>`{ activeTabIndex: number }` | Emitted when the user clicks a different tab, carrying the new `activeTabIndex` in the event detail. |
|
|
163
|
+
|
|
164
|
+
### Controlled properties
|
|
165
|
+
|
|
166
|
+
- `activeTabIndex` — a controlled prop: the component does **not** update it itself. Handle the `update` event and assign the new value to `activeTabIndex` yourself, or the change will not take effect.
|
|
167
|
+
|
|
168
|
+
### Slots
|
|
169
|
+
|
|
170
|
+
| Slot | Required | Allowed tag names | Description |
|
|
171
|
+
| --- | --- | --- | --- |
|
|
172
|
+
| _(default)_ | no | — | Default slot for the `button` or `a` tags which will be rendered as tabs. |
|
|
173
|
+
|
|
174
|
+
## Examples
|
|
175
|
+
|
|
176
|
+
| Example | When to use | File |
|
|
177
|
+
| --- | --- | --- |
|
|
178
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
179
|
+
| Links | If the `p-tabs-bar` is used as a link list (navigation context), the semantics of that UI component changes completely - from a **tabbed interface** where content changes happen **on-site** to a **list of links** where content changes are **route-based**. | [./examples/Links.ts](./examples/Links.ts) |
|
|
180
|
+
| Gradient color | If the amount of tabs exceeds the viewport, the component renders arrow-buttons to help with horizontal scrolling. | [./examples/Gradient.ts](./examples/Gradient.ts) |
|
|
181
|
+
| Labelling | Use the `aria` property to provide an accessible name and optional description for the tablist when the component is used as a tabbed interface with `<button>` children. | [./examples/Labelling.ts](./examples/Labelling.ts) |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-tag>
|
|
8
|
+
Some label
|
|
9
|
+
</p-tag>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<div class="w-[100px]">
|
|
8
|
+
<p-tag variant="success" class="whitespace-normal">
|
|
9
|
+
Some label with longer text wrapped in a narrow container
|
|
10
|
+
</p-tag>
|
|
11
|
+
</div>
|
|
12
|
+
`,
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
16
|
+
})
|
|
17
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<div class="flex flex-wrap gap-static-md">
|
|
8
|
+
<p-tag icon="car" variant="primary">
|
|
9
|
+
<button type="button">
|
|
10
|
+
Variant primary
|
|
11
|
+
</button>
|
|
12
|
+
</p-tag>
|
|
13
|
+
<p-tag variant="secondary">
|
|
14
|
+
<button type="button">
|
|
15
|
+
Variant secondary
|
|
16
|
+
</button>
|
|
17
|
+
</p-tag>
|
|
18
|
+
<p-tag variant="info">
|
|
19
|
+
<button type="button">
|
|
20
|
+
Variant info
|
|
21
|
+
</button>
|
|
22
|
+
</p-tag>
|
|
23
|
+
<p-tag variant="warning">
|
|
24
|
+
<button type="button">
|
|
25
|
+
Variant warning
|
|
26
|
+
</button>
|
|
27
|
+
</p-tag>
|
|
28
|
+
<p-tag variant="success">
|
|
29
|
+
<button type="button">
|
|
30
|
+
Variant success
|
|
31
|
+
</button>
|
|
32
|
+
</p-tag>
|
|
33
|
+
<p-tag variant="error">
|
|
34
|
+
<button type="button">
|
|
35
|
+
Variant error
|
|
36
|
+
</button>
|
|
37
|
+
</p-tag>
|
|
38
|
+
</div>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<div class="flex flex-wrap gap-static-md">
|
|
8
|
+
<p-tag icon="car" variant="primary">
|
|
9
|
+
<a href="https://porsche.com">
|
|
10
|
+
Variant primary
|
|
11
|
+
</a>
|
|
12
|
+
</p-tag>
|
|
13
|
+
<p-tag variant="secondary">
|
|
14
|
+
<a href="https://porsche.com">
|
|
15
|
+
Variant secondary
|
|
16
|
+
</a>
|
|
17
|
+
</p-tag>
|
|
18
|
+
<p-tag variant="info">
|
|
19
|
+
<a href="https://porsche.com">
|
|
20
|
+
Variant info
|
|
21
|
+
</a>
|
|
22
|
+
</p-tag>
|
|
23
|
+
<p-tag variant="warning">
|
|
24
|
+
<a href="https://porsche.com">
|
|
25
|
+
Variant warning
|
|
26
|
+
</a>
|
|
27
|
+
</p-tag>
|
|
28
|
+
<p-tag variant="success">
|
|
29
|
+
<a href="https://porsche.com">
|
|
30
|
+
Variant success
|
|
31
|
+
</a>
|
|
32
|
+
</p-tag>
|
|
33
|
+
<p-tag variant="error">
|
|
34
|
+
<a href="https://porsche.com">
|
|
35
|
+
Variant error
|
|
36
|
+
</a>
|
|
37
|
+
</p-tag>
|
|
38
|
+
</div>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|