DocsComponentsTemplatesThemesGitHub

Card

Content container on surface with optional title, subtitle and header actions.

Code

import * as React from 'react';
import { Button, Card, Progress } from '@fruit-labs/design';

export default function Demo() {
  return (
    <Card
      title="Storage"
      subtitle="84 GB of 128 GB used"
      actions={
        <Button size="sm" variant="gray">
          Manage
        </Button>
      }
      style={{
        maxWidth: 420,
      }}
    >
      <Progress value={66} />
    </Card>
  );
}

With actions

import { Button, Card } from '@fruit-labs/design';

export default function Example() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 560 }}>
      <Card title="Team plan" subtitle="8 of 10 seats used" actions={<Button size="sm" variant="tinted">Upgrade</Button>}>
        Renews on 1 June.
      </Card>
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { Card } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/card.json

Guidelines

  • Radius 22, padding 24. Inner elements use radius 14 (concentric).
  • flat removes the shadow; inset sits on surface-2 inside another card.

Props

PropTypeRequired
titleReact.ReactNodeNo
subtitleReact.ReactNodeNo
actionsReact.ReactNodeNo
variant'default' | 'flat' | 'inset'No
askeyof React.JSX.IntrinsicElementsNo
classNamestringNo
styleReact.CSSPropertiesNo
childrenReact.ReactNodeNo

Edit this example on GitHub