A list row that is unread, with its date at the end
Never draw an unread dot, a bold title or a trailing date by hand. Item unread sets the accent dot in the row's start gutter and the title in the strong weight, and tells a reader "Unread" (unreadLabel in another language); read and unread rows lay out alike. ItemEnd holds a date, a count or an avatar at the row's end, on one line: on a phone the title is cut instead. A value that warns (failed, overdue) is ItemText variant="destructive" in ItemActions.
Show the code27 lines
TSX
import { Card } from '@/components/ui/goop/card';
import { CardList } from '@/components/ui/goop/card-list';
import {
Item,
ItemContent,
ItemDescription,
ItemEnd,
ItemOverlay,
ItemTitle,
} from '@/components/ui/goop/item';
<Card variant="outline">
<CardList aria-label="Updates" empty={{ title: 'No updates yet' }}>
<Item asChild unread>
<li>
<ItemOverlay asChild>
<a href="/updates/41" aria-labelledby="update-41" />
</ItemOverlay>
<ItemContent>
<ItemTitle id="update-41">Tags vanish after a sync on tablets</ItemTitle>
<ItemDescription>Bilal Rashed commented on FW-121</ItemDescription>
</ItemContent>
<ItemEnd>2h</ItemEnd>
</li>
</Item>
</CardList>
</Card>;