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.jsonGuidelines
- Radius 22, padding 24. Inner elements use radius 14 (concentric).
flatremoves the shadow;insetsits on surface-2 inside another card.
Props
| Prop | Type | Required |
|---|---|---|
title | React.ReactNode | No |
subtitle | React.ReactNode | No |
actions | React.ReactNode | No |
variant | 'default' | 'flat' | 'inset' | No |
as | keyof React.JSX.IntrinsicElements | No |
className | string | No |
style | React.CSSProperties | No |
children | React.ReactNode | No |