The component is able to break out of its aspect ratio in case content overflows to be accessibility compliant (see
first row in example).
Additionally, the component is able to align to the highest CSS Grid child independent of the aspect ratio when used in
CSS Grid context (see second row in example).
Browser Support Limitation
Currently, Safari is only able to align the height per CSS Grid row as long as the content does not overflow.
4/3Primary labelSecondary label
4/3Primary labelSecondary label
1/1Primary labelSecondary label
9/16Primary labelSecondary label
1/1Primary labelSecondary label
prev
next
Open in Stackblitz
<!doctype html>
<htmllang="en"class="auto"><head><title></title></head><bodyclass="bg-base"><divclass="grid grid-cols-2 gap-static-md"><p-link-tile-model-signatureaspect-ratio="4/3"heading="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum."><p-tagslot="header"theme="dark"color="background-frosted"compact="true"> 4/3
</p-tag><imgsrc="assets/lights.jpg"alt="Some image description" /><p-linkslot="primary"href="https://porsche.com/#primary"> Primary label
</p-link><p-linkslot="secondary"href="https://porsche.com/#secondary"> Secondary label
</p-link></p-link-tile-model-signature><p-link-tile-model-signatureaspect-ratio="4/3"heading="Some description"><p-tagslot="header"theme="dark"color="background-frosted"compact="true"> 4/3
</p-tag><imgsrc="assets/lights.jpg"alt="Some image description" /><p-linkslot="primary"href="https://porsche.com/#primary"> Primary label
</p-link><p-linkslot="secondary"href="https://porsche.com/#secondary"> Secondary label
</p-link></p-link-tile-model-signature><p-link-tile-model-signatureaspect-ratio="1/1"heading="Some description"><p-tagslot="header"theme="dark"color="background-frosted"compact="true"> 1/1
</p-tag><imgsrc="assets/lights.jpg"alt="Some image description" /><p-linkslot="primary"href="https://porsche.com/#primary"> Primary label
</p-link><p-linkslot="secondary"href="https://porsche.com/#secondary"> Secondary label
</p-link></p-link-tile-model-signature><p-link-tile-model-signatureaspect-ratio="9/16"heading="Some description"><p-tagslot="header"theme="dark"color="background-frosted"compact="true"> 9/16
</p-tag><imgsrc="assets/lights.jpg"alt="Some image description" /><p-linkslot="primary"href="https://porsche.com/#primary"> Primary label
</p-link><p-linkslot="secondary"href="https://porsche.com/#secondary"> Secondary label
</p-link></p-link-tile-model-signature><p-link-tile-model-signatureaspect-ratio="1/1"heading="Some description"><p-tagslot="header"theme="dark"color="background-frosted"compact="true"> 1/1
</p-tag><imgsrc="assets/lights.jpg"alt="Some image description" /><p-linkslot="primary"href="https://porsche.com/#primary"> Primary label
</p-link><p-linkslot="secondary"href="https://porsche.com/#secondary"> Secondary label
</p-link></p-link-tile-model-signature></div><script></script></body></html>
While the p-link-tile-model-signature supports slotted a links within its required p-link children, clicking
anything besides the two p-link elements needs to be handled manually.
Some tagPrimary labelSecondary label
prev
next
Open in Stackblitz
<!doctype html>
<htmllang="en"class="auto"><head><title></title></head><bodyclass="bg-base"><p-link-tile-model-signatureheading="Some heading"><p-tagslot="header"color="background-frosted"compact="true"> Some tag
</p-tag><imgsrc="assets/lights.jpg"alt="Some image description" /><p-linkslot="primary"href="https://porsche.com/#primary"> Primary label
</p-link><p-linkslot="secondary"href="https://porsche.com/#secondary"> Secondary label
</p-link></p-link-tile-model-signature><script></script></body></html>
The easiest way to achieve this is to add a click event listener on the component itself, call
event.preventDefault() once the event handler is invoked and read the href value from the target.
const linkEl = document.querySelector('p-link-tile-model-signature');
linkEl.addEventListener('click', (event) => {
event.preventDefault();
const { href } = event.composedPath()[0];
history.pushState({}, '', href); // or whatever your routing library provides as a hook or service});