sgds-components
Complete reference for all SGDS web components including installation. Use when users ask about any <sgds-*> component — accordion, alert, badge, breadcrumb, button, card, checkbox, close-button, combo-box, data-table, 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. For framework integration (React, Next.js, Vue, Angular), see sgds-getting-started.
How do I install this agent skill?
npx skills add https://github.com/govtechsg/sgds-web-component --skill sgds-componentsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill is a comprehensive documentation reference for the Singapore Design System (SGDS) web components. It provides installation guides, component usage, and API references. No security issues were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
SGDS Components Setup Skill
Prerequisites and framework integration for using <sgds-*> web components.
Installation
npm install @govtechsg/sgds-web-component
# or
pnpm add @govtechsg/sgds-web-component
Import the library once at your app entry point:
import "@govtechsg/sgds-web-component";
Framework Integration
For React, Next.js, Vue, and Angular integration, see sgds-getting-started Step 3.
Troubleshooting Component Behaviour
When a component behaves unexpectedly — wrong event fired, property not reflected, slot not rendering — read the compiled source directly. It contains full method bodies, event logic, internal defaults, and edge-case handling that no documentation captures.
Read from node_modules/@govtechsg/sgds-web-component — this directory is present once the package is installed:
node_modules/@govtechsg/sgds-web-component/components/Accordion/sgds-accordion.js
node_modules/@govtechsg/sgds-web-component/components/Accordion/sgds-accordion-item.js
node_modules/@govtechsg/sgds-web-component/components/Accordion/sgds-accordion.d.ts
Replace Accordion/sgds-accordion with the relevant component folder and file name. The .js file contains the full implementation; the .d.ts file lists all properties, types, events, slots, and JSDoc descriptions.
If node_modules is absent — the package has not been installed. Ask the user to run their normal install step (npm install / pnpm install) before inspecting source files.
For AI agents: For framework-specific setup (React, Next.js, Vue, Angular), see the reference files in sgds-getting-started.
When a user reports unexpected component behaviour (wrong event, property not reflecting, slot not rendering), direct them to read the compiled source before trying anything else — see the Troubleshooting Component Behaviour section above.
Global rule — never set explicit widths on SGDS components. Do not add width, style="width: ...", or fixed-width utility classes (e.g. sgds:w-40) directly on any <sgds-*> element. Width is controlled by the parent layout — use flex, grid, or wrapper divs to constrain it. The only exception is when a user explicitly requests a fixed width.
Available Components
Form Input Components
When building forms, use these 9 form input components to capture user data:
<sgds-input>— text fields<sgds-textarea>— multi-line text<sgds-select>— dropdown selection<sgds-checkbox>/<sgds-checkbox-group>— multiple choice<sgds-radio>/<sgds-radio-group>— single choice<sgds-combo-box>— searchable select<sgds-datepicker>— date input<sgds-file-upload>— file picker<sgds-quantity-toggle>— numeric counter
DO NOT use in forms (these are feedback/state, not input):
<sgds-switch>— This is a feedback component (displays toggle state), not a form input. Use<sgds-checkbox>or<sgds-radio-group>to collect user choice instead.- Other non-input components (Alert, Badge, Button, Card, etc.) — These are layout/feedback, not form controls.
For form layout patterns (field pairing, spacing, width constraints, multi-step forms with <sgds-stepper>, header hierarchy), see the sgds-blocks form layout skill.
| Feedback | Alert | → reference/alert.md |
| Feedback | Spinner | → reference/spinner.md |
| Feedback | Skeleton | → reference/skeleton.md |
| Feedback | Progress Bar | → reference/progress-bar.md |
| Feedback | Toast | → reference/toast.md |
| Feedback | System Banner | → reference/system-banner.md |
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/govtechsg/sgds-web-component/sgds-components">View sgds-components on skillZs</a>