card/01-card-notification
A status-driven card with a badge, body copy, and a footer action. Caller controls read state.
Loading interactive preview
"use client";
import { useState } from 'react';
import { Card } from 'ui-lab-components/card'
import { Button } from 'ui-lab-components/button'
import { Flex } from 'ui-lab-components/flex'
import { Badge } from 'ui-lab-components/badge';
export const metadata = {
title: 'Notification Card',
description: 'A status-driven card with a badge, body copy, and a footer action. Caller controls read state.',
};
export default function Example() {
const [read, setRead] = useState(false);
return (
<Card style={{ width: 360, opacity: read ? 0.6 : 1, transition: 'opacity 0.2s' }}>
<Card.Header>
<Flex justify-between align-center>
<span className="text-foreground-100" style={{ fontFamily: "var(--font-heading)", fontSize: "var(--header-text-sm)", fontWeight: "var(--font-weight-header-medium)", lineHeight: "var(--leading-heading)" }}>Deployment failed</span>
<Badge variant="destructive">Error</Badge>
</Flex>
</Card.Header>
<Card.Body>
<p className="text-foreground-400" style={{ fontFamily: "var(--font-body)", fontSize: "var(--text-body-size)", fontWeight: "var(--font-weight-body-normal)", lineHeight: "var(--leading-body)" }}>
The production deploy of <span className="text-foreground-200">api-gateway</span> failed at step "Run tests". Check the logs for details.
</p>
</Card.Body>
<Card.Footer>
<Flex justify-between align-center>
<span className="text-foreground-500" style={{ fontFamily: "var(--font-body)", fontSize: "var(--text-xs)", fontWeight: "var(--font-weight-body-normal)", lineHeight: "var(--leading-sm)" }}>2 minutes ago</span>
<Button size="sm" variant="ghost" onPress={() => setRead(true)}>
Mark as read
</Button>
</Flex>
</Card.Footer>
</Card>
);
}