sgds-components-card
SGDS Card Component Skill
<sgds-card> is a general-purpose content card supporting images, icons, titles, descriptions, and a footer link area. For image-forward cards with overlays use <sgds-image-card>; for icon-led cards use <sgds-icon-card>; for thumbnail cards use <sgds-thumbnail-card>.
Prerequisites
See sgds-components-setup for installation and framework integration (React 19+ vs React ≤18, Vue, Angular).
No CSS styling modifications — custom properties and CSS parts are not exposed on this component.
Quick Decision Guide
Which card type?
- General content with image or icon →
<sgds-card>(this component) - Image-forward with badge/action overlays →
<sgds-image-card> - Icon-led vertically centered layout →
<sgds-icon-card> - Small thumbnail image beside content →
<sgds-thumbnail-card>
Orientation?
- Image/icon stacked above content →
vertical(default) - Image/icon beside content →
horizontal
Entire card clickable?
- Add
stretchedLink— the href is sourced automatically from the<a>inside thefooterslot
Image adjustment?
- Default image sizing →
imageAdjustment="default"(default) - Padding around image →
imageAdjustment="padding around" - Fixed aspect ratio →
imageAdjustment="aspect ratio"
<!-- Basic image card -->
<sgds-card>
<img slot="image" alt="Description" src="image.jpg" />
<span slot="subtitle">SUBTITLE</span>
<span slot="title">Card Title</span>
<span slot="description">Some descriptive text about this card.</span>
<sgds-link slot="footer">
<a href="/page">Go somewhere <sgds-icon name="arrow-right"></sgds-icon></a>
</sgds-link>
</sgds-card>
<!-- Icon card variant (icon instead of image) -->
<sgds-card>
<sgds-icon slot="icon" name="placeholder" size="3-xl"></sgds-icon>
<span slot="subtitle">SUBTITLE</span>
<span slot="title">Icon Card</span>
<span slot="description">Card with an icon instead of an image.</span>
<sgds-link slot="footer">
<a href="/page">Go somewhere <sgds-icon name="arrow-right"></sgds-icon></a>
</sgds-link>
</sgds-card>
<!-- Horizontal orientation -->
<sgds-card orientation="horizontal">
<img slot="image" alt="Description" src="image.jpg" />
<span slot="title">Horizontal Card</span>
<span slot="description">Image is placed beside the content.</span>
<sgds-link slot="footer"><a href="#">Read more</a></sgds-link>
</sgds-card>
<!-- Stretched link — entire card is clickable -->
<sgds-card stretchedLink>
<img slot="image" alt="Description" src="image.jpg" />
<span slot="title">Clickable Card</span>
<span slot="description">Clicking anywhere on the card navigates to the footer link.</span>
<sgds-link slot="footer"><a href="/destination">Go somewhere</a></sgds-link>
</sgds-card>
<!-- Disabled state -->
<sgds-card disabled>
<img slot="image" alt="Description" src="image.jpg" />
<span slot="title">Disabled Card</span>
<span slot="description">This card is not interactive.</span>
</sgds-card>
<!-- Tinted background -->
<sgds-card tinted>
<span slot="title">Tinted Card</span>
<span slot="description">Card with a tinted background.</span>
</sgds-card>
API Summary
| Attribute | Type | Default | Purpose |
|---|---|---|---|
orientation |
vertical | horizontal |
vertical |
Image/icon above or beside content |
stretchedLink |
boolean | false |
Makes entire card a link; href sourced from footer slot anchor |
disabled |
boolean | false |
Applies disabled styling |
hideBorder |
boolean | false |
Removes the card border |
tinted |
boolean | false |
Applies a tinted background |
imagePosition |
before | after |
before |
Image position relative to content |
imageAdjustment |
default | padding around | aspect ratio |
default |
How the image fills its container |
Slots
| Slot | Purpose |
|---|---|
image |
Image or SVG element (single element only) |
icon |
Icon element (single element only; used when no image) |
upper |
Above subtitle; overrides the image/icon area |
menu |
Overflow/contextual menu (top-right corner) |
subtitle |
Subtitle text |
title |
Card title |
description |
Descriptive paragraph text |
| (default) | Additional content below the description |
lower |
Content below description (badges, metadata) |
footer |
Footer area — place <sgds-link> here for the card CTA |
link |
Deprecated since 3.3.2 — use footer instead |
Events
None.
For AI agents:
- Always place the card CTA in the
footerslot using<sgds-link>— thelinkslot is deprecated since 3.3.2. - For
stretchedLink, the href is sourced from the<a>tag inside thefooterslot — nohrefon the card itself. - Use
imageslot for images,iconslot for icons — they are mutually exclusive in layout; using both may produce unexpected results. imageAdjustment="aspect ratio"andimageAdjustment="padding around"are string values with spaces — pass them exactly.- For specific card types (image-focused, icon-focused, thumbnail), prefer
<sgds-image-card>,<sgds-icon-card>, or<sgds-thumbnail-card>respectively. - There are no custom events or public methods on this component.
More from govtechsg/sgds-web-component
sgds-components
Complete reference for all SGDS web components including installation and framework integration. Use when users ask about any <sgds-*> component — accordion, alert, badge, breadcrumb, button, card, checkbox, close-button, combo-box, datepicker, description-list, divider, drawer, dropdown, file-upload, footer, icon, icon-button, icon-card, icon-list, image-card, input, link, mainnav, masthead, modal, overflow-menu, pagination, progress-bar, quantity-toggle, radio, select, sidebar, sidenav, skeleton, spinner, stepper, subnav, switch, system-banner, tab, table, table-of-contents, textarea, thumbnail-card, toast, or tooltip. Also covers React 19+, React ≤18, Vue, Angular, and Next.js integration.
58sgds-theming
Customising the visual theme of an SGDS application — product brand colours, day/night mode, and font. Use when users ask about changing the primary colour, theming their app, enabling dark mode, night mode, overriding CSS tokens, or customising the font. Apply this skill whenever theming, branding, or CSS token overrides are mentioned.
55sgds-workflow
ALWAYS use this skill when building UI with @govtechsg/sgds-web-component or when a user mentions SGDS or Singapore Design System — even if they don't explicitly ask for help. This is the mandatory entry point for all SGDS development: it guides you to the right skill for setup, components, utilities, forms, theming, page layouts, block templates, and data visualisation. Read this before writing any SGDS application code.
53sgds-data-visualisation
Use this skill when users ask about data visualisation, charts, graphs, or dashboards in an SGDS application. Covers ECharts setup and applying the SGDS colour palette to charts.
53sgds-forms
Use this skill when users ask about form validation in SGDS, hasFeedback prop, constraint validation, custom validation, noValidate, setInvalid, form submission, or reading FormData from SGDS form components.
53sgds-getting-started
Starting point for any new application built with the SGDS web component library. Apply this skill first whenever a user is bootstrapping a new SGDS project, setting up a new app, or asking where to begin with SGDS. Covers font setup, foundation CSS, utilities, components, and app layout in the correct order.
53