@porsche-design-system/components-react 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.
Files changed (289) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/pds-skill.js +259 -0
  3. package/esm/lib/components/button.wrapper.d.ts +2 -2
  4. package/esm/lib/components/link.wrapper.d.ts +2 -2
  5. package/package.json +4 -3
  6. package/skill/SKILL.md +136 -0
  7. package/skill/references/components/p-accordion/examples/Default.tsx +24 -0
  8. package/skill/references/components/p-accordion/examples/InteractiveElementsInSummary.tsx +28 -0
  9. package/skill/references/components/p-accordion/examples/StickySummary.tsx +24 -0
  10. package/skill/references/components/p-accordion/p-accordion.md +95 -0
  11. package/skill/references/components/p-ai-tag/examples/Default.tsx +10 -0
  12. package/skill/references/components/p-ai-tag/examples/WithinCheckbox.tsx +30 -0
  13. package/skill/references/components/p-ai-tag/examples/WithinFormLabel.tsx +37 -0
  14. package/skill/references/components/p-ai-tag/examples/WithinImage.tsx +13 -0
  15. package/skill/references/components/p-ai-tag/examples/WithinInputSearch.tsx +12 -0
  16. package/skill/references/components/p-ai-tag/examples/WithinRadioGroup.tsx +29 -0
  17. package/skill/references/components/p-ai-tag/examples/WithinTable.tsx +91 -0
  18. package/skill/references/components/p-ai-tag/examples/WithinText.tsx +14 -0
  19. package/skill/references/components/p-ai-tag/p-ai-tag.md +47 -0
  20. package/skill/references/components/p-banner/examples/Customization.tsx +35 -0
  21. package/skill/references/components/p-banner/examples/Default.tsx +24 -0
  22. package/skill/references/components/p-banner/p-banner.md +92 -0
  23. package/skill/references/components/p-button/examples/Default.tsx +12 -0
  24. package/skill/references/components/p-button/examples/Form.tsx +28 -0
  25. package/skill/references/components/p-button/examples/FormAttribute.tsx +31 -0
  26. package/skill/references/components/p-button/p-button.md +118 -0
  27. package/skill/references/components/p-button-pure/examples/CustomClickableArea.tsx +12 -0
  28. package/skill/references/components/p-button-pure/examples/Default.tsx +12 -0
  29. package/skill/references/components/p-button-pure/examples/Form.tsx +28 -0
  30. package/skill/references/components/p-button-pure/examples/FormAttribute.tsx +32 -0
  31. package/skill/references/components/p-button-pure/p-button-pure.md +118 -0
  32. package/skill/references/components/p-button-tile/examples/ColorScheme.tsx +15 -0
  33. package/skill/references/components/p-button-tile/examples/Default.tsx +18 -0
  34. package/skill/references/components/p-button-tile/examples/FooterSlot.tsx +29 -0
  35. package/skill/references/components/p-button-tile/examples/Hyphens.tsx +33 -0
  36. package/skill/references/components/p-button-tile/examples/UiBehaviour.tsx +41 -0
  37. package/skill/references/components/p-button-tile/p-button-tile.md +115 -0
  38. package/skill/references/components/p-canvas/examples/Default.tsx +10 -0
  39. package/skill/references/components/p-canvas/p-canvas.md +91 -0
  40. package/skill/references/components/p-carousel/examples/Default.tsx +23 -0
  41. package/skill/references/components/p-carousel/examples/DynamicSlides.tsx +32 -0
  42. package/skill/references/components/p-carousel/examples/FlexibleWidths.tsx +29 -0
  43. package/skill/references/components/p-carousel/examples/FocusOnCenterSlide.tsx +56 -0
  44. package/skill/references/components/p-carousel/examples/Intl.tsx +20 -0
  45. package/skill/references/components/p-carousel/examples/JumpToSlide.tsx +42 -0
  46. package/skill/references/components/p-carousel/p-carousel.md +142 -0
  47. package/skill/references/components/p-checkbox/examples/Default.tsx +10 -0
  48. package/skill/references/components/p-checkbox/examples/Form.tsx +45 -0
  49. package/skill/references/components/p-checkbox/examples/Indeterminate.tsx +13 -0
  50. package/skill/references/components/p-checkbox/examples/Slots.tsx +54 -0
  51. package/skill/references/components/p-checkbox/examples/WrappedLabel.tsx +24 -0
  52. package/skill/references/components/p-checkbox/p-checkbox.md +122 -0
  53. package/skill/references/components/p-crest/examples/CustomClickableArea.tsx +10 -0
  54. package/skill/references/components/p-crest/examples/Default.tsx +10 -0
  55. package/skill/references/components/p-crest/examples/Link.tsx +10 -0
  56. package/skill/references/components/p-crest/p-crest.md +65 -0
  57. package/skill/references/components/p-display/examples/Color.tsx +12 -0
  58. package/skill/references/components/p-display/examples/Default.tsx +12 -0
  59. package/skill/references/components/p-display/examples/Semantics.tsx +18 -0
  60. package/skill/references/components/p-display/examples/Size.tsx +12 -0
  61. package/skill/references/components/p-display/examples/SizeResponsive.tsx +12 -0
  62. package/skill/references/components/p-display/p-display.md +78 -0
  63. package/skill/references/components/p-divider/examples/Default.tsx +10 -0
  64. package/skill/references/components/p-divider/examples/Responsive.tsx +12 -0
  65. package/skill/references/components/p-divider/examples/Vertical.tsx +12 -0
  66. package/skill/references/components/p-divider/p-divider.md +49 -0
  67. package/skill/references/components/p-drilldown/examples/CustomContent.tsx +164 -0
  68. package/skill/references/components/p-drilldown/examples/Default.tsx +117 -0
  69. package/skill/references/components/p-drilldown/p-drilldown.md +168 -0
  70. package/skill/references/components/p-fieldset/examples/Default.tsx +12 -0
  71. package/skill/references/components/p-fieldset/examples/Required.tsx +13 -0
  72. package/skill/references/components/p-fieldset/examples/SlottedLabel.tsx +15 -0
  73. package/skill/references/components/p-fieldset/examples/SlottedMessage.tsx +15 -0
  74. package/skill/references/components/p-fieldset/p-fieldset.md +88 -0
  75. package/skill/references/components/p-flag/examples/Default.tsx +10 -0
  76. package/skill/references/components/p-flag/examples/ResponsiveSize.tsx +10 -0
  77. package/skill/references/components/p-flag/examples/Size.tsx +13 -0
  78. package/skill/references/components/p-flag/examples/SizeCssVar.tsx +10 -0
  79. package/skill/references/components/p-flag/p-flag.md +68 -0
  80. package/skill/references/components/p-flyout/examples/CustomStyling.tsx +45 -0
  81. package/skill/references/components/p-flyout/examples/Default.tsx +42 -0
  82. package/skill/references/components/p-flyout/examples/Form.tsx +54 -0
  83. package/skill/references/components/p-flyout/examples/StickyTop.tsx +42 -0
  84. package/skill/references/components/p-flyout/p-flyout.md +128 -0
  85. package/skill/references/components/p-heading/examples/Color.tsx +12 -0
  86. package/skill/references/components/p-heading/examples/Default.tsx +12 -0
  87. package/skill/references/components/p-heading/examples/Semantics.tsx +18 -0
  88. package/skill/references/components/p-heading/p-heading.md +78 -0
  89. package/skill/references/components/p-icon/examples/Color.tsx +13 -0
  90. package/skill/references/components/p-icon/examples/ColorCssVar.tsx +10 -0
  91. package/skill/references/components/p-icon/examples/Custom.tsx +10 -0
  92. package/skill/references/components/p-icon/examples/Default.tsx +10 -0
  93. package/skill/references/components/p-icon/examples/Overview.tsx +588 -0
  94. package/skill/references/components/p-icon/examples/ResponsiveSize.tsx +10 -0
  95. package/skill/references/components/p-icon/examples/Size.tsx +13 -0
  96. package/skill/references/components/p-icon/examples/SizeCssVar.tsx +10 -0
  97. package/skill/references/components/p-icon/p-icon.md +88 -0
  98. package/skill/references/components/p-inline-notification/examples/ActionButton.tsx +25 -0
  99. package/skill/references/components/p-inline-notification/examples/Default.tsx +10 -0
  100. package/skill/references/components/p-inline-notification/examples/EventHandling.tsx +25 -0
  101. package/skill/references/components/p-inline-notification/p-inline-notification.md +74 -0
  102. package/skill/references/components/p-input-date/examples/Default.tsx +10 -0
  103. package/skill/references/components/p-input-date/examples/Form.tsx +45 -0
  104. package/skill/references/components/p-input-date/examples/Slots.tsx +41 -0
  105. package/skill/references/components/p-input-date/p-input-date.md +142 -0
  106. package/skill/references/components/p-input-email/examples/Default.tsx +10 -0
  107. package/skill/references/components/p-input-email/examples/Form.tsx +51 -0
  108. package/skill/references/components/p-input-email/examples/Slots.tsx +41 -0
  109. package/skill/references/components/p-input-email/p-input-email.md +146 -0
  110. package/skill/references/components/p-input-month/examples/Default.tsx +10 -0
  111. package/skill/references/components/p-input-month/examples/Form.tsx +45 -0
  112. package/skill/references/components/p-input-month/examples/Slots.tsx +41 -0
  113. package/skill/references/components/p-input-month/p-input-month.md +142 -0
  114. package/skill/references/components/p-input-number/examples/Default.tsx +10 -0
  115. package/skill/references/components/p-input-number/examples/Form.tsx +51 -0
  116. package/skill/references/components/p-input-number/examples/Slots.tsx +41 -0
  117. package/skill/references/components/p-input-number/p-input-number.md +150 -0
  118. package/skill/references/components/p-input-password/examples/Default.tsx +10 -0
  119. package/skill/references/components/p-input-password/examples/Form.tsx +51 -0
  120. package/skill/references/components/p-input-password/examples/Slots.tsx +39 -0
  121. package/skill/references/components/p-input-password/examples/Toggle.tsx +10 -0
  122. package/skill/references/components/p-input-password/p-input-password.md +145 -0
  123. package/skill/references/components/p-input-search/examples/AriaCombobox.tsx +35 -0
  124. package/skill/references/components/p-input-search/examples/Default.tsx +10 -0
  125. package/skill/references/components/p-input-search/examples/Form.tsx +52 -0
  126. package/skill/references/components/p-input-search/examples/Slots.tsx +41 -0
  127. package/skill/references/components/p-input-search/p-input-search.md +182 -0
  128. package/skill/references/components/p-input-tel/examples/Default.tsx +10 -0
  129. package/skill/references/components/p-input-tel/examples/Form.tsx +45 -0
  130. package/skill/references/components/p-input-tel/examples/Slots.tsx +41 -0
  131. package/skill/references/components/p-input-tel/p-input-tel.md +145 -0
  132. package/skill/references/components/p-input-text/examples/Controlled.tsx +36 -0
  133. package/skill/references/components/p-input-text/examples/Default.tsx +10 -0
  134. package/skill/references/components/p-input-text/examples/Form.tsx +45 -0
  135. package/skill/references/components/p-input-text/examples/Slots.tsx +41 -0
  136. package/skill/references/components/p-input-text/p-input-text.md +150 -0
  137. package/skill/references/components/p-input-time/examples/Default.tsx +10 -0
  138. package/skill/references/components/p-input-time/examples/Form.tsx +45 -0
  139. package/skill/references/components/p-input-time/examples/Slots.tsx +41 -0
  140. package/skill/references/components/p-input-time/p-input-time.md +144 -0
  141. package/skill/references/components/p-input-url/examples/Default.tsx +10 -0
  142. package/skill/references/components/p-input-url/examples/Form.tsx +45 -0
  143. package/skill/references/components/p-input-url/examples/Slots.tsx +41 -0
  144. package/skill/references/components/p-input-url/p-input-url.md +145 -0
  145. package/skill/references/components/p-input-week/examples/Default.tsx +10 -0
  146. package/skill/references/components/p-input-week/examples/Form.tsx +45 -0
  147. package/skill/references/components/p-input-week/examples/Slots.tsx +41 -0
  148. package/skill/references/components/p-input-week/p-input-week.md +142 -0
  149. package/skill/references/components/p-link/examples/Default.tsx +12 -0
  150. package/skill/references/components/p-link/examples/FrameworkRouting.tsx +14 -0
  151. package/skill/references/components/p-link/examples/Icon.tsx +17 -0
  152. package/skill/references/components/p-link/p-link.md +101 -0
  153. package/skill/references/components/p-link-pure/examples/CustomClickableArea.tsx +12 -0
  154. package/skill/references/components/p-link-pure/examples/Default.tsx +12 -0
  155. package/skill/references/components/p-link-pure/examples/FrameworkRouting.tsx +14 -0
  156. package/skill/references/components/p-link-pure/examples/Icon.tsx +17 -0
  157. package/skill/references/components/p-link-pure/p-link-pure.md +110 -0
  158. package/skill/references/components/p-link-tile/examples/ColorScheme.tsx +15 -0
  159. package/skill/references/components/p-link-tile/examples/Default.tsx +18 -0
  160. package/skill/references/components/p-link-tile/examples/FooterSlot.tsx +29 -0
  161. package/skill/references/components/p-link-tile/examples/Hyphens.tsx +34 -0
  162. package/skill/references/components/p-link-tile/examples/UiBehaviour.tsx +41 -0
  163. package/skill/references/components/p-link-tile/examples/WithVideo.tsx +15 -0
  164. package/skill/references/components/p-link-tile/p-link-tile.md +105 -0
  165. package/skill/references/components/p-link-tile-product/examples/Default.tsx +22 -0
  166. package/skill/references/components/p-link-tile-product/examples/FrameworkRouting.tsx +25 -0
  167. package/skill/references/components/p-link-tile-product/p-link-tile-product.md +93 -0
  168. package/skill/references/components/p-modal/examples/AlertDialog.tsx +39 -0
  169. package/skill/references/components/p-modal/examples/CustomStyling.tsx +26 -0
  170. package/skill/references/components/p-modal/examples/Default.tsx +39 -0
  171. package/skill/references/components/p-modal/examples/Scrollable.tsx +43 -0
  172. package/skill/references/components/p-modal/p-modal.md +135 -0
  173. package/skill/references/components/p-model-signature/examples/CustomStyling.tsx +14 -0
  174. package/skill/references/components/p-model-signature/examples/Default.tsx +10 -0
  175. package/skill/references/components/p-model-signature/examples/MaskBlendMode.tsx +32 -0
  176. package/skill/references/components/p-model-signature/examples/MaskImage.tsx +12 -0
  177. package/skill/references/components/p-model-signature/examples/MaskVideo.tsx +12 -0
  178. package/skill/references/components/p-model-signature/examples/SafeZone.tsx +60 -0
  179. package/skill/references/components/p-model-signature/p-model-signature.md +62 -0
  180. package/skill/references/components/p-multi-select/examples/AsyncFilter.tsx +136 -0
  181. package/skill/references/components/p-multi-select/examples/Default.tsx +29 -0
  182. package/skill/references/components/p-multi-select/examples/Form.tsx +53 -0
  183. package/skill/references/components/p-multi-select/examples/Optgroups.tsx +42 -0
  184. package/skill/references/components/p-multi-select/examples/SelectedSlot.tsx +94 -0
  185. package/skill/references/components/p-multi-select/examples/SetValue.tsx +80 -0
  186. package/skill/references/components/p-multi-select/examples/Slots.tsx +48 -0
  187. package/skill/references/components/p-multi-select/p-multi-select.md +197 -0
  188. package/skill/references/components/p-pagination/examples/Default.tsx +10 -0
  189. package/skill/references/components/p-pagination/p-pagination.md +83 -0
  190. package/skill/references/components/p-pin-code/examples/CopyPaste.tsx +10 -0
  191. package/skill/references/components/p-pin-code/examples/Default.tsx +10 -0
  192. package/skill/references/components/p-pin-code/examples/Form.tsx +45 -0
  193. package/skill/references/components/p-pin-code/examples/Slots.tsx +39 -0
  194. package/skill/references/components/p-pin-code/p-pin-code.md +109 -0
  195. package/skill/references/components/p-popover/examples/Default.tsx +14 -0
  196. package/skill/references/components/p-popover/examples/SlottedButton.tsx +15 -0
  197. package/skill/references/components/p-popover/p-popover.md +116 -0
  198. package/skill/references/components/p-radio-group/examples/Default.tsx +17 -0
  199. package/skill/references/components/p-radio-group/examples/Form.tsx +53 -0
  200. package/skill/references/components/p-radio-group/examples/Slots.tsx +69 -0
  201. package/skill/references/components/p-radio-group/p-radio-group.md +157 -0
  202. package/skill/references/components/p-scroller/examples/Default.tsx +51 -0
  203. package/skill/references/components/p-scroller/examples/Height.tsx +26 -0
  204. package/skill/references/components/p-scroller/examples/ScrollToPosition.tsx +58 -0
  205. package/skill/references/components/p-scroller/p-scroller.md +93 -0
  206. package/skill/references/components/p-segmented-control/examples/Default.tsx +26 -0
  207. package/skill/references/components/p-segmented-control/examples/Form.tsx +52 -0
  208. package/skill/references/components/p-segmented-control/examples/Slots.tsx +54 -0
  209. package/skill/references/components/p-segmented-control/examples/WithLabels.tsx +26 -0
  210. package/skill/references/components/p-segmented-control/p-segmented-control.md +162 -0
  211. package/skill/references/components/p-select/examples/AsyncFilter.tsx +136 -0
  212. package/skill/references/components/p-select/examples/Default.tsx +29 -0
  213. package/skill/references/components/p-select/examples/Form.tsx +53 -0
  214. package/skill/references/components/p-select/examples/Optgroups.tsx +42 -0
  215. package/skill/references/components/p-select/examples/Required.tsx +48 -0
  216. package/skill/references/components/p-select/examples/SelectedSlot.tsx +124 -0
  217. package/skill/references/components/p-select/examples/SetValue.tsx +80 -0
  218. package/skill/references/components/p-select/examples/Slots.tsx +48 -0
  219. package/skill/references/components/p-select/examples/SlottedImages.tsx +35 -0
  220. package/skill/references/components/p-select/p-select.md +194 -0
  221. package/skill/references/components/p-sheet/examples/Default.tsx +31 -0
  222. package/skill/references/components/p-sheet/p-sheet.md +121 -0
  223. package/skill/references/components/p-spinner/examples/Color.tsx +13 -0
  224. package/skill/references/components/p-spinner/examples/ColorCssVar.tsx +10 -0
  225. package/skill/references/components/p-spinner/examples/Default.tsx +10 -0
  226. package/skill/references/components/p-spinner/examples/ResponsiveSize.tsx +10 -0
  227. package/skill/references/components/p-spinner/examples/Size.tsx +13 -0
  228. package/skill/references/components/p-spinner/examples/SizeCssVar.tsx +10 -0
  229. package/skill/references/components/p-spinner/p-spinner.md +96 -0
  230. package/skill/references/components/p-stepper-horizontal/examples/Default.tsx +23 -0
  231. package/skill/references/components/p-stepper-horizontal/examples/FrameworkImplementation.tsx +100 -0
  232. package/skill/references/components/p-stepper-horizontal/p-stepper-horizontal.md +109 -0
  233. package/skill/references/components/p-switch/examples/Default.tsx +19 -0
  234. package/skill/references/components/p-switch/p-switch.md +103 -0
  235. package/skill/references/components/p-table/examples/Advanced.tsx +186 -0
  236. package/skill/references/components/p-table/examples/CaptionProperty.tsx +37 -0
  237. package/skill/references/components/p-table/examples/CaptionSlot.tsx +40 -0
  238. package/skill/references/components/p-table/examples/Default.tsx +117 -0
  239. package/skill/references/components/p-table/examples/HideLabel.tsx +37 -0
  240. package/skill/references/components/p-table/examples/LayoutFixed.tsx +50 -0
  241. package/skill/references/components/p-table/examples/Sorting.tsx +86 -0
  242. package/skill/references/components/p-table/p-table.md +189 -0
  243. package/skill/references/components/p-tabs/examples/ActiveTab.tsx +26 -0
  244. package/skill/references/components/p-tabs/examples/Default.tsx +26 -0
  245. package/skill/references/components/p-tabs/examples/Gradient.tsx +111 -0
  246. package/skill/references/components/p-tabs/examples/Labelling.tsx +26 -0
  247. package/skill/references/components/p-tabs/p-tabs.md +136 -0
  248. package/skill/references/components/p-tabs-bar/examples/Default.tsx +27 -0
  249. package/skill/references/components/p-tabs-bar/examples/Gradient.tsx +78 -0
  250. package/skill/references/components/p-tabs-bar/examples/Labelling.tsx +27 -0
  251. package/skill/references/components/p-tabs-bar/examples/Links.tsx +20 -0
  252. package/skill/references/components/p-tabs-bar/p-tabs-bar.md +181 -0
  253. package/skill/references/components/p-tag/examples/Default.tsx +12 -0
  254. package/skill/references/components/p-tag/examples/Multiline.tsx +14 -0
  255. package/skill/references/components/p-tag/examples/SlottedButton.tsx +41 -0
  256. package/skill/references/components/p-tag/examples/SlottedLink.tsx +41 -0
  257. package/skill/references/components/p-tag/p-tag.md +66 -0
  258. package/skill/references/components/p-tag-dismissible/examples/Default.tsx +12 -0
  259. package/skill/references/components/p-tag-dismissible/p-tag-dismissible.md +75 -0
  260. package/skill/references/components/p-text/examples/Default.tsx +12 -0
  261. package/skill/references/components/p-text/examples/Semantics.tsx +18 -0
  262. package/skill/references/components/p-text/examples/Size.tsx +12 -0
  263. package/skill/references/components/p-text/examples/SizeResponsive.tsx +12 -0
  264. package/skill/references/components/p-text/p-text.md +68 -0
  265. package/skill/references/components/p-text-list/examples/Default.tsx +28 -0
  266. package/skill/references/components/p-text-list/p-text-list.md +68 -0
  267. package/skill/references/components/p-textarea/examples/Default.tsx +10 -0
  268. package/skill/references/components/p-textarea/examples/Form.tsx +45 -0
  269. package/skill/references/components/p-textarea/examples/Slots.tsx +39 -0
  270. package/skill/references/components/p-textarea/p-textarea.md +122 -0
  271. package/skill/references/components/p-toast/examples/Default.tsx +22 -0
  272. package/skill/references/components/p-toast/p-toast.md +61 -0
  273. package/skill/references/components/p-wordmark/examples/CustomClickableArea.tsx +10 -0
  274. package/skill/references/components/p-wordmark/examples/Default.tsx +10 -0
  275. package/skill/references/components/p-wordmark/examples/Size.tsx +10 -0
  276. package/skill/references/components/p-wordmark/p-wordmark.md +66 -0
  277. package/skill/references/icons.md +5 -0
  278. package/skill/references/styles/emotion.md +439 -0
  279. package/skill/references/styles/scss.md +402 -0
  280. package/skill/references/styles/tailwindcss.md +356 -0
  281. package/skill/references/styles/vanilla-extract.md +444 -0
  282. package/skill/references/stylesheets.md +331 -0
  283. package/skill/references/tokens.md +323 -0
  284. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +1 -1
  285. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +1 -1
  286. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +1 -1
  287. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -1
  288. package/ssr/esm/lib/components/button.wrapper.d.ts +2 -2
  289. package/ssr/esm/lib/components/link.wrapper.d.ts +2 -2
