Skip to content

Card and Surface for Angular

AngularLayout

Surface: a bordered, token-colored panel (flat, raised, sunken, optionally padded). Card: a surface with header (title, subtitle), media, body, and footer sections; an <article> named by its title when titled, and an optional block-link mode where the whole card is clickable with a single tab stop.

  • Titled or plainA titled card is an article with a heading at the level you choose.
  • Content areasBody, footer, and media areas take text or any DOM node.
  • Whole-card linkInteractive cards use one native link, so the whole card is clickable.
  • Surface variantsFlat, raised, and sunken surfaces, also available for your own elements.

Behavior, design tokens, and limitations are described on the Card and Surface page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiCard } from '@absoluteui/angular/card';
@Component({
selector: 'app-project-card',
imports: [AuiCard],
template: `<aui-card title="Project Alpha" subtitle="Owner: Ada" content="Launch planned for Q4." [interactive]="{ href: '/projects/alpha' }" [headingLevel]="2"></aui-card>`,
})
export class ProjectCardComponent {}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiCard, AuiCardContent, AuiCardFooter, AuiCardMedia } from '@absoluteui/angular/card';

Defaults for every instance: provideAbsoluteUIConfig({ components: { card: { ... } } }) (see Configuration).

Class AuiCard; template reference #ref="auiCard".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
title string Card heading and the <article>’s accessible name (aria-labelledby). Without a title the card is a <div>.
subtitle string Supporting line under the title (text only).
content string | Node Body content; strings render as text. Omit to fill card.body directly.
footer Node Footer content such as actions or metadata.
media Node Image or illustration, shown above the header while the header stays first in source order.
interactive CardInteractive Block-link mode: the title becomes the only link and its ::after covers the card. Requires title; href must be http(s) or relative.
variant SurfaceVariant 'flat' Surface treatment (Card and Surface.apply).
headingLevel CardHeadingLevel '3' Heading level of the card title; match it to the surrounding outline.
Part Element
content AuiCardContent
footer AuiCardFooter
media AuiCardMedia

Class AuiCardContent.

Server rendering: Renders on the server; the browser re-creates it after hydration.

Class AuiCardFooter.

Server rendering: Renders on the server; the browser re-creates it after hydration.

Class AuiCardMedia.

Server rendering: Renders on the server; the browser re-creates it after hydration.

Pattern: HTML <article> named by its heading; interactive cards use the block-link pattern (Inclusive Components ‘Cards’): one real link on the title, stretched over the card with a pseudo-element.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Card and Surface: Accessibility and performance.