Porsche Design SystemSearchNavigate to GitHub repository of Porsche Design SystemOpen sidebar
ConfiguratorExamplesUsageAccessibilityAPI
Button Pure Table of Contents Button Pure with custom clickable/focusable area Sometimes it might be useful to enlarge the clickable/focusable area of a button to fulfill accessibility guidelines. Therefore, a custom padding can be set on the host element.
Some label
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<p-button-pure class="p-static-md">
  Some label
</p-button-pure>
<script>

</script>
</body>
</html>
Form When used as a submit button, the name and value props are submitted as a pair as part of the form data.
Button AButton B
Last submitted data: none
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<form>
  <p-button-pure name="option" value="A" type="submit">Button A</p-button-pure>
  <p-button-pure name="option" value="B" type="submit">Button B</p-button-pure>
</form>

<p-text>Last submitted data: none</p-text>
<script>
  const debugElement = document.querySelector('p-text');
  const form = document.querySelector('form');
  form.addEventListener('submit', (e) => {
    e.preventDefault();
    const formData = Array.from(new FormData(e.target, e.submitter).entries())[0];
    debugElement.innerText = `Last submitted data: ${formData.join('=') || 'none'}`;
  });
</script>
</body>
</html>
Form Attribute When a button is used as a submit or reset button outside a form, the form attribute can be utilized to explicitly associate the button with a specific form element. When using the p-button-pure component as a submit or reset button outside a form, it relies on the ElementInternals API, which has limited browser support.

As of now, the submitter in the form event is null because the button cannot be accessed within the shadow DOM to be passed as an argument to the requestSubmit() function (WICG/webcomponents#814).

Additionally, custom components using ElementInternals may include all values of elements with the same name attribute in form data, rather than only the value of the triggering element, deviating from native form behavior.
SubmitResetLast submitted data: none
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<form id="some-form">
  <p-textarea name="some-name" label="Some Label"></p-textarea>
</form>

<p-button-group>
  <p-button-pure type="submit" form="some-form">Submit</p-button-pure>
  <p-button-pure type="reset" form="some-form">Reset</p-button-pure>
</p-button-group>

<p-text>Last submitted data: none</p-text>
<script>
  const debugElement = document.querySelector('p-text');
  const form = document.querySelector('form');
  form.addEventListener('submit', (e) => {
    e.preventDefault();
    const formData = new FormData(form);
    debugElement.innerText = `Last submitted data: ${formData.get('some-name') || 'none'} `;
  });
</script>
</body>
</html>
Global settingsThemeChanges the theme of the application and any Porsche Design System component. It's possible to choose between forced theme light and dark. It's also possible to use auto, which applies light or dark theme depending on the operating system settings automatically.LightDarkAuto (sync with operating system)DirectionChanges the direction of HTML elements, mostly used on<html> tag to support languages which are read from right to left like e.g. Arabic.LTR (left-to-right)RTL (right-to-left)AutoText ZoomChanges the text size and values with unit rem or em relatively. This setting can be defined in browser settings for any website or by an application itself on<html> tag. To achieve WCAG 2.2 AA compliance it's obligatory to support text zoom up to at least 200%.100%130%150%200%