@@ -0,0 +1,116 @@
1
+ # p-popover
2
+
3
+ The `p-popover` component displays additional contextual content in an overlay and should be used when users need optional details without leaving their current context. It is triggered by a button and renders its own info button by default, or you can provide a custom trigger via the `button` slot.
4
+
5
+ By default, the Popover works **uncontrolled**: it manages its own visibility and toggles open or closed when its info button (or a slotted trigger) is clicked. It is dismissed on outside click, on `Escape`, or when keyboard focus leaves the Popover.
6
+
7
+ Alternatively, the Popover can be used in a **controlled** mode by setting the `open` prop together with a slotted `button` (the default info button does not toggle in this mode). In this mode you own the open state: the Popover only emits the `dismiss` event when the user requests to close it (via `Escape`, an outside click or when keyboard focus leaves the Popover), and you decide whether to update `open` in response.
8
+
9
+ **Hint:** The `p-popover` utilizes the [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) and gets rendered on the `#top-layer` which enables it to be shown correctly even when used e.g. within a scroll container.
10
+
11
+ ## Usage
12
+
13
+ ### Do:
14
+
15
+ - Use it to display additional information that is not necessary for task completion or to provide further explanation about a workflow.
16
+ - Position popovers in a way that they do not block related content.
17
+ - Choose a preferred direction in which the popover should open, or it will automatically open in the direction with the most available space.
18
+ - Use it consistently throughout your site.
19
+
20
+ ### Don't:
21
+
22
+ - Don't use for content that can be displayed directly.
23
+
24
+ ---
25
+
26
+ ## References
27
+
28
+ Nielsen Norman Group [Tooltip Guidelines](https://nngroup.com/articles/tooltip-guidelines)
29
+
30
+ ## Accessibility support
31
+
32
+ ### Keyboard
33
+
34
+ | Key / state | Function |
35
+ | --- | --- |
36
+ | `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
37
+ | `Enter`, `Space` | - Opens/closes the popover. |
38
+
39
+ ### ARIA enhancements
40
+
41
+ #### External **ARIA** provided by the `aria` property:
42
+
43
+ | ARIA | Usage |
44
+ | --- | --- |
45
+ | `aria-label` | Defines a string value that labels the interactive element. |
46
+
47
+ #### Internal **ARIA** that is managed by the component:
48
+
49
+ | ARIA | Usage |
50
+ | --- | --- |
51
+ | `aria-expanded="BOOLEAN"` | Indicates that the popover element is displayed/hidden. |
52
+ | `aria-details="IDREF"` | References the element that provides additional information about the popover. |
53
+
54
+ ## Development considerations
55
+
56
+ In **uncontrolled** mode the `p-popover` component does not manage `aria-expanded` on a custom slotted button, because it does not expose its internal `open` state publicly. In this case the default info button (which the component fully controls) already exposes `aria-expanded` for you.
57
+
58
+ In **controlled** mode the consumer owns the `open` state, so the slotted trigger *can* (and should) expose `aria-expanded` to match the default button's semantics. Bind it to your `open` state via the trigger's `aria` property, e.g. `aria={{ 'aria-expanded': open ? 'true' : 'false' }}`, so it stays in sync as the popover opens and closes.
59
+
60
+ ### Common do's and don'ts
61
+
62
+ - **Do** prefer the built-in popover trigger when possible so `aria-expanded` is managed internally.
63
+ - **Do** provide an accessible name on a custom slotted button when you cannot use the default trigger.
64
+ - **Do** pass additional ARIA via the `aria` prop when the default labeling is not sufficient.
65
+ - **Don't** use an unnamed custom slotted trigger button.
66
+ - **Don't** add native `aria-*` attributes directly on the component host.
67
+
68
+ ## API
69
+
70
+ ### Properties
71
+
72
+ | Property | Type | Default | Description |
73
+ | --- | --- | --- | --- |
74
+ | `aria` | `PopoverAriaAttribute` | `undefined` | Sets ARIA attributes on the popover panel to improve accessibility for screen readers. |
75
+ | `compact` | `boolean` | `undefined` | Reduces padding and spacing for a more compact layout, useful in space-constrained interfaces. |
76
+ | `description` | `string` | `undefined` | Sets the text content displayed inside the popover panel when it is open, providing contextual help or information. Takes precedence over the default slot when both are provided. |
77
+ | `direction` | `'top'` `'right'` `'bottom'` `'left'` | `'bottom'` | Sets the preferred direction for the popover to open relative to its trigger button. Falls back to the direction with the most available viewport space. |
78
+ | `open` | `boolean` | `undefined` | Controls whether the popover is visible. When set (controlled mode), visibility follows this prop and the consumer owns the open state via a slotted `button`. When omitted (uncontrolled mode), the component manages visibility itself. |
79
+
80
+ ### Events
81
+
82
+ | Event | Type | Description |
83
+ | --- | --- | --- |
84
+ | `dismiss` | `CustomEvent<void>` | Emitted in controlled mode when the user requests to close the popover via the Escape key, an outside click, or when keyboard focus leaves the popover (Tab / Shift+Tab). |
85
+
86
+ ### Controlled properties
87
+
88
+ - `open` — a controlled prop: the component does **not** update it itself. Handle the `dismiss` event and assign the new value to `open` yourself, or the change will not take effect.
89
+
90
+ ### Slots
91
+
92
+ | Slot | Required | Allowed tag names | Description |
93
+ | --- | --- | --- | --- |
94
+ | _(default)_ | no | — | Default slot for the popover content. Ignored when the `description` prop is set, which takes precedence. |
95
+ | `button` | no | — | Renders a custom trigger button. When used, the default info button is replaced. |
96
+
97
+ ### CSS Variables
98
+
99
+ | CSS Variable | Default | Description |
100
+ | --- | --- | --- |
101
+ | `--p-popover-w` | `max-content` | Width of the popover. |
102
+ | `--p-popover-h` | `auto` | Height of the popover. |
103
+ | `--p-popover-min-w` | `0px` | Min width of the popover. |
104
+ | `--p-popover-min-h` | `auto` | Min height of the popover. |
105
+ | `--p-popover-max-w` | `min(calc(100dvw - 16px), 48ch)` | Max width of the popover. |
106
+ | `--p-popover-max-h` | `calc(100dvh - 16px)` | Max height of the popover. |
107
+ | `--p-popover-px` | `16px` | Horizontal padding of the popover. It is recommended to apply an existing Porsche Design System spacing token, e.g. the CSS declaration `--p-popover-px: var(--p-spacing-static-md)`, the Tailwind CSS arbitrary property `[--p-popover-px:var(--spacing-static-md)]` or the equivalent SCSS/JS token. |
108
+ | `--p-popover-py` | `16px` | Vertical padding of the popover. It is recommended to apply an existing Porsche Design System spacing token, e.g. the CSS declaration `--p-popover-py: var(--p-spacing-static-sm)`, the Tailwind CSS arbitrary property `[--p-popover-py:var(--spacing-static-sm)]` or the equivalent SCSS/JS token. |
109
+ | `--p-popover-radius` | `12px` | Border radius of the popover. It is recommended to apply an existing Porsche Design System border-radius token, e.g. the CSS declaration `--p-popover-radius: var(--p-radius-lg)`, the Tailwind CSS arbitrary property `[--p-popover-radius:var(--radius-lg)]` or the equivalent SCSS/JS token. |
110
+
111
+ ## Examples
112
+
113
+ | Example | When to use | File |
114
+ | --- | --- | --- |
115
+ | Default | Minimal default configuration. | [./examples/Default.tsx](./examples/Default.tsx) |
116
+ | Slotted button | The `p-popover` component can also be used with a **slotted button** via the `button` slot, allowing you to provide a custom button element. | [./examples/SlottedButton.tsx](./examples/SlottedButton.tsx) |
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { PRadioGroup, PRadioGroupOption } from '@porsche-design-system/components-react';
3
+
4
+ export const Example = () => {
5
+ return (
6
+ <>
7
+ <PRadioGroup name="options" label="Some Label" description="Some description">
8
+ <PRadioGroupOption value="a" label="Option A"></PRadioGroupOption>
9
+ <PRadioGroupOption value="b" label="Option B"></PRadioGroupOption>
10
+ <PRadioGroupOption value="c" label="Option C"></PRadioGroupOption>
11
+ <PRadioGroupOption value="d" label="Option D"></PRadioGroupOption>
12
+ <PRadioGroupOption value="e" label="Option E"></PRadioGroupOption>
13
+ <PRadioGroupOption value="f" label="Option F"></PRadioGroupOption>
14
+ </PRadioGroup>
15
+ </>
16
+ )
17
+ }
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import {
3
+ PButton,
4
+ PRadioGroup,
5
+ PRadioGroupOption,
6
+ type PRadioGroupProps,
7
+ PText,
8
+ type RadioGroupChangeEventDetail,
9
+ } from '@porsche-design-system/components-react';
10
+ import { FormEvent, useState } from 'react';
11
+
12
+ export const Example = () => {
13
+ const [form, setForm] = useState({ myRadioGroup: '' });
14
+ const [lastSubmittedData, setLastSubmittedData] = useState<any>();
15
+
16
+ const onChange = (e: CustomEvent<RadioGroupChangeEventDetail>) => {
17
+ const { name, value } = e.target as HTMLElement & PRadioGroupProps;
18
+ setForm((prev) => ({
19
+ ...prev,
20
+ [name]: value,
21
+ }));
22
+ };
23
+
24
+ const onSubmit = (e: FormEvent<HTMLFormElement>) => {
25
+ e.preventDefault();
26
+ setLastSubmittedData(JSON.stringify(form));
27
+ };
28
+
29
+ const onReset = (e: FormEvent<HTMLFormElement>) => {
30
+ e.preventDefault();
31
+ setForm({ myRadioGroup: '' });
32
+ };
33
+
34
+ return (
35
+ <>
36
+ <form onSubmit={onSubmit} onReset={onReset} className="flex flex-col gap-fluid-sm">
37
+ <PRadioGroup name="myRadioGroup" label="Some Label" value={form.myRadioGroup} onChange={onChange}>
38
+ <PRadioGroupOption label="Option A" value="a"></PRadioGroupOption>
39
+ <PRadioGroupOption label="Option B" value="b"></PRadioGroupOption>
40
+ <PRadioGroupOption label="Option C" value="c"></PRadioGroupOption>
41
+ <PRadioGroupOption label="Option D" value="d"></PRadioGroupOption>
42
+ <PRadioGroupOption label="Option E" value="e"></PRadioGroupOption>
43
+ <PRadioGroupOption label="Option F" value="f"></PRadioGroupOption>
44
+ </PRadioGroup>
45
+ <div className="flex gap-fluid-sm">
46
+ <PButton type="submit">Submit</PButton>
47
+ <PButton type="reset">Reset</PButton>
48
+ </div>
49
+ <PText>Last submitted data: {lastSubmittedData}</PText>
50
+ </form>
51
+ </>
52
+ );
53
+ };
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { PPopover, PRadioGroup, PRadioGroupOption } from '@porsche-design-system/components-react';
3
+
4
+ export const Example = () => {
5
+ return (
6
+ <>
7
+ <PRadioGroup state="error" value="a">
8
+ <span slot="label">
9
+ Some slotted label with a
10
+ <a href="https://designsystem.porsche.com" className="underline">
11
+ link
12
+ </a>
13
+ text and a "label-after" slot.
14
+ </span>
15
+ <PPopover slot="label-after">
16
+ Some Popover description
17
+ </PPopover>
18
+ <span slot="description">
19
+ Some slotted description with a
20
+ <a href="https://designsystem.porsche.com" className="underline">
21
+ link
22
+ </a>
23
+ .
24
+ </span>
25
+ <span slot="message">
26
+ Some slotted error message with a
27
+ <a href="https://designsystem.porsche.com" className="underline">
28
+ link
29
+ </a>
30
+ .
31
+ </span>
32
+ <PRadioGroupOption value="a">
33
+ <span slot="label">
34
+ <img src="assets/911.png" alt="" className="object-contain inline-block align-middle -mt-2 me-static-sm w-[70px]" />
35
+ Some slotted label with custom content and a "label-after" slot
36
+ </span>
37
+ <PPopover slot="label-after">
38
+ Option A with slotted label and a popover
39
+ </PPopover>
40
+ </PRadioGroupOption>
41
+ <PRadioGroupOption value="b">
42
+ <span slot="label">
43
+ Option B with slotted label
44
+ </span>
45
+ </PRadioGroupOption>
46
+ <PRadioGroupOption value="c" disabled="true">
47
+ <span slot="label">
48
+ Disabled Option C with slotted label, a nested
49
+ <a href="https://www.porsche.com" className="underline">
50
+ link
51
+ </a>
52
+ and a label-after slot.
53
+ </span>
54
+ <PPopover slot="label-after">
55
+ Some information about the disabled state.
56
+ </PPopover>
57
+ </PRadioGroupOption>
58
+ <PRadioGroupOption value="d">
59
+ <span slot="label">
60
+ Option C with slotted label and a nested
61
+ <a href="https://www.porsche.com" className="underline">
62
+ link
63
+ </a>
64
+ </span>
65
+ </PRadioGroupOption>
66
+ </PRadioGroup>
67
+ </>
68
+ )
69
+ }
@@ -0,0 +1,157 @@
1
+ # p-radio-group
2
+
3
+ The `p-radio-group` component is a versatile custom form element that enables the selection of a single option.
4
+
5
+ > **Attention**
6
+ >
7
+ > The `blur` event is emitted whenever the focused `p-radio-group-option` changes — not only when the entire `p-radio-group` loses focus. This means that switching between options within the same group will also trigger a `blur` event for the previously focused option.
8
+
9
+ Options are slotted using the `p-radio-group-option` component. Each option needs to have an assigned value, which can be passed via an attribute or property and needs to be of type string. Initial selection states can only be achieved using the value property on the `p-radio-group` component. If an option should be visible but not selectable, it can be disabled by using the `disabled` attribute.
10
+
11
+ A `label` is a caption which informs the user what information a particular form field is asking for. The `p-radio-group` component can be used with or without a label, but it's recommended to keep the label visible for better accessibility whenever possible. When used without a label, it's best practice to provide a descriptive label text for screen readers.
12
+
13
+ ## Usage
14
+
15
+ ### Do:
16
+
17
+ - Use to enable a user to select one value from a predefined list. Use as soon as two options are mutually exclusive.
18
+ - Use [Checkbox](../p-checkbox/p-checkbox.md) instead if there is only one option.
19
+ - Use when the user should see all available options.
20
+ - Consider using the [Segmented Control](../p-segmented-control/p-segmented-control.md) for 5 options or fewer.
21
+ - Keep the label text short and descriptive (one or two words).
22
+ - Select one option by default in a group of radio buttons, except for cases where a pre-selection can lead to wrong assumptions.
23
+ - Align radio buttons with more than 2 items vertically left-aligned.
24
+
25
+ ### Don't:
26
+
27
+ - Don't use a radio Button for a large number of items (≥ 7), use the [Select](../p-select/p-select.md) or [Segmented Control](../p-segmented-control/p-segmented-control.md) component instead.
28
+
29
+ ---
30
+
31
+ ## Related Components
32
+
33
+ - [Checkbox](../p-checkbox/p-checkbox.md)
34
+ - [Segmented Control](../p-segmented-control/p-segmented-control.md)
35
+ - [Select](../p-select/p-select.md)
36
+
37
+ ## Accessibility support
38
+
39
+ ### Keyboard
40
+
41
+ | Key / state | Function |
42
+ | --- | --- |
43
+ | `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
44
+ | `Arrow left`, `Arrow right`, `Down Arrow` `Up Arrow` | Activates and moves focus to the next/prev radio button in a group. |
45
+
46
+ ### ARIA enhancements
47
+
48
+ #### Internal **ARIA** that is managed by the component:
49
+
50
+ | ARIA | Usage |
51
+ | --- | --- |
52
+ | `aria-labelledby="IDREF"` | Defines the accessible name. |
53
+ | `aria-describedby="IDREF"` | Defines the accessible description combined with the status message. |
54
+ | `role="status"`, `role="alert"` | When `message` and `state` or `loading` prop change, the status message is announced. |
55
+ | `aria-hidden="true"` | If `required` attribute is set, the visible asterisk indicator is hidden from assistive technologies. |
56
+ | `aria-invalid="true"` | If `error` state is set. |
57
+ | `aria-required="true"` | Indicates if the element is required. |
58
+
59
+ ## Development considerations
60
+
61
+ ### Disabled state
62
+
63
+ 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.
64
+
65
+ ### Common do's and don'ts
66
+
67
+ - **Do** provide a clear group `label` that describes the choice being made.
68
+ - **Do** use meaningful option labels so each choice is understandable out of context.
69
+ - **Do** use the component state/message API so validation and status changes are announced.
70
+ - **Don't** rely on adjacent text instead of the group `label` prop.
71
+ - **Don't** use `hide-label` without an accessible name.
72
+
73
+ ## Tests
74
+
75
+ ### Automated
76
+
77
+ | Technology | Support |
78
+ | --- | --- |
79
+ | AXE-Core (WCAG 2.2 AA, Best-Practice) | ✅ |
80
+ | High-Contrast Mode (light/dark) | ✅ |
81
+ | Text-Zoom (200%) | ✅ |
82
+
83
+ ### Manual
84
+
85
+ | Technology | Support |
86
+ | --- | --- |
87
+ | Keyboard | ✅ |
88
+ | Screen reader (VoiceOver, NVDA) | ⚠️(Note: VoiceOver/NVDA do not announce the number of options correctly when used with Safari or Chrome) |
89
+
90
+ ## API
91
+
92
+ ### Properties
93
+
94
+ | Property | Type | Default | Description |
95
+ | --- | --- | --- | --- |
96
+ | `compact` | `boolean` | `false` | Reduces the spacing between radio options 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 guidance about the radio group. |
98
+ | `direction` | `'row'` `'column'`<br>`BreakpointCustomizable<RadioGroupDirection>` | `'column'` | Sets the layout direction of the radio options. Use `column` to stack them vertically or `row` to arrange them horizontally. Supports responsive breakpoint values. |
99
+ | `disabled` | `boolean` | `false` | Disables all radio options in the group, preventing selection and excluding the value from form submissions. |
100
+ | `form` | `string` | `undefined` | Associates the radio group with a form element by its ID when the group is not a direct descendant of that form. |
101
+ | `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
102
+ | `label` | `string` | `''` | Sets the visible label text displayed above the radio group to identify the group's purpose. |
103
+ | `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables all radio options and shows a spinner to indicate a background loading operation. |
104
+ | `message` | `string` | `''` | Sets the validation feedback message displayed below the radio group when `state` is `success` or `error`. |
105
+ | `name` _(required)_ | `string` | `undefined` | Sets the shared name attribute for all radio buttons in the group, grouping them for mutually exclusive selection. |
106
+ | `required` | `boolean` | `false` | Marks the radio group as required so the form cannot be submitted until one option is selected. |
107
+ | `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state of the radio group, controlling its visual appearance and feedback message style (`none`, `success`, `error`). |
108
+ | `value` | `string` | `''` | Sets the currently selected value that pre-selects the matching radio option and reflects user changes. |
109
+
110
+ ### Events
111
+
112
+ | Event | Type | Description |
113
+ | --- | --- | --- |
114
+ | `blur` | `CustomEvent<void>` | Emitted when the radio group loses focus after the user interacts with it, useful for triggering validation on blur. |
115
+ | `change` | `CustomEvent<RadioGroupChangeEventDetail>`<br>`Event` | Emitted when the user selects a different option, carrying the new value and the native event in the event detail. |
116
+
117
+ ### Slots
118
+
119
+ | Slot | Required | Allowed tag names | Description |
120
+ | --- | --- | --- | --- |
121
+ | `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
122
+ | `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`). |
123
+ | `description` | no | — | Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
124
+ | _(default)_ | no | — | Default slot for the p-radio-group-option tags. |
125
+ | `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. |
126
+
127
+ ## Sub-components
128
+
129
+ 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.
130
+
131
+ ### `p-radio-group-option`
132
+
133
+ Allowed parent: `p-radio-group`.
134
+
135
+ #### Properties
136
+
137
+ | Property | Type | Default | Description |
138
+ | --- | --- | --- | --- |
139
+ | `disabled` | `boolean` | `false` | Prevents this option from being selected and excludes its value from form submissions while it is disabled. |
140
+ | `label` | `string` | `undefined` | Sets the visible label text displayed next to the radio button that the user reads to identify the option. |
141
+ | `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables this option and shows a spinner to indicate that this particular option is in a loading state. |
142
+ | `value` | `string` | `undefined` | Sets the value submitted with the form data when this radio option is selected within its parent group. |
143
+
144
+ #### Slots
145
+
146
+ | Slot | Required | Allowed tag names | Description |
147
+ | --- | --- | --- | --- |
148
+ | `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
149
+ | `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`). |
150
+
151
+ ## Examples
152
+
153
+ | Example | When to use | File |
154
+ | --- | --- | --- |
155
+ | Default | Minimal default configuration. | [./examples/Default.tsx](./examples/Default.tsx) |
156
+ | Form | The `p-radio-group` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.tsx](./examples/Form.tsx) |
157
+ | Slots | Use named slots when `label` or `message` need markup such as a link. | [./examples/Slots.tsx](./examples/Slots.tsx) |
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { PScroller, PTag } from '@porsche-design-system/components-react';
3
+
4
+ export const Example = () => {
5
+ return (
6
+ <>
7
+ <PScroller className="max-w-[600px] whitespace-nowrap">
8
+ <PTag className="me-static-md" color="primary">
9
+ <button type="button">
10
+ Some tag content
11
+ </button>
12
+ </PTag>
13
+ <PTag className="me-static-md" color="notification-info-soft">
14
+ <button type="button">
15
+ Some tag content
16
+ </button>
17
+ </PTag>
18
+ <PTag className="me-static-md" color="notification-warning-soft">
19
+ <button type="button">
20
+ Some tag content
21
+ </button>
22
+ </PTag>
23
+ <PTag className="me-static-md" color="primary">
24
+ <button type="button">
25
+ Some tag content
26
+ </button>
27
+ </PTag>
28
+ <PTag className="me-static-md" color="notification-info-soft">
29
+ <button type="button">
30
+ Some tag content
31
+ </button>
32
+ </PTag>
33
+ <PTag className="me-static-md" color="notification-warning-soft">
34
+ <button type="button">
35
+ Some tag content
36
+ </button>
37
+ </PTag>
38
+ <PTag className="me-static-md" color="primary">
39
+ <button type="button">
40
+ Some tag content
41
+ </button>
42
+ </PTag>
43
+ <PTag color="notification-info-soft">
44
+ <button type="button">
45
+ Some tag content
46
+ </button>
47
+ </PTag>
48
+ </PScroller>
49
+ </>
50
+ )
51
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { PScroller, PTagDismissible } from '@porsche-design-system/components-react';
3
+
4
+ export const Example = () => {
5
+ return (
6
+ <>
7
+ <PScroller className="max-w-[600px] whitespace-nowrap">
8
+ <PTagDismissible className="me-static-md">
9
+ Some tag content
10
+ </PTagDismissible>
11
+ <PTagDismissible className="me-static-md">
12
+ Some tag content
13
+ </PTagDismissible>
14
+ <PTagDismissible className="me-static-md">
15
+ Some tag content
16
+ </PTagDismissible>
17
+ <PTagDismissible className="me-static-md">
18
+ Some tag content
19
+ </PTagDismissible>
20
+ <PTagDismissible className="me-static-md">
21
+ Some tag content
22
+ </PTagDismissible>
23
+ </PScroller>
24
+ </>
25
+ )
26
+ }
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import {
3
+ PButton,
4
+ PScroller,
5
+ PTagDismissible,
6
+ type ScrollerScrollToPosition,
7
+ } from '@porsche-design-system/components-react';
8
+ import { useCallback, useState } from 'react';
9
+
10
+ export const Example = () => {
11
+ const style = `
12
+ p-scroller > *:not(:last-child) {
13
+ margin-right: 1rem;
14
+ }
15
+
16
+ button {
17
+ margin: 0 1rem 1rem 0;
18
+ }
19
+ `;
20
+
21
+ const [scrollToPosition, setScrollToPosition] = useState<ScrollerScrollToPosition>({
22
+ scrollPosition: 220,
23
+ isSmooth: false,
24
+ });
25
+
26
+ const onClick = useCallback(
27
+ (scrollPosition: number) => () => {
28
+ setScrollToPosition({ scrollPosition: scrollPosition, isSmooth: true });
29
+ },
30
+ []
31
+ );
32
+
33
+ return (
34
+ <>
35
+ <style dangerouslySetInnerHTML={{ __html: style }} />
36
+
37
+ <div className="flex gap-fluid-sm">
38
+ <PButton type="button" onClick={onClick(0)} compact={true}>
39
+ Scroll to start
40
+ </PButton>
41
+ <PButton type="button" onClick={onClick(220)} compact={true}>
42
+ Scroll to middle
43
+ </PButton>
44
+ <PButton type="button" onClick={onClick(720)} compact={true}>
45
+ Scroll to end
46
+ </PButton>
47
+ </div>
48
+
49
+ <div style={{ maxWidth: '400px', whiteSpace: 'nowrap' }} className="mt-fluid-sm">
50
+ <PScroller scrollToPosition={scrollToPosition}>
51
+ <PTagDismissible>START - some tag content</PTagDismissible>
52
+ <PTagDismissible>MIDDLE - some tag content</PTagDismissible>
53
+ <PTagDismissible>END - some tag content</PTagDismissible>
54
+ </PScroller>
55
+ </div>
56
+ </>
57
+ );
58
+ };
@@ -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.tsx](./examples/Default.tsx) |
92
+ | Height | The height of `p-scroller` depends on the height of its content. | [./examples/Height.tsx](./examples/Height.tsx) |
93
+ | Scroll to position | The `p-scroller` component provides the `scrollToPosition` property. | [./examples/ScrollToPosition.tsx](./examples/ScrollToPosition.tsx) |