Skip to content

DataCards

The same records as DataList, as cards in a grid: when each one has a picture or reads better as a whole. One column on phones.

import { DataCards, DataCardsSkeleton } from '@sypnia/ui/react'

On this page
  1. Team members
  2. Skeleton
  3. When to use it
  4. For everyone
  5. Props

Team members

  • ARAna Ruizana@laespiga.co
    Role
    Owner
    Projects
    4
    Member since
    Mar 2026
  • BCBo Chenbo@laespiga.co
    Role
    Developer
    Projects
    3
    Member since
    May 2026
  • LGLucía Gómezlucia@laespiga.co
    Role
    Viewer
    Projects
    1
    Member since
    Oct 2026
  • DMDiego Moradiego@laespiga.co
    Role
    Developer
    Projects
    2
    Member since
    Nov 2026
Code
import { Avatar, Badge, DataCards, RowActions } from '@sypnia/ui/react';

// The same records as DataList, as cards: each person reads better as a whole, with a picture.
const people = [
  { id: 1, name: 'Ana Ruiz', email: 'ana@laespiga.co', role: 'Owner', projects: 4, since: 'Mar 2026' },
  { id: 2, name: 'Bo Chen', email: 'bo@laespiga.co', role: 'Developer', projects: 3, since: 'May 2026' },
  { id: 3, name: 'Lucía Gómez', email: 'lucia@laespiga.co', role: 'Viewer', projects: 1, since: 'Oct 2026' },
  { id: 4, name: 'Diego Mora', email: 'diego@laespiga.co', role: 'Developer', projects: 2, since: 'Nov 2026' },
];
export default function Members() {
  return (
    <DataCards label="Team members" rows={people} rowKey={(p) => p.id} min="14rem"
      media={(p) => <Avatar name={p.name} size="lg" />} title={(p) => p.name} description={(p) => p.email}
      fields={[
        { id: 'role', label: 'Role', value: (p) => <Badge tone={p.role === 'Owner' ? 'light' : 'neutral'}>{p.role}</Badge> },
        { id: 'projects', label: 'Projects', numeric: true, value: (p) => p.projects },
        { id: 'since', label: 'Member since', value: (p) => p.since },
      ]}
      actions={(p) => <RowActions label={`Actions for ${p.name}`} actions={[{ id: 'role', label: 'Change role', icon: 'role', onAction: () => {} }, { id: 'remove', label: 'Remove from the team', icon: 'user-minus', danger: true, onAction: () => {} }]} />} />
  );
}

Skeleton

Code
import { DataCardsSkeleton } from '@sypnia/ui/react';

// The cards while they load: the same grid, the same fields.
export default function Skeleton() {
  return <DataCardsSkeleton items={3} fields={3} media min="14rem" />;
}

When to use it

Use it when

  • People, products, projects with an image.
  • Set min to the narrowest a card reads well.

Do not use it when

  • Records compared column by column: use Table.

For everyone

  • It is a list of records; each fact is a term and its value.
  • One action stays in the corner of the card; several go under it.

Props

DataCardsTypeDefault
fieldsrequired

The facts of each record, by name.

DataField<Row>[]
labelrequired

A name for screen readers.

string
rowKeyrequired (row: Row) => string | number
rowsrequired Row[] | undefined
titlerequired

The name of each record: the first thing read.

(row: Row) => ReactNode
actions

What can be done to each record (RowActions).

((row: Row) => ReactNode)
description

A second line under the name.

((row: Row) => ReactNode)
empty

What to say when there are none.

ReactNode
href

With it each record is a link.

((row: Row) => string)
loading

The records are on their way: skeletons of the same shape.

boolean
media

Something at the start of each record: an Avatar, an icon.

((row: Row) => ReactNode)
min

The narrowest a card gets before the grid has one column fewer.

string 16rem
pageSize number 12
DataCardsSkeletonTypeDefault
description boolean true
fields number 3
items number 3
media boolean
min string 16rem
  1. Team members
  2. Skeleton
  3. When to use it
  4. For everyone
  5. Props

    Search pages, sections and terms