skills/sgds-templates/SKILL.md
Complete ready-to-use page templates built with SGDS components and utilities. Use this skill whenever a user asks to build a page, dashboard, login page, form page, settings page, list page, or any full-page UI — even if they don't say 'template'. Apply when starting a new app, building internal tools, dashboards, admin portals, authentication flows, or data table views.
npx skillsauth add govtechsg/sgds-web-component sgds-templatesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ready-to-use full-page templates using SGDS components and utilities — adapted from the visual patterns of shadcn Blocks. Each template gives a beautiful starting point without writing layout code from scratch.
Every page must include the Application Shell. Read sgds-blocks → reference/application-shell.md before generating any page. The shell provides mandatory
<sgds-masthead>,<sgds-mainnav>, and<sgds-footer>on every page, plus container class selection (.sgds-containervs.sgds-container-sidebar) and sticky-header conventions. Never generate a page template without all three shell components.
import "@govtechsg/sgds-web-component/themes/day.css";
import "@govtechsg/sgds-web-component/css/sgds.css";
import "@govtechsg/sgds-web-component/css/utility.css";
See sgds-getting-started and sgds-components for full installation.
For container width and max-width utilities used in these templates, see sgds-utilities.
| What you're building | Template to use | |---|---| | Admin dashboard with filters & data table | Application Management | | Public catalogue with search & filtering | Catalogue / Search & Filter | | Internal tool, admin portal, analytics dashboard | Dashboard | | Login / sign-in page | Login | | Multi-field settings or data-entry form | Form Page | | Company/agency profile, team intro, achievements | About Us | | Product or service landing page | Landing Page | | Blog post, news article, or case study | Blog / Content Page |
Sidebar filters + search + data table + pagination. Use for admin dashboards, application registries, management portals.
Search + sidebar multi-group filters + sort dropdown + results grid + empty state. Use for product catalogues, event listings, content browsing.
Sidebar navigation + stat cards row + data table. Use for dashboards, admin portals, internal tools with metrics.
Note: The dashboard template uses
sgds-sidebar(RC component). Load the CDN script before other SGDS imports — see sgds-components sidebar reference for the CDN tag and framework setup.
Centered card with email/password form. Use for authentication, sign-in, sign-up pages.
Two-column settings layout with labelled form sections. Use for settings pages, profile pages, multi-section data entry.
Two-column headline + image grid + logo strip + achievements stats panel. Use for agency profiles, product about pages, team introductions.
Hero section + feature cards + CTA sections. Use for product launches, service introductions, campaign pages.
Featured image + article header + body content + author card. Use for blog posts, news articles, case studies, testimonials.
All page templates have working implementations in the stories/templates/ directory. Use these raw GitHub links to fetch the complete source:
| Template | Story Folder | Story File | Raw URL | |---|---|---|---| | Application Management | ApplicationManagement | applications-list.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/ApplicationManagement/applications-list.stories.js | | Catalogue / Search & Filter | Catalogue | search-filter.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Catalogue/search-filter.stories.js | | Dashboard | ApplicationManagement | applications-list.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/ApplicationManagement/applications-list.stories.js | | About Us | AboutUs | basic.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/AboutUs/basic.stories.js | | Form - Basic | Form | basic.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Form/basic.stories.js | | Form - Multi-Step | Form | multi-step-form.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Form/multi-step-form.stories.js | | Form - Report Issue | Form | report-issue.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Form/report-issue.stories.js | | Blog / Content | Blog | success-story.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Blog/success-story.stories.js | | Landing Page | Landing | basic.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Landing/basic.stories.js | | Login | Form | basic.stories.js | https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/Form/basic.stories.js |
Each reference page (e.g., reference/dashboard.md) includes the relevant raw content links for that specific template.
All templates have working story implementations in the stories/templates/ directory. To extract the HTML template:
Copy the raw GitHub URL from the table above and fetch it:
curl https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/{FOLDER}/{FILE}.js
Example:
curl https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/AboutUs/basic.stories.js
Story files export a Template function that returns an html template literal. Locate the section that looks like:
const Template = () => html`
<!-- YOUR HTML STARTS HERE -->
<sgds-masthead></sgds-masthead>
...
<sgds-footer></sgds-footer>
<!-- YOUR HTML ENDS HERE -->
`;
html\`` wrapper** — delete the leading html`` and trailing closing backtick${variable} interpolations; replace with placeholder text if needed<style> blocks — move CSS to the reference file's "Customisation notes" section if notablesgds-* element and sgds: class exactly as-isFollow the sgds-blocks pattern:
# [Template Name] Page Template
[1-2 sentence description of what this template is for]
## When to use
- Use case 1
- Use case 2
- Use case 3
## Block anatomy
\`\`\`
[ASCII diagram of the layout structure]
\`\`\`
---
## Complete template
\`\`\`html
[CLEANED HTML FROM STEP 3]
\`\`\`
## Customisation notes
- Update [element] to [purpose]
- Modify [component] by [how]
- [More notes...]
---
## Raw Content Link
| File | GitHub Raw URL |
|------|---|
| [Template Name] | [raw GitHub URL] |
The raw file at:
https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/templates/AboutUs/basic.stories.js
Contains:
const Template = () => html`
<style>...</style>
<sgds-masthead></sgds-masthead>
...
`;
Extract → remove html\`` and backtick → clean up <style>` → result is the HTML in reference/about-us.md.
These are the rules that make SGDS UIs look polished — the same principles shadcn/Mantine use:
1. Layer backgrounds to create depth
sgds:bg-surface-default (the base canvas)sgds:bg-surface-raised (lifts content off the page)sgds:bg-surface-overlay sparingly2. Use semantic spacing, not raw numbers
Prefer sgds:p-layout-md, sgds:gap-layout-md, sgds:p-component-md over sgds:p-4. Semantic tokens are responsive and encode intent. Always apply whitespace between sections and elements — never render blocks without spacing. See sgds-utilities-spacing for the full defaults table.
3. Consistent card anatomy
Every card: padding inside (sgds:p-component-lg), gap between card rows (sgds:gap-layout-md), border-radius (sgds:rounded-lg), subtle shadow (sgds:shadow-card).
4. Action hierarchy in forms
Primary action → <sgds-button variant="primary">. Secondary / cancel → <sgds-button variant="outline">. Destructive → <sgds-button variant="ghost" tone="danger">.
5. Subtle labels, prominent values
In stat cards and description lists: label in sgds:text-body-subtle sgds:text-sm, value in sgds:text-default sgds:text-2xl sgds:font-semibold.
tools
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.
testing
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.
tools
Complete catalog of page layout patterns for SGDS applications. Use this skill whenever a user asks about page layouts, content arrangement, aside panels, split views, sidebar layouts, breadcrumb layouts, or viewport-height layouts — even if they just say 'how should I lay out my page' or 'I need a two-column layout'. Covers Full Width layouts (public-facing pages with sgds-container) and With Sidebar layouts (dashboards/internal tools with sgds-container-sidebar). Trigger on: layout, aside, split view, sidebar layout, two-column, three-column, content arrangement, page structure with aside.
development
Complete catalog of reusable typography and text patterns for SGDS applications. Use this skill whenever the user needs to style text, create typography hierarchies, format headings, style lists, or needs consistent text layouts. Also use when the user mentions headings, page titles, body text, lists, paragraphs, display text, content headers, or any typography styling — even if they just say "make a nice heading" or "style my text". Current patterns include headings (H1-H6), display typography (large prominent text), content headers, lists (ordered and unordered), and paragraphs. Each pattern links directly to the raw HTML template for implementation.