A card groups content and actions about one subject. There are three styles: elevated, filled and
outlined. They differ in how much the card stands out from the background, not in what it can
hold.
<scriptlang="ts">import{ Card }from'noph-ui'</script><divclass="cards"style="width:100%;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));"><Cardtype="button"variant="elevated"headline="Elevated"supportingText="Explain more about the topic shown in the headline and subhead through supporting text."image="/pollock.avif"></Card><Cardtype="button"variant="filled"headline="Filled card"supportingText="Explain more about the topic shown in the headline and subhead through supporting text."image="/pollock2.avif"></Card><Cardtype="button"variant="outlined"headline="Outlined card"supportingText="Explain more about the topic shown in the headline and subhead through supporting text."image="/pollock3.avif"></Card></div><style>
.cards {
display: grid;
gap:0.5rem;
grid-template-columns:repeat(auto-fit,minmax(200px, 1fr));}</style>
ElevatedSubheadExplain more about the topic shown in the headline and subhead through supporting text.
Elevated disabledSubheadExplain more about the topic shown in the headline and subhead through supporting text.
Copy code
<scriptlang="ts">import{ Button, Card }from'noph-ui'</script>{#snippet action()}<Buttonvariant="filled">Action</Button>{/snippet}<divclass="cards"><Cardvariant="elevated"headline="Elevated"subhead="Subhead"{action}supportingText="Explain more about the topic shown in the headline and subhead through supporting text."></Card><Cardvariant="elevated"disabledheadline="Elevated disabled"subhead="Subhead"{action}supportingText="Explain more about the topic shown in the headline and subhead through supporting text."></Card></div><style>
.cards {
display: grid;
gap:0.5rem;
grid-template-columns:repeat(auto-fit,minmax(200px, 1fr));}</style>
FilledSubheadExplain more about the topic shown in the headline and subhead through supporting text.
Filled disabledSubheadExplain more about the topic shown in the headline and subhead through supporting text.
Copy code
<scriptlang="ts">import{ Button, Card }from'noph-ui'</script>{#snippet action()}<Buttonvariant="filled">Action</Button>{/snippet}<divclass="cards"><Cardvariant="filled"headline="Filled"subhead="Subhead"{action}supportingText="Explain more about the topic shown in the headline and subhead through supporting text."></Card><Cardvariant="filled"disabledheadline="Filled disabled"subhead="Subhead"{action}supportingText="Explain more about the topic shown in the headline and subhead through supporting text."></Card></div><style>
.cards {
display: grid;
gap:0.5rem;
grid-template-columns:repeat(auto-fit,minmax(200px, 1fr));}</style>
OutlinedSubheadExplain more about the topic shown in the headline and subhead through supporting text.
Outlined disabledSubheadExplain more about the topic shown in the headline and subhead through supporting text.
Copy code
<scriptlang="ts">import{ Button, Card }from'noph-ui'</script>{#snippet action()}<Buttonvariant="filled">Action</Button>{/snippet}<divclass="cards"><Cardvariant="outlined"headline="Outlined"subhead="Subhead"{action}supportingText="Explain more about the topic shown in the headline and subhead through supporting text."></Card><Cardvariant="outlined"disabledheadline="Outlined disabled"subhead="Subhead"{action}supportingText="Explain more about the topic shown in the headline and subhead through supporting text."></Card></div><style>
.cards {
display: grid;
gap:0.5rem;
grid-template-columns:repeat(auto-fit,minmax(200px, 1fr));}</style>
A plain card is a <div>: it holds content and takes no focus. Give it an href or an onclick only when the whole card is one target. It then
renders an <a> or a <button>. A command or popovertarget also makes it a button. Set type to pin the element yourself.
A card that holds its own buttons and links stays a plain card. Inside a clickable card, a screen
reader cannot reach those inner controls, so the props type rejects action together
with href, onclick or a type other than text.
A disabled clickable card keeps aria-disabled and steps out of the tab order.
The image is decorative by default. When it carries meaning, describe it with imageAlt.
A single, unified set of attributes for the rendered element (div, button or a). Event handlers such as onclick receive event.currentTarget typed as HTMLDivElement | HTMLButtonElement | HTMLAnchorElement.