Card News
A content-update card that surfaces an editorial or clinical update with metadata tags, a date, a cover image, a specialty tag, a title, a description, a reviewer and action buttons.
Examples
Unread
The default state of the card. When isRead is absent or false, the card renders with a secondary (green) border and background to draw the user’s attention to new content. The chips and buttons are composed with the existing Tag and Button components.
Preview
A SBC publicou nova diretriz com mudanças no manejo da IC com fração de ejeção reduzida. Inclusão de iSGLT2 (dapagliflozina, empagliflozina) como pilar de primeira linha junto a IECA/BRA-i, betabloqueador e antagonista mineralocorticoide.
Read
Pass isRead to switch the card to a neutral palette (gray border and surface background), signalling the user has already seen this content.
Preview
A SBC publicou nova diretriz com mudanças no manejo da IC com fração de ejeção reduzida. Inclusão de iSGLT2 (dapagliflozina, empagliflozina) como pilar de primeira linha junto a IECA/BRA-i, betabloqueador e antagonista mineralocorticoide.
Compact
Use variant="compact" for compact contexts like sidebars or modals where the card needs tighter padding and a more rounded border. Override the background via className when the surface color needs to match the container (e.g. className="bg-gray-background-soft-muted" inside a modal).
Preview
Diretriz Brasileira de Insuficiência Cardíaca 2024 — SBC
A SBC publicou nova diretriz com mudanças no manejo da IC com fração de ejeção reduzida. Inclusão de iSGLT2 como pilar de primeira linha.
Horizontal
Use orientation="horizontal" to lay the card out as two columns: CardNewsBody (all the content) on the left and CardNewsImage on the right. The image stretches to match the content height and is hidden automatically when the screen is too narrow to fit it.
Preview
Diretriz Brasileira de Insuficiência Cardíaca 2024 — SBC
A SBC publicou nova diretriz com mudanças no manejo da IC com fração de ejeção reduzida.
API
Structure
| Component | Description | Usage |
|---|---|---|
| CardNews | Root container with border, rounded corners and spacing | Wraps all card content. Use orientation and variant to change layout and palette. |
| CardNewsBody | Left-column wrapper that holds all content in horizontal layouts | Used with orientation="horizontal" as the left column (flex-1 flex-col gap-6 min-w-0); place CardNewsHeader, CardNewsContent and CardNewsFooter inside, with CardNewsImage as its sibling on the right. |
| CardNewsHeader | Top row that spreads tags and date apart | Holds CardNewsTags on the left and CardNewsDate on the right |
| CardNewsTags | Wrapping flex row for metadata chips | Place one or more Tag components inside; they wrap on narrow widths |
| CardNewsDate | Date label with a leading icon | Renders a Calendar icon by default plus the date passed as children |
| CardNewsImage | Cover image with a neutral fallback background | Renders a lazy-loaded img when src is set, otherwise its children |
| CardNewsContent | Column wrapper for the specialty tag, title, description and author | Groups the main body with consistent 8px spacing |
| CardNewsTitle | Primary title, clamped to 2 lines | Main heading of the update |
| CardNewsDescription | Body text, clamped to 3 lines | Short summary of the update |
| CardNewsResources | Labeled row of lesson-content pill buttons | Pass a label and place one or more CardNewsResourceItem inside; they wrap on narrow widths |
| CardNewsResourceItem | Small outlined button representing a lesson content item | Wraps Button with variant="outlined" and size="sm" fixed; pass iconLeft and children like a regular Button |
| CardNewsAuthor | Reviewer block: avatar, role and name | Pass src, name and role; falls back to initials when there is no image. Accepts children to fully override. |
| CardNewsFooter | Wrapping action row | Place Button components inside; they wrap on narrow widths |
CardNews
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | ”default” | “read” | “compact" | "default” | Controls the card’s border color, background and padding. "default" uses the secondary palette (green border and tinted background) to highlight new content. "read" switches to a neutral palette (white background, gray border) to signal the content has already been seen. "compact" uses white background with tighter padding and rounded-xl for dense contexts like sidebars or modals. |
| orientation | ”vertical” | “horizontal" | "vertical” | "horizontal" lays the card out as two fixed columns: CardNewsBody on the left and CardNewsImage on the right. The image uses its horizontal sizing (w-[482px], stretches to content height) and is hidden below lg when there isn’t room for it, leaving the content full-width. |
| isRead | boolean | false | Shorthand for variant="read". Switches the card to a neutral gray palette (white background, gray border) to indicate the content has already been read. |
| …props | React.ComponentProps<“div”> | - | All native div props are supported. |
CardNewsBody
CardNewsBody accepts all native div props plus className. It renders a flex-1 flex-col gap-6 min-w-0 container — no additional props beyond ...ComponentProps<"div">.
CardNewsDate
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | React.ReactNode | <Calendar /> | Leading icon rendered before the date. |
| children | React.ReactNode | - | The date text (e.g. “May 17, 2026”). |
| …props | React.ComponentProps<“div”> | - | All native div props are supported. |
CardNewsImage
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | - | Image URL. When omitted, the placeholder background (or children) is shown. |
| alt | string | "" | Alternative text for the image. |
| children | React.ReactNode | - | Fallback content rendered when src is not provided. |
| …props | React.ComponentProps<“div”> | - | All native div props are supported. |
CardNewsResources
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Secondary label rendered above the button row (e.g. “Lesson items being updated”). Required. |
| children | React.ReactNode | - | One or more CardNewsResourceItem components. |
| …props | React.ComponentProps<“div”> | - | All native div props are supported. |
CardNewsResourceItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | Button label text. |
| …props | ButtonProps | - | All Button props are supported (e.g. iconLeft). variant="outlined" and size="sm" are set by default. |
CardNewsAuthor
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | - | Avatar image URL. Falls back to the author’s initials when omitted. |
| alt | string | name | Alternative text for the avatar image. |
| name | string | - | Reviewer name, shown in semibold. Also drives the initials fallback. |
| role | string | - | Reviewer role, shown above the name. |
| children | React.ReactNode | - | Overrides the default avatar + text layout entirely. |
| …props | React.ComponentProps<“div”> | - | All native div props are supported. |