PAD + web components
● The platform's own components

Rendered by PAD,
defined by the browser.

A custom element with its shadow root written on the server: declarative shadow DOM shows it encapsulated and slotted before any script ran, and a small module upgrades it where it needs behaviour. PAD's own components - a custom tag with parameters - write them.

Rendered on the server

This card is a <pad-card> with its shadow root - and the page has no script for it.

See how

Rendered on the server

1 examples

A PAD custom tag writes the custom element with its shadow root already in it - declarative shadow DOM - so it shows, styled and slotted, before any script ran.

Cards with slots

{card title='Revenue'} is a PAD custom tag that writes <pad-card> with its shadow root: encapsulated styles inlined by {shadow css=}, named slots the browser fills from the light DOM - and not a line of JavaScript.

{shadow}_tags/card.pad{parms}shadowrootmode<slot>::slotted

Upgraded in the browser

4 examples

A small module defines the element: it finds the root PAD rendered and adds behaviour - keys, clicks, a post back, a value in a form.

Tabs, upgraded

The tabs are complete HTML when they arrive - the first panel shows. Once tabs.js defines <pad-tabs>, the element takes the root PAD rendered and adds clicks and arrow keys.

{shadow}_tags/tabs.padcustomElements.definethis.shadowRoot

A rating that posts

<pad-rating value="4"> gets its value from PAD and its stars from the server; a click posts the new rating with the session's CSRF token, and the element shows the average PAD answers.

padSession$padExposeattributeChangedCallbackfetch POST

A field of a form

<pad-stepper> is form-associated: ElementInternals gives the {form} its value, the post carries it like any field, and padValidate checks it on the server.

{form}padValidatepadPostedformAssociatedElementInternals

A library: Lit

A Lit element rendered in the browser, fed by PAD through an attribute: items="{^items}" is JSON Lit reads into a property - the same data any element gets.

{^field}LitElementstatic properties