OverviewInstallationMigrating to 1.0Themes and layersKanok designCustomizingIconsForms and validationFrameworksUsing with AIButtonText inputText areaNumber inputSearchSelectDropdownComboboxMulti-selectCheckboxRadio buttonToggleDate pickerTime pickerSliderFile uploaderModalSide panelTearsheetNotificationToastTooltipDefinition tooltipPopoverToggletipMenuData tableStructured listPaginationContained listTree viewTabsBreadcrumbLinkPagination navContent switcherAccordionProgress indicatorUI shellTagTileCardProduct cardCode snippetCopy buttonUser avatarTruncated textListLoadingInline loadingProgress barSkeletonBadge indicatorStatus indicatorGridHeadingLayerAction setPage headerBig numberEdit in placeIntroductionText inputText areaNumber inputSearchSelectDropdownComboboxMulti-selectCheckboxRadio buttonToggleDate pickerTime pickerSliderFile uploaderTabsPagination navContent switcherTooltipDefinition tooltipPopoverMenuAccordionProgress indicatorUI shellModalSide panelTearsheetNotificationToastData tableStructured listPaginationTree viewCode snippetCopy buttonTruncated textLoadingTagCardProduct cardEdit in place
Product card
ui-productive-card and ui-expressive-card are Carbon for IBM Products' ProductiveCard and ExpressiveCard: cards you configure with attributes, not with parts. They are IBM Products' legacy cards, kept for screens that must match IBM product UIs. For new work, use Card: Carbon's parts-based card, where both Carbon and IBM Products are heading.
npmshadcn · Web componentshadcn · React + TailwindManualnpminstall@purpurabog/uinpxshadcn@4add@kanok-ui/product-cardnpxshadcn@4add@kanok-ui/tw-product-card# Web component# 1. Install the dependenciesnpminstalllit@^3.3.0# 2. Copy each file's "content" from# https://cdn.jsdelivr.net/npm/@purpurabog/ui@2.3.0/registry/product-card.json# to its target:# components/ui/primitives/product-card/expressive-card.ts# components/ui/primitives/product-card/product-card-shared.ts# components/ui/primitives/product-card/product-card.ts# components/ui/primitives/product-card/productive-card.ts# 3. Do the same for the items it needs (registry/<name>.json):# button, core-product-card, icon-button, layer, menu, overflow-menu, shared-element, shared-localize, shared-slots, tokens# React + Tailwind# 1. Install the dependenciesnpminstall@purpurabog/ui@^2.3.0# 2. Copy each file's "content" from# https://cdn.jsdelivr.net/npm/@purpurabog/ui@2.3.0/registry/tw-product-card.json# to its target:# components/ui/react-tw/product-card.tsx# 3. Do the same for the items it needs (registry/<name>.json):# core-product-card, tw-button, tw-i18n, tw-icon-button, tw-layer, tw-menu, tw-theme, tw-utils
npm gives you every component from the package. shadcn copies the source into your app instead: a copy pinned to this version that you can change. The shadcn commands need the @kanok-ui registry in your components.json once, see Installation.
Use it
Both cards load from one module.
HTMLReactReact + Tailwind<scripttype="module">import'@purpurabog/ui/product-card';</script>
<ui-productive-cardheading="Legal"description="6 people">14 contracts in review.</ui-productive-card>import { UiProductiveCard, UiExpressiveCard } from'@purpurabog/ui/react';
<UiProductiveCardheading="Legal"description="6 people">14 contracts in review.</UiProductiveCard>import { ProductiveCard, ExpressiveCard } from'@/components/ui/react-tw/product-card';
<ProductiveCardtitle="Legal"description="6 people">14 contracts in review.</ProductiveCard>
The title is heading on the element (title is every element's native tooltip) and title in React + Tailwind, as in Carbon.
Productive, expressive or Card?
Component
Use it when
ui-productive-card
Dense product screens that copy IBM Products: a compact title, small icon actions or an overflow menu, ghost buttons.
ui-expressive-card
Content cards that copy IBM Products: media, a pictogram, a larger title, primary and secondary buttons.
Anything new. You build it from parts, and it is where Carbon is going.
Action icons
Icon buttons go in the actions slot (actionIcons in React + Tailwind); give each a label. The card makes them ghost buttons and sets their size: small at the top, medium at the bottom. They are separate tab stops.
Silom branch, second floor. The contractor starts on 1 November.
Pressed:
HTMLReactReact + Tailwind<ui-productive-cardid="product-card-icons"heading="Branch renovation"description="Due in 3 days"style="max-width: 360px">
<ui-icon-buttonslot="actions"label="Edit"><svgviewBox="0 0 16 16"><pathd="M1 13h14v1H1zM12.7 4.5 10.5 2.3a1 1 0 0 0-1.4 0L3 8.4V11h2.6l6.1-6.1a1 1 0 0 0 0-1.4zM5.2 10H4V8.8l4-4 1.2 1.2zm4.7-4.7L8.7 4.1l1.1-1.1L11 4.2z" /></svg></ui-icon-button>
<ui-icon-buttonslot="actions"label="Delete"><svgviewBox="0 0 16 16"><pathd="M6 6h1v6H6zm3 0h1v6H9zM2 3v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3zm2 11V4h8v10zM6 1h4v1H6z" /></svg></ui-icon-button>
Silom branch, second floor. The contractor starts on 1 November.
</ui-productive-card>
<p>Pressed: <outputid="product-card-icons-out">nothing yet</output></p>
<scripttype="module">
const out = document.getElementById('product-card-icons-out');
for (const button of document.querySelectorAll('#product-card-icons ui-icon-button')) {
button.addEventListener('click', () => (out.value = button.label));
}
</script><UiProductiveCardheading="Branch renovation"description="Due in 3 days">
<UiIconButtonslot="actions"label="Edit"onClick={edit}>{editIcon}</UiIconButton>
<UiIconButtonslot="actions"label="Delete"onClick={remove}>{trashIcon}</UiIconButton>
Silom branch, second floor. The contractor starts on 1 November.
</UiProductiveCard><ProductiveCardtitle="Branch renovation"description="Due in 3 days"actionIcons={[
{ id:'edit', icon: editIcon, iconDescription:'Edit', onClick: edit },
{ id:'delete', icon: trashIcon, iconDescription:'Delete', onClick: remove },
]}
>
Silom branch, second floor. The contractor starts on 1 November.
</ProductiveCard>
Overflow menu
A productive card can show its actions in an overflow menu instead: put ui-menu-items in the overflow slot (overflowActions in React + Tailwind). When there are menu items, they replace the icons. The menu button is named "Options" (translated); overflow-aria-label changes it. Choosing an item fires ui-select, which bubbles up to the card.
Packaging materials, monthly, until December 2027.
Chosen:
HTMLReactReact + Tailwind<ui-productive-cardid="product-card-menu"heading="Supply agreement C-2026-014"description="Chiang Mai plant"overflow-aria-label="Contract actions"style="max-width: 360px">
<ui-menu-itemslot="overflow"label="Duplicate"></ui-menu-item>
<ui-menu-itemslot="overflow"label="Send for signature"></ui-menu-item>
<ui-menu-itemslot="overflow"label="Delete"kind="danger"></ui-menu-item>
Packaging materials, monthly, until December 2027.
</ui-productive-card>
<p>Chosen: <outputid="product-card-menu-out">nothing yet</output></p>
<scripttype="module">
const card = document.getElementById('product-card-menu');
const out = document.getElementById('product-card-menu-out');
card.addEventListener('ui-select', (event) => (out.value = event.detail.label));
</script><UiProductiveCardheading="Supply agreement C-2026-014"description="Chiang Mai plant"overflowAriaLabel="Contract actions">
<UiMenuItemslot="overflow"label="Duplicate"onUiSelect={duplicate} />
<UiMenuItemslot="overflow"label="Send for signature"onUiSelect={send} />
<UiMenuItemslot="overflow"label="Delete"kind="danger"onUiSelect={remove} />
Packaging materials, monthly, until December 2027.
</UiProductiveCard><ProductiveCardtitle="Supply agreement C-2026-014"description="Chiang Mai plant"overflowAriaLabel="Contract actions"overflowActions={[
{ id:'duplicate', itemText:'Duplicate', onClick: duplicate },
{ id:'send', itemText:'Send for signature', onClick: send },
{ id:'delete', itemText:'Delete', kind:'danger', onClick: remove },
]}
>
Packaging materials, monthly, until December 2027.
</ProductiveCard>
Actions at the bottom
actions-placement="bottom" moves the icons (or the menu) into the footer, at medium size. With a primary button there too, the button goes at the start and the icons at the end.
48 contracts signed, 5 expiring in the next 30 days.
HTMLReactReact + Tailwind<ui-productive-cardheading="Monthly contract summary"description="September 2026"actions-placement="bottom"primary-button-text="View report"style="max-width: 360px">
<ui-icon-buttonslot="actions"label="Download"><svgviewBox="0 0 16 16"><pathd="M13 12v2H3v-2H2v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-2zM13 7l-.7-.7-3.8 3.8V1h-1v9.1L3.7 6.3 3 7l5 5z" /></svg></ui-icon-button>
48 contracts signed, 5 expiring in the next 30 days.
</ui-productive-card><UiProductiveCardheading="Monthly contract summary"description="September 2026"actionsPlacement="bottom"primaryButtonText="View report">
<UiIconButtonslot="actions"label="Download">{downloadIcon}</UiIconButton>
48 contracts signed, 5 expiring in the next 30 days.
</UiProductiveCard><ProductiveCardtitle="Monthly contract summary"description="September 2026"actionsPlacement="bottom"primaryButtonText="View report"actionIcons={[{ id:'download', icon: downloadIcon, iconDescription:'Download' }]}
>
48 contracts signed, 5 expiring in the next 30 days.
</ProductiveCard>
Buttons
primary-button-text and secondary-button-text add buttons; on a productive card both are ghost buttons. They sit in the footer by default. primary-button-placement="top" moves the primary one next to the top actions as a small ghost button; secondary-button-placement="top" does the same for the secondary one, but only when there are other top actions, as in Carbon. A press fires ui-primary-button-click or ui-secondary-button-click.
Purchase of 20 laptops for the Finance department, 640,000 baht.
Renewal of the cleaning contract, 12 months.
Pressed:
HTMLReactReact + Tailwind<ui-productive-cardid="product-card-buttons"heading="Approval request"description="From Malee S."primary-button-text="Approve"secondary-button-text="Reject"style="max-width: 360px">
Purchase of 20 laptops for the Finance department, 640,000 baht.
</ui-productive-card>
<ui-productive-cardid="product-card-top"heading="Approval request"description="From Somchai K."primary-button-text="Approve"primary-button-placement="top"style="max-width: 360px">
Renewal of the cleaning contract, 12 months.
</ui-productive-card>
<p>Pressed: <outputid="product-card-buttons-out">nothing yet</output></p>
<scripttype="module">
const out = document.getElementById('product-card-buttons-out');
for (const id of ['product-card-buttons', 'product-card-top']) {
const card = document.getElementById(id);
card.addEventListener('ui-primary-button-click', () => (out.value =`${card.description}: approve`));
card.addEventListener('ui-secondary-button-click', () => (out.value =`${card.description}: reject`));
}
</script><UiProductiveCardheading="Approval request"description="From Malee S."primaryButtonText="Approve"secondaryButtonText="Reject"onUiPrimaryButtonClick={approve} onUiSecondaryButtonClick={reject}>
Purchase of 20 laptops for the Finance department, 640,000 baht.
</UiProductiveCard>
<UiProductiveCardheading="Approval request"description="From Somchai K."primaryButtonText="Approve"primaryButtonPlacement="top"onUiPrimaryButtonClick={approve}>
Renewal of the cleaning contract, 12 months.
</UiProductiveCard><ProductiveCardtitle="Approval request"description="From Malee S."primaryButtonText="Approve"secondaryButtonText="Reject"onPrimaryButtonClick={approve} onSecondaryButtonClick={reject}>
Purchase of 20 laptops for the Finance department, 640,000 baht.
</ProductiveCard>
<ProductiveCardtitle="Approval request"description="From Somchai K."primaryButtonText="Approve"primaryButtonPlacement="top"onPrimaryButtonClick={approve}>
Renewal of the cleaning contract, 12 months.
</ProductiveCard>
primary-button-disabled and secondary-button-disabled disable a button.
Button links and icons
primary-button-href and secondary-button-href make a footer button a link (a primary button at the top takes no href, as in Carbon). A 16px icon after the text goes in the primary-button-icon or secondary-button-icon slot (primaryButtonIcon, secondaryButtonIcon in React + Tailwind).
Who can approve purchases, and up to what amount.
HTMLReactReact + Tailwind<ui-productive-cardheading="Procurement policy"description="Version 4, 2026"primary-button-text="Read the policy"primary-button-href="#accessibility"style="max-width: 360px">
<svgslot="primary-button-icon"viewBox="0 0 16 16"aria-hidden="true"><pathd="M9.3 3.7 13.1 7.5H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z" /></svg>
Who can approve purchases, and up to what amount.
</ui-productive-card><UiProductiveCardheading="Procurement policy"description="Version 4, 2026"primaryButtonText="Read the policy"primaryButtonHref="/policies/procurement">
<svgslot="primary-button-icon"viewBox="0 0 16 16"aria-hidden="true"><pathd="M9.3 3.7 13.1 7.5H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z" /></svg>
Who can approve purchases, and up to what amount.
</UiProductiveCard><ProductiveCardtitle="Procurement policy"description="Version 4, 2026"primaryButtonText="Read the policy"primaryButtonHref="/policies/procurement"primaryButtonIcon={<svgviewBox="0 0 16 16"aria-hidden="true"><pathd="M9.3 3.7 13.1 7.5H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z" /></svg>}
>
Who can approve purchases, and up to what amount.
</ProductiveCard>
Title size and heading level
title-size="large" sets a productive card's title in heading-03 instead of heading-compact-02. The title is an <h2>; set the level that fits your page with heading-level (h1 … h6; headingAs in React + Tailwind). For markup in the label, title or description, use the label, title and description slots.
48 contracts, 12 more than August
Sales 21 · Legal 15 · Procurement 12
HTMLReactReact + Tailwind<ui-productive-cardheading="Signed this month"heading-level="h3"title-size="large"style="max-width: 360px">
<spanslot="description">48 contracts, <b>12 more</b> than August</span>
Sales 21 · Legal 15 · Procurement 12
</ui-productive-card><UiProductiveCardheading="Signed this month"headingLevel="h3"titleSize="large">
<spanslot="description">48 contracts, <b>12 more</b> than August</span>
Sales 21 · Legal 15 · Procurement 12
</UiProductiveCard><ProductiveCardtitle="Signed this month"headingAs="h3"titleSize="large"description={<>48 contracts, <b>12 more</b> than August</>}>
Sales 21 · Legal 15 · Procurement 12
</ProductiveCard>
Clickable
clickable turns one zone of the card into a button that fires ui-click on a click, Enter or Space (in React + Tailwind, passing onClick does it). click-zone picks the zone: one the whole card (default), two the header with the body, three the body. The zone's button lies under the card's own buttons, which stay separate tab stops and never fire ui-click. The title names the button and the description describes it.
Click anywhere but the edit button.
Only this text is the button.
Last click:
HTMLReactReact + Tailwind<divstyle="display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px">
<ui-productive-cardid="product-card-zone-one"clickableheading="Zone one"description="The whole card">
<ui-icon-buttonslot="actions"label="Edit"><svgviewBox="0 0 16 16"><pathd="M1 13h14v1H1zM12.7 4.5 10.5 2.3a1 1 0 0 0-1.4 0L3 8.4V11h2.6l6.1-6.1a1 1 0 0 0 0-1.4zM5.2 10H4V8.8l4-4 1.2 1.2zm4.7-4.7L8.7 4.1l1.1-1.1L11 4.2z" /></svg></ui-icon-button>
Click anywhere but the edit button.
</ui-productive-card>
<ui-productive-cardid="product-card-zone-three"clickableclick-zone="three"heading="Zone three"description="The body only"primary-button-text="Details">
Only this text is the button.
</ui-productive-card>
</div>
<p>Last click: <outputid="product-card-zone-out">nothing yet</output></p>
<scripttype="module">
const out = document.getElementById('product-card-zone-out');
for (const id of ['product-card-zone-one', 'product-card-zone-three']) {
const card = document.getElementById(id);
card.addEventListener('ui-click', () => (out.value =`${card.heading}: ui-click`));
card.addEventListener('ui-primary-button-click', () => (out.value =`${card.heading}: primary button`));
}
document.querySelector('#product-card-zone-one ui-icon-button').addEventListener('click', () => (out.value ='Zone one: edit button'));
</script><UiProductiveCardclickableheading="Zone one"description="The whole card"onUiClick={open}>
<UiIconButtonslot="actions"label="Edit"onClick={edit}>{editIcon}</UiIconButton>
Click anywhere but the edit button.
</UiProductiveCard>
<UiProductiveCardclickableclickZone="three"heading="Zone three"description="The body only"primaryButtonText="Details"onUiClick={open} onUiPrimaryButtonClick={details}>
Only this text is the button.
</UiProductiveCard><ProductiveCardtitle="Zone one"description="The whole card"onClick={open} actionIcons={[{ id:'edit', icon: editIcon, iconDescription:'Edit', onClick: edit }]}>
Click anywhere but the edit button.
</ProductiveCard>
<ProductiveCardclickZone="three"title="Zone three"description="The body only"primaryButtonText="Details"onClick={open} onPrimaryButtonClick={details}>
Only this text is the button.
</ProductiveCard>
Disabled
disabled only announces the card as disabled (aria-disabled) and stops ui-click; it doesn't grey anything out, as in Carbon. Disable the buttons with primary-button-disabled and secondary-button-disabled, and say in the card why it can't be used.
The legal department is updating the interest clauses.
HTMLReactReact + Tailwind<ui-productive-cardclickabledisabledheading="Loan contract template"description="Being revised until 15 October"primary-button-text="Use template"primary-button-disabledstyle="max-width: 360px">
The legal department is updating the interest clauses.
</ui-productive-card><UiProductiveCardclickabledisabledheading="Loan contract template"description="Being revised until 15 October"primaryButtonText="Use template"primaryButtonDisabled>
The legal department is updating the interest clauses.
</UiProductiveCard><ProductiveCarddisabledonClick={open} title="Loan contract template"description="Being revised until 15 October"primaryButtonText="Use template"primaryButtonDisabled>
The legal department is updating the interest clauses.
</ProductiveCard>
Expressive card
ui-expressive-card is for content. Media goes across the top (slot="media", at its own size up to the card's width), a pictogram above the title (slot="pictogram"), and the buttons in the footer: a primary and a secondary button by default. Action icons (slot="actions") are small and sit at the end of the footer.
Check the parties, sign with your one-time code, and download the signed copy.
Pressed:
HTMLReactReact + Tailwind<ui-expressive-cardid="product-card-expressive"label="Guide"heading="Signing a contract online"primary-button-text="Start"secondary-button-text="Later"style="max-width: 360px">
<imgslot="media"alt=""width="360"height="203"src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90'%3E%3Crect width='160' height='90' fill='%23d0e2ff'/%3E%3Cpath d='M66 20h22l10 10v40H66z' fill='%23ffffff'/%3E%3Cpath d='M72 42h20M72 50h20M72 58h12' stroke='%230f62fe' stroke-width='2'/%3E%3C/svg%3E" />
<ui-icon-buttonslot="actions"label="Save for later"><svgviewBox="0 0 16 16"><pathd="M12 2v12.2l-3.5-2.6-.5-.4-.5.4L4 14.2V2h8m0-1H4a1 1 0 0 0-1 1v14l5-3.7 5 3.7V2a1 1 0 0 0-1-1Z" /></svg></ui-icon-button>
Check the parties, sign with your one-time code, and download the signed copy.
</ui-expressive-card>
<p>Pressed: <outputid="product-card-expressive-out">nothing yet</output></p>
<scripttype="module">
const card = document.getElementById('product-card-expressive');
const out = document.getElementById('product-card-expressive-out');
card.addEventListener('ui-primary-button-click', () => (out.value ='Start'));
card.addEventListener('ui-secondary-button-click', () => (out.value ='Later'));
</script><UiExpressiveCardlabel="Guide"heading="Signing a contract online"primaryButtonText="Start"secondaryButtonText="Later"onUiPrimaryButtonClick={start} onUiSecondaryButtonClick={later}>
<imgslot="media"alt=""width={360} height={203} src={guideImage} />
<UiIconButtonslot="actions"label="Save for later">{bookmarkIcon}</UiIconButton>
Check the parties, sign with your one-time code, and download the signed copy.
</UiExpressiveCard><ExpressiveCardlabel="Guide"title="Signing a contract online"primaryButtonText="Start"secondaryButtonText="Later"onPrimaryButtonClick={start}
onSecondaryButtonClick={later}
media={<imgalt=""width={360} height={203} src={guideImage} />}
actionIcons={[{ id:'save', icon: bookmarkIcon, iconDescription:'Save for later' }]}
>
Check the parties, sign with your one-time code, and download the signed copy.
</ExpressiveCard>
primary-button-kind takes primary (default) or ghost, secondary-button-kindsecondary (default) or ghost.
Pictogram and media at the start
A pictogram goes above the title, 16px in. media-position="left" puts the media at the start, with the content beside it.
Two-way NDA in Thai and English, approved by the legal department.
Pick the approvers, add a note, and follow the request from your inbox.
HTMLReactReact + Tailwind<ui-expressive-cardheading="Non-disclosure agreement"primary-button-text="Use template"primary-button-kind="ghost"style="max-width: 360px">
<svgslot="pictogram"width="48"height="48"viewBox="0 0 32 32"fill="none"stroke="currentColor"aria-hidden="true"><pathd="M8 3h11l5 5v21H8zM19 3v5h5M12 14h8M12 18h8M12 22h5" /></svg>
Two-way NDA in Thai and English, approved by the legal department.
</ui-expressive-card>
<ui-expressive-cardheading="Asking for an approval"media-position="left"primary-button-text="Read"primary-button-kind="ghost"style="max-width: 560px">
<imgslot="media"alt=""width="180"height="180"src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 90'%3E%3Crect width='90' height='90' fill='%23d0e2ff'/%3E%3Cpath d='M34 20h18l8 8v42H34z' fill='%23ffffff'/%3E%3Cpath d='M40 42h14M40 50h14M40 58h8' stroke='%230f62fe' stroke-width='2'/%3E%3C/svg%3E" />
Pick the approvers, add a note, and follow the request from your inbox.
</ui-expressive-card><UiExpressiveCardheading="Non-disclosure agreement"primaryButtonText="Use template"primaryButtonKind="ghost">
<svgslot="pictogram"width="48"height="48"viewBox="0 0 32 32"fill="none"stroke="currentColor"aria-hidden="true">…</svg>
Two-way NDA in Thai and English, approved by the legal department.
</UiExpressiveCard>
<UiExpressiveCardheading="Asking for an approval"mediaPosition="left"primaryButtonText="Read"primaryButtonKind="ghost">
<imgslot="media"alt=""width={180} height={180} src={approvalImage} />
Pick the approvers, add a note, and follow the request from your inbox.
</UiExpressiveCard><ExpressiveCardtitle="Non-disclosure agreement"primaryButtonText="Use template"primaryButtonKind="ghost"pictogram={documentPictogram}>
Two-way NDA in Thai and English, approved by the legal department.
</ExpressiveCard>
<ExpressiveCardtitle="Asking for an approval"mediaPosition="left"primaryButtonText="Read"primaryButtonKind="ghost"media={<imgalt=""width={180} height={180} src={approvalImage} />}>
Pick the approvers, add a note, and follow the request from your inbox.
</ExpressiveCard>
Clickable expressive card
On an expressive card clickable always makes the whole card the button. Its own buttons stay separate.
Start a new lease from the approved template.
Last press:
HTMLReactReact + Tailwind<ui-expressive-cardid="product-card-pick"clickableheading="Lease contract"description="Property, rent and term"primary-button-text="Preview"primary-button-kind="ghost"style="max-width: 360px">
Start a new lease from the approved template.
</ui-expressive-card>
<p>Last press: <outputid="product-card-pick-out">nothing yet</output></p>
<scripttype="module">
const card = document.getElementById('product-card-pick');
const out = document.getElementById('product-card-pick-out');
card.addEventListener('ui-click', () => (out.value ='card: start a lease'));
card.addEventListener('ui-primary-button-click', () => (out.value ='Preview button'));
</script><UiExpressiveCardclickableheading="Lease contract"description="Property, rent and term"primaryButtonText="Preview"primaryButtonKind="ghost"onUiClick={start} onUiPrimaryButtonClick={preview}>
Start a new lease from the approved template.
</UiExpressiveCard><ExpressiveCardtitle="Lease contract"description="Property, rent and term"primaryButtonText="Preview"primaryButtonKind="ghost"onClick={start} onPrimaryButtonClick={preview}>
Start a new lease from the approved template.
</ExpressiveCard>
Decorator and layers
The decorator slot puts a small element 16px from the top-end corner, for example an AI label or a tag. Both cards draw themselves in the layer colour they sit on, so inside a ui-layer they take the next one.
AI
The lease runs for three years with a 5% yearly increase.
HTMLReactReact + Tailwind<ui-layerlevel="1"with-backgroundstyle="padding: 16px">
<ui-productive-cardheading="Contract summary"description="Generated from 14 pages"style="max-width: 360px">
<ui-tagslot="decorator"type="purple"size="sm">AI</ui-tag>
The lease runs for three years with a 5% yearly increase.
</ui-productive-card>
</ui-layer><UiLayerlevel={1} withBackgroundstyle={{ padding:16 }}>
<UiProductiveCardheading="Contract summary"description="Generated from 14 pages">
<UiTagslot="decorator"type="purple"size="sm">AI</UiTag>
The lease runs for three years with a 5% yearly increase.
</UiProductiveCard>
</UiLayer><Layerlevel={1} withBackgroundclassName="p-4">
<ProductiveCardtitle="Contract summary"description="Generated from 14 pages"decorator={<Tagtype="purple"size="sm">AI</Tag>}>
The lease runs for three years with a 5% yearly increase.
</ProductiveCard>
</Layer>
Keyboard
Key
Does
Tab
Moves through the click zone and the card's own buttons and links, in page order
Enter, Space
Presses the click zone or the focused button
Accessibility
The title is a real heading (<h2> by default). Set heading-level so the page outline stays right.
The click zone is a <button> named by the title (else the label, else the body) and described by the description.
disabled only sets aria-disabled: the card looks the same, so say why it can't be used.
Each action icon needs a label; it is the button's name and tooltip.
The media and pictogram are decorative unless you give them a real alt or name.