@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,54 @@
|
|
|
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-scroller class="max-w-[600px] whitespace-nowrap">
|
|
8
|
+
<p-tag class="me-static-md" color="primary">
|
|
9
|
+
<button type="button">
|
|
10
|
+
Some tag content
|
|
11
|
+
</button>
|
|
12
|
+
</p-tag>
|
|
13
|
+
<p-tag class="me-static-md" color="notification-info-soft">
|
|
14
|
+
<button type="button">
|
|
15
|
+
Some tag content
|
|
16
|
+
</button>
|
|
17
|
+
</p-tag>
|
|
18
|
+
<p-tag class="me-static-md" color="notification-warning-soft">
|
|
19
|
+
<button type="button">
|
|
20
|
+
Some tag content
|
|
21
|
+
</button>
|
|
22
|
+
</p-tag>
|
|
23
|
+
<p-tag class="me-static-md" color="primary">
|
|
24
|
+
<button type="button">
|
|
25
|
+
Some tag content
|
|
26
|
+
</button>
|
|
27
|
+
</p-tag>
|
|
28
|
+
<p-tag class="me-static-md" color="notification-info-soft">
|
|
29
|
+
<button type="button">
|
|
30
|
+
Some tag content
|
|
31
|
+
</button>
|
|
32
|
+
</p-tag>
|
|
33
|
+
<p-tag class="me-static-md" color="notification-warning-soft">
|
|
34
|
+
<button type="button">
|
|
35
|
+
Some tag content
|
|
36
|
+
</button>
|
|
37
|
+
</p-tag>
|
|
38
|
+
<p-tag class="me-static-md" color="primary">
|
|
39
|
+
<button type="button">
|
|
40
|
+
Some tag content
|
|
41
|
+
</button>
|
|
42
|
+
</p-tag>
|
|
43
|
+
<p-tag color="notification-info-soft">
|
|
44
|
+
<button type="button">
|
|
45
|
+
Some tag content
|
|
46
|
+
</button>
|
|
47
|
+
</p-tag>
|
|
48
|
+
</p-scroller>
|
|
49
|
+
`,
|
|
50
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
|
+
standalone: true,
|
|
52
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
53
|
+
})
|
|
54
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,29 @@
|
|
|
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-scroller class="max-w-[600px] whitespace-nowrap">
|
|
8
|
+
<p-tag-dismissible class="me-static-md">
|
|
9
|
+
Some tag content
|
|
10
|
+
</p-tag-dismissible>
|
|
11
|
+
<p-tag-dismissible class="me-static-md">
|
|
12
|
+
Some tag content
|
|
13
|
+
</p-tag-dismissible>
|
|
14
|
+
<p-tag-dismissible class="me-static-md">
|
|
15
|
+
Some tag content
|
|
16
|
+
</p-tag-dismissible>
|
|
17
|
+
<p-tag-dismissible class="me-static-md">
|
|
18
|
+
Some tag content
|
|
19
|
+
</p-tag-dismissible>
|
|
20
|
+
<p-tag-dismissible class="me-static-md">
|
|
21
|
+
Some tag content
|
|
22
|
+
</p-tag-dismissible>
|
|
23
|
+
</p-scroller>
|
|
24
|
+
`,
|
|
25
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
28
|
+
})
|
|
29
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
styles: [
|
|
7
|
+
`
|
|
8
|
+
p-scroller > *:not(:last-child) {
|
|
9
|
+
margin-right: 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
button {
|
|
13
|
+
margin: 0 1rem 1rem 0;
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
],
|
|
17
|
+
template: `
|
|
18
|
+
<div class="flex gap-fluid-sm">
|
|
19
|
+
<p-button type="button" (click)="onClick(0)" [compact]="true">Scroll to start</p-button>
|
|
20
|
+
<p-button type="button" (click)="onClick(220)" [compact]="true">Scroll to middle</p-button>
|
|
21
|
+
<p-button type="button" (click)="onClick(720)" [compact]="true">Scroll to end</p-button>
|
|
22
|
+
</div>
|
|
23
|
+
<div style="max-width: 400px; white-space: nowrap" class="mt-fluid-sm">
|
|
24
|
+
<p-scroller [scrollToPosition]="{scrollPosition, isSmooth}">
|
|
25
|
+
<p-tag-dismissible>START - some tag content</p-tag-dismissible>
|
|
26
|
+
<p-tag-dismissible>MIDDLE - some tag content</p-tag-dismissible>
|
|
27
|
+
<p-tag-dismissible>END - some tag content</p-tag-dismissible>
|
|
28
|
+
</p-scroller>
|
|
29
|
+
</div>
|
|
30
|
+
`,
|
|
31
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
32
|
+
standalone: true,
|
|
33
|
+
imports: [PorscheDesignSystemModule],
|
|
34
|
+
})
|
|
35
|
+
export class ExampleComponent {
|
|
36
|
+
scrollPosition: number = 220;
|
|
37
|
+
isSmooth: boolean = false;
|
|
38
|
+
|
|
39
|
+
onClick = (scrollPosition: number) => {
|
|
40
|
+
this.scrollPosition = scrollPosition;
|
|
41
|
+
this.isSmooth = true;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# p-scroller
|
|
2
|
+
|
|
3
|
+
The `p-scroller` component forces its child nodes to be rendered horizontally next to each other. In case not enough viewport space is given a clickable scroll indicator is shown and the elements become scrollable.
|
|
4
|
+
|
|
5
|
+
As soon as the slotted element(s) exceed the viewport / their respective container, scroll indicators are shown.
|
|
6
|
+
|
|
7
|
+
If the `p-scroller` component is accessed by keyboard navigation and is focused, scrolling via `arrow right` and `arrow left` is possible. If `p-scroller` contains focusable element(s) these can be also accessed by keyboard navigation.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Do:
|
|
12
|
+
|
|
13
|
+
- Use when an item or a group of items do not fit into the viewport width and horizontal scrolling is needed.
|
|
14
|
+
- Use it with elements of the same type, appearance, and function that are aligned horizontally.
|
|
15
|
+
- Use the Surface variant if the component is used on the surface background.
|
|
16
|
+
- Use it with one or more focusable elements.
|
|
17
|
+
- Use in components such as Tabs, Table, and Stepper.
|
|
18
|
+
|
|
19
|
+
### Don't:
|
|
20
|
+
|
|
21
|
+
- Don't place important actions or information for customer flow within the scroller.
|
|
22
|
+
- Don't use text that should not have line breaks in the scroller.
|
|
23
|
+
- Don't assume that elements within a scroller are affected by breakpoints and viewport size as they are not.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Related Components
|
|
28
|
+
|
|
29
|
+
- [Tabs](../p-tabs/p-tabs.md)
|
|
30
|
+
- [Table](../p-table/p-table.md)
|
|
31
|
+
- [Stepper](../p-stepper-horizontal/p-stepper-horizontal.md)
|
|
32
|
+
|
|
33
|
+
## Accessibility support
|
|
34
|
+
|
|
35
|
+
### Keyboard
|
|
36
|
+
|
|
37
|
+
| Key / state | Function |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `Tab`, `Shift-Tab` | Moves focus to the scroll container or to next (or previous) focusable element. |
|
|
40
|
+
| `Arrow left`, `Arrow right` | Scrolls the container. |
|
|
41
|
+
|
|
42
|
+
### ARIA enhancements
|
|
43
|
+
|
|
44
|
+
#### External **ARIA** provided by the `aria` property:
|
|
45
|
+
|
|
46
|
+
| ARIA | Usage |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `role="VALUE"` | Defines the semantic role of the scroll container (e.g. `list`, `tablist`). |
|
|
49
|
+
| `aria-label="STRING"` | Defines an accessible name when the scroll region purpose is not obvious. |
|
|
50
|
+
| `aria-description="STRING"` | Adds supplementary context for the scroll region. |
|
|
51
|
+
|
|
52
|
+
## Development considerations
|
|
53
|
+
|
|
54
|
+
### Common do's and don'ts
|
|
55
|
+
|
|
56
|
+
- **Do** provide an accessible name through the `aria` prop when the scroll region purpose is not obvious from context.
|
|
57
|
+
- **Do** pass `aria-label` and `aria-description` via the `aria` prop, not as host attributes.
|
|
58
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
59
|
+
|
|
60
|
+
## API
|
|
61
|
+
|
|
62
|
+
### Properties
|
|
63
|
+
|
|
64
|
+
| Property | Type | Default | Description |
|
|
65
|
+
| --- | --- | --- | --- |
|
|
66
|
+
| `alignScrollIndicator` _(deprecated)_ | `'top'` `'center'` | `'center'` | @deprecated since v4.0.0, will be removed with next major release, has no effect anymore. |
|
|
67
|
+
| `aria` | `ScrollerAriaAttribute` | `undefined` | Sets ARIA role and attributes on the scroller's scroll container, useful for tablist navigation patterns and additional accessibility context. |
|
|
68
|
+
| `compact` | `boolean` | `undefined` | Reduces the scroller's padding and the gap between slotted items for use in dense layouts. |
|
|
69
|
+
| `scrollbar` | `boolean` | `false` | Shows the browser's native scrollbar inside the scroller, in addition to the scroll indicator arrows. |
|
|
70
|
+
| `scrollToPosition` _(deprecated)_ | `ScrollerScrollToPosition` | `undefined` | @deprecated since v4.0.0, use native `scrollIntoView()` on the slotted element itself. |
|
|
71
|
+
| `sticky` _(experimental)_ | `boolean` | `false` | @experimental Makes the indicator sticky at the top or bottom while scrolling depending on the scroll direction. |
|
|
72
|
+
|
|
73
|
+
### Slots
|
|
74
|
+
|
|
75
|
+
| Slot | Required | Allowed tag names | Description |
|
|
76
|
+
| --- | --- | --- | --- |
|
|
77
|
+
| _(default)_ | no | — | Default slot for the scroller content. |
|
|
78
|
+
|
|
79
|
+
### CSS Variables
|
|
80
|
+
|
|
81
|
+
| CSS Variable | Default | Description |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `--p-scroller-gap` | `8px` | Defines the gap between slotted nodes. |
|
|
84
|
+
| `--p-scroller-indicator-top` | `0px` | Defines the distance from the top of the viewport at which the indicator sticks when scrolling down and `sticky` is enabled. |
|
|
85
|
+
| `--p-scroller-indicator-bottom` | `0px` | Defines the distance from the bottom of the viewport at which the indicator sticks when scrolling up and `sticky` is enabled. |
|
|
86
|
+
|
|
87
|
+
## Examples
|
|
88
|
+
|
|
89
|
+
| Example | When to use | File |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
92
|
+
| Height | The height of `p-scroller` depends on the height of its content. | [./examples/Height.ts](./examples/Height.ts) |
|
|
93
|
+
| Scroll to position | The `p-scroller` component provides the `scrollToPosition` property. | [./examples/ScrollToPosition.ts](./examples/ScrollToPosition.ts) |
|
|
@@ -0,0 +1,29 @@
|
|
|
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-segmented-control label="Some Label" description="Some description">
|
|
8
|
+
<p-segmented-control-item value="1">
|
|
9
|
+
Option 1
|
|
10
|
+
</p-segmented-control-item>
|
|
11
|
+
<p-segmented-control-item value="2">
|
|
12
|
+
Option 2
|
|
13
|
+
</p-segmented-control-item>
|
|
14
|
+
<p-segmented-control-item value="3">
|
|
15
|
+
Option 3
|
|
16
|
+
</p-segmented-control-item>
|
|
17
|
+
<p-segmented-control-item value="4">
|
|
18
|
+
Option 4
|
|
19
|
+
</p-segmented-control-item>
|
|
20
|
+
<p-segmented-control-item value="5">
|
|
21
|
+
Option 5
|
|
22
|
+
</p-segmented-control-item>
|
|
23
|
+
</p-segmented-control>
|
|
24
|
+
`,
|
|
25
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
28
|
+
})
|
|
29
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'porsche-design-system-app',
|
|
7
|
+
template: `
|
|
8
|
+
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="flex flex-col gap-fluid-sm">
|
|
9
|
+
<p-segmented-control formControlName="mySegmentedControl">
|
|
10
|
+
<p-segmented-control-item [value]="1">Option 1</p-segmented-control-item>
|
|
11
|
+
<p-segmented-control-item [value]="2">Option 2</p-segmented-control-item>
|
|
12
|
+
<p-segmented-control-item [value]="3">Option 3</p-segmented-control-item>
|
|
13
|
+
<p-segmented-control-item [value]="4">Option 4</p-segmented-control-item>
|
|
14
|
+
<p-segmented-control-item [value]="5">Option 5</p-segmented-control-item>
|
|
15
|
+
</p-segmented-control>
|
|
16
|
+
<div class="flex gap-fluid-sm">
|
|
17
|
+
<p-button type="submit">Submit</p-button>
|
|
18
|
+
<p-button type="reset">Reset</p-button>
|
|
19
|
+
</div>
|
|
20
|
+
<p-text>Last submitted data: {{ submittedValue }}</p-text>
|
|
21
|
+
</form>
|
|
22
|
+
`,
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
standalone: true,
|
|
25
|
+
imports: [PorscheDesignSystemModule, FormsModule, ReactiveFormsModule], // <-- PDS module is imported here
|
|
26
|
+
})
|
|
27
|
+
export class ExampleComponent {
|
|
28
|
+
form = new FormGroup({
|
|
29
|
+
mySegmentedControl: new FormControl<string | number | undefined>({ value: undefined, disabled: false }),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
submittedValue: any = undefined;
|
|
33
|
+
|
|
34
|
+
onSubmit(): void {
|
|
35
|
+
this.submittedValue = JSON.stringify(this.form.value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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-segmented-control state="error">
|
|
8
|
+
<span slot="label" id="some-label-id">
|
|
9
|
+
Some label with a
|
|
10
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
11
|
+
link
|
|
12
|
+
</a>
|
|
13
|
+
and a "label-after" slot.
|
|
14
|
+
</span>
|
|
15
|
+
<p-popover slot="label-after">
|
|
16
|
+
Some Popover content with a
|
|
17
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
18
|
+
link
|
|
19
|
+
</a>
|
|
20
|
+
.
|
|
21
|
+
</p-popover>
|
|
22
|
+
<span slot="description" id="some-description-id">
|
|
23
|
+
Some description with a
|
|
24
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
25
|
+
link
|
|
26
|
+
</a>
|
|
27
|
+
.
|
|
28
|
+
</span>
|
|
29
|
+
<span slot="message" id="some-message-id">
|
|
30
|
+
Some error message with a
|
|
31
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
32
|
+
link
|
|
33
|
+
</a>
|
|
34
|
+
.
|
|
35
|
+
</span>
|
|
36
|
+
<p-segmented-control-item value="1">
|
|
37
|
+
Option 1
|
|
38
|
+
</p-segmented-control-item>
|
|
39
|
+
<p-segmented-control-item value="2">
|
|
40
|
+
Option 2
|
|
41
|
+
</p-segmented-control-item>
|
|
42
|
+
<p-segmented-control-item value="3">
|
|
43
|
+
Option 3
|
|
44
|
+
</p-segmented-control-item>
|
|
45
|
+
<p-segmented-control-item value="4">
|
|
46
|
+
Option 4
|
|
47
|
+
</p-segmented-control-item>
|
|
48
|
+
<p-segmented-control-item value="5">
|
|
49
|
+
Option 5
|
|
50
|
+
</p-segmented-control-item>
|
|
51
|
+
</p-segmented-control>
|
|
52
|
+
`,
|
|
53
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
54
|
+
standalone: true,
|
|
55
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
56
|
+
})
|
|
57
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,29 @@
|
|
|
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-segmented-control value="1">
|
|
8
|
+
<p-segmented-control-item value="1" label="Label">
|
|
9
|
+
Option 1
|
|
10
|
+
</p-segmented-control-item>
|
|
11
|
+
<p-segmented-control-item value="2" label="Label">
|
|
12
|
+
Option 2
|
|
13
|
+
</p-segmented-control-item>
|
|
14
|
+
<p-segmented-control-item value="3" label="Label">
|
|
15
|
+
Option 3
|
|
16
|
+
</p-segmented-control-item>
|
|
17
|
+
<p-segmented-control-item value="4" label="Label" [disabled]="true">
|
|
18
|
+
Option 4
|
|
19
|
+
</p-segmented-control-item>
|
|
20
|
+
<p-segmented-control-item value="5" label="Label">
|
|
21
|
+
Option 5
|
|
22
|
+
</p-segmented-control-item>
|
|
23
|
+
</p-segmented-control>
|
|
24
|
+
`,
|
|
25
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
28
|
+
})
|
|
29
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# p-segmented-control
|
|
2
|
+
|
|
3
|
+
The `p-segmented-control` component is similar to the native `select` element while showing all available options right away.
|
|
4
|
+
|
|
5
|
+
It even behaves like a `select` where it can be controlled by setting the current value. However, it is not required and you could purely rely on the change event.
|
|
6
|
+
|
|
7
|
+
By default the `p-segmented-control` displays all options in **equal** size based on its largest option. If the `no-wrap` property is set to `true`, the items will be rendered inline (shrinked to their initial size) with an optional scroller.
|
|
8
|
+
|
|
9
|
+
Each option needs to be rendered by using a `p-segmented-control-item` child component where the `value` property is **mandatory** in order to emit a useful change event.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use to present a set of selectable options at once.
|
|
16
|
+
- Use it for selecting from 2-5 short, consistent options.
|
|
17
|
+
- Use them over other selection controls to reduce cognitive load.
|
|
18
|
+
- Pair options with icons to improve visual recognition.
|
|
19
|
+
- Use icons only when the context meaning is really clear.
|
|
20
|
+
- Use preselection when the result is visible by default.
|
|
21
|
+
- Use with no selection when a selection by the user is necessary to show the result.
|
|
22
|
+
- Use it with a short indication for the unit (such as km, €, %, or $) when possible.
|
|
23
|
+
- Use for horizontal and/or vertical display of options.
|
|
24
|
+
|
|
25
|
+
### Don't:
|
|
26
|
+
|
|
27
|
+
- Don't use it to filter or navigate content (use [Tabs](../p-tabs/p-tabs.md) instead).
|
|
28
|
+
- Don't use it for more than 5 options (use the [Select](../p-select/p-select.md) component).
|
|
29
|
+
- Don't use it with mixed values (use [Radio Group](../p-radio-group/p-radio-group.md) or [Select](../p-select/p-select.md) instead).
|
|
30
|
+
- Don't exceed maximum width so the values turn multiline.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Related components
|
|
35
|
+
|
|
36
|
+
- [Select](../p-select/p-select.md)
|
|
37
|
+
- [Radio Button](../p-radio-group/p-radio-group.md)
|
|
38
|
+
- [Tabs](../p-tabs/p-tabs.md)
|
|
39
|
+
|
|
40
|
+
## Accessibility support
|
|
41
|
+
|
|
42
|
+
### Keyboard
|
|
43
|
+
|
|
44
|
+
| Key / state | Function |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
47
|
+
| `Space`, `Enter` | Activates the control. |
|
|
48
|
+
|
|
49
|
+
### ARIA enhancements
|
|
50
|
+
|
|
51
|
+
#### External **ARIA** provided by the `aria` property:
|
|
52
|
+
|
|
53
|
+
| ARIA | Usage |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `aria-label="STRING"` | Defines a string value that labels the control item itself. |
|
|
56
|
+
|
|
57
|
+
#### Internal **ARIA** that is managed by the component:
|
|
58
|
+
|
|
59
|
+
| ARIA | Usage |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| `role="group"` | Identifies a set of user interface objects. |
|
|
62
|
+
| `aria-pressed="BOOLEAN"` | Provides the current state of the control. |
|
|
63
|
+
| `role="status"`, `role="alert"` | When `message` and `state` or `loading` prop change, the status message is announced. |
|
|
64
|
+
| `aria-hidden="true"` | If `required` attribute is set, the visible asterisk indicator is hidden from assistive technologies. |
|
|
65
|
+
| `aria-invalid="true"` | If `error` state is set. |
|
|
66
|
+
| `aria-required="true"` | Indicates if the element is required. |
|
|
67
|
+
| `aria-description="STRING"` | Provides additional content for states. |
|
|
68
|
+
|
|
69
|
+
## Development considerations
|
|
70
|
+
|
|
71
|
+
### Labelling
|
|
72
|
+
|
|
73
|
+
Provide a descriptive `label` on the wrapper component to give context for the group of options. If a more detailed label is needed for each **control item**, use the `aria` property on the control item itself, e.g.: `<p-segmented-control-item value="xs" aria="{ 'aria-label': 'Size x-small' }">XS</p-segmented-control-item>`.
|
|
74
|
+
|
|
75
|
+
If an **icon only** is used, it is mandatory to also provide an accessible name through the `aria` property of the control item.
|
|
76
|
+
|
|
77
|
+
### Disabled state
|
|
78
|
+
|
|
79
|
+
In general, avoid using the `disabled` state. Disabled elements are no longer focusable and may be missed by screen reader users. They can also confuse sighted users if the reason they are disabled is not made clear.
|
|
80
|
+
|
|
81
|
+
### Common do's and don'ts
|
|
82
|
+
|
|
83
|
+
- **Do** provide a clear group `label` that describes the choice being made.
|
|
84
|
+
- **Do** pass item-level ARIA through the `aria` prop on `p-segmented-control-item`, especially for icon-only items.
|
|
85
|
+
- **Do** use the component state/message API so validation and status changes are announced.
|
|
86
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
87
|
+
- **Don't** use `hide-label` without an accessible name.
|
|
88
|
+
|
|
89
|
+
## API
|
|
90
|
+
|
|
91
|
+
### Properties
|
|
92
|
+
|
|
93
|
+
| Property | Type | Default | Description |
|
|
94
|
+
| --- | --- | --- | --- |
|
|
95
|
+
| `columns` | `'auto'` `1` `2` `3` `4` `5` `6` `7` `8` `9` `10` `11` `12` `13` `14` `15` `16` `17` `18` `19` `20` `21` `22` `23` `24` `25`<br>`BreakpointCustomizable<SegmentedControlColumns>` | `'auto'` | Sets the number of equal-width columns for the item layout. Use `auto` to distribute items based on their content width. Supports responsive breakpoint values. |
|
|
96
|
+
| `compact` | `boolean` | `false` | Reduces the item height and spacing for use in dense layouts where vertical space is limited. |
|
|
97
|
+
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to give users additional context about the segmented control. |
|
|
98
|
+
| `disabled` | `boolean` | `false` | Prevents user interaction with all items in the segmented control and excludes the value from form submissions. |
|
|
99
|
+
| `form` | `string` | `undefined` | Associates the segmented control with a form element by its ID when it is not a direct descendant of that form. |
|
|
100
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
101
|
+
| `label` | `string` | `''` | Sets the visible label text displayed above the segmented control to describe the group of options. |
|
|
102
|
+
| `message` | `string` | `''` | Sets the validation feedback message displayed below the segmented control when `state` is `success` or `error`. |
|
|
103
|
+
| `name` | `string` | `undefined` | Sets the name of the control submitted with the form data to identify the selected value on the server. |
|
|
104
|
+
| `noWrap` | `boolean` | `false` | Prevents items from wrapping to new rows and renders them in a single horizontally scrollable row instead. |
|
|
105
|
+
| `required` | `boolean` | `false` | Marks the segmented control as required so the form cannot be submitted until one option is selected. |
|
|
106
|
+
| `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state of the segmented control, controlling its visual appearance and feedback message style (`none`, `success`, `error`). |
|
|
107
|
+
| `value` | `string | number` | `undefined` | Sets the currently selected item's value and pre-selects the matching option when the component renders. |
|
|
108
|
+
|
|
109
|
+
### Events
|
|
110
|
+
|
|
111
|
+
| Event | Type | Description |
|
|
112
|
+
| --- | --- | --- |
|
|
113
|
+
| `blur` | `CustomEvent<void>` | Emitted when the segmented control loses focus, useful for triggering validation on blur. |
|
|
114
|
+
| `change` | `CustomEvent<SegmentedControlChangeEventDetail>`<br>`{ value: string | number }` | Emitted when the user selects a different item, carrying the new value in the event detail. |
|
|
115
|
+
|
|
116
|
+
### Controlled properties
|
|
117
|
+
|
|
118
|
+
- `value` — a controlled prop, but the component also updates it internally. Listen for the `change` event to observe changes; you do not have to write the value back.
|
|
119
|
+
|
|
120
|
+
### Slots
|
|
121
|
+
|
|
122
|
+
| Slot | Required | Allowed tag names | Description |
|
|
123
|
+
| --- | --- | --- | --- |
|
|
124
|
+
| `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
125
|
+
| `label-after` | no | — | Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`). |
|
|
126
|
+
| `description` | no | — | Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
127
|
+
| _(default)_ | no | — | Default slot for the `p-segmented-control-item` tags. |
|
|
128
|
+
| `message` | no | — | Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
129
|
+
|
|
130
|
+
## Sub-components
|
|
131
|
+
|
|
132
|
+
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.
|
|
133
|
+
|
|
134
|
+
### `p-segmented-control-item`
|
|
135
|
+
|
|
136
|
+
Allowed parent: `p-segmented-control`.
|
|
137
|
+
|
|
138
|
+
#### Properties
|
|
139
|
+
|
|
140
|
+
| Property | Type | Default | Description |
|
|
141
|
+
| --- | --- | --- | --- |
|
|
142
|
+
| `aria` | `SegmentedControlItemAriaAttribute` | `undefined` | Sets ARIA attributes on the item's button element to improve accessibility for screen readers. |
|
|
143
|
+
| `disabled` | `boolean` | `false` | Prevents this item from being selected and visually dims it; the parent's value will not change to this item's value. |
|
|
144
|
+
| `icon` | `''`<br>one of 290 icon names — see [icon names](references/icons.md) | `undefined` | Sets an icon rendered inside the item button using an icon name from the PDS icon library. |
|
|
145
|
+
| `iconSource` | `string` | `undefined` | Sets a URL to a custom SVG icon for the item button, overriding the built-in icon set. |
|
|
146
|
+
| `label` | `string` | `undefined` | Sets a visible text label rendered inside the item button, used when no slotted content is provided. |
|
|
147
|
+
| `value` _(required)_ | `string | number` | `undefined` | Sets the value emitted by the parent `p-segmented-control` when this item is selected. This property is*required**. |
|
|
148
|
+
|
|
149
|
+
#### Slots
|
|
150
|
+
|
|
151
|
+
| Slot | Required | Allowed tag names | Description |
|
|
152
|
+
| --- | --- | --- | --- |
|
|
153
|
+
| _(default)_ | no | — | Default slot for the content. |
|
|
154
|
+
|
|
155
|
+
## Examples
|
|
156
|
+
|
|
157
|
+
| Example | When to use | File |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
160
|
+
| Form | The `p-segmented-control` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.ts](./examples/Form.ts) |
|
|
161
|
+
| With Labels | Additional meta information can be displayed by setting a `label` on each child. | [./examples/WithLabels.ts](./examples/WithLabels.ts) |
|
|
162
|
+
| Slots | Use named slots when `label`, `description` or `message` need markup such as a link. | [./examples/Slots.ts](./examples/Slots.ts) |
|