Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 08 Layout

Card

A surface that groups related content: a summary, a list, a form. Cards are flat, with a thin border; shadows are kept for things that float, like menus and dialogs.

Use it in Angular
import { CardComponent } from '@okaapi-ui/angular';

With a title

Set the heading level so the title fits the page: level 2 under the page title, level 3 inside a section.

Order #1042

2 items · 340 EGP

Paid
Angular
<ui-card title="Order #1042">
  <p>2 items · 340 EGP</p>
  <ui-badge variant="success">Paid</ui-badge>
</ui-card>

Roomy

More padding, for a card that stands alone on a page.

Today

18 orders, 3 still in the kitchen.

Angular
<ui-card title="Today" padding="lg" [level]="2">
  <p>18 orders, 3 still in the kitchen.</p>
</ui-card>

In Arabic

طلب رقم ١٠٤٢

صنفين · ٣٤٠ جنيه

Angular
<ui-card title="طلب رقم ١٠٤٢">
  <p>صنفين · ٣٤٠ جنيه</p>
</ui-card>

When to use something else

If you needUse
Separate two groups with a line onlyDivider
Label and value pairs, such as order detailsProperty list
One number and how it changedStat

Inputs

NameTypeDefaultWhat it does
titlestring — Optional heading at the top of the card.
level2 | 3 | 43The heading level of the title.
padding'md' | 'lg''md'1.5rem or 2rem inside the border.

Keyboard and screen readers

  • A card with a heading reads as its own part of the page; give it one when it stands alone.