skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
govtechsg/sgds-web-component166 installs

sgds-layouts

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.

How do I install this agent skill?

npx skills add https://github.com/govtechsg/sgds-web-component --skill sgds-layouts
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides a complete catalog of page layout patterns for the Singapore Design System (SGDS). It contains documentation, configuration guides, and references to official design assets without any malicious or risky behaviors.

  • Socketpass

    No alerts

  • Snykwarn

    Risk: MEDIUM · 1 issue

What does this agent skill do?

SGDS Layouts

Production-ready page layout patterns that define how content areas are arranged within the Application Shell. Each layout combines SGDS components and utilities to provide a structural starting point — drop in your content blocks and you have a complete page.

What is a layout?

A layout defines the spatial arrangement of content regions on a page:

  • How many content columns exist (single, split, aside + main)
  • Where navigation lives (top-only vs sidebar)
  • How the page scrolls (document flow vs viewport-contained)

Layouts sit between the Application Shell (mandatory page chrome) and Blocks/Templates (the actual content). The shell wraps the layout; blocks fill the layout's content areas.

Prerequisites

Before implementing any layout, ensure you have:

  1. sgds-getting-started: Initial application setup (Inter font, foundation CSS imports, component registration)
  2. sgds-utilities: Understanding of SGDS utility classes (grid, spacing, flex, etc.)
  3. sgds-components: Knowledge of SGDS web components (masthead, mainnav, footer, sidebar)
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.


Quick Decision Guide

What you're buildingLayout categoryLayout to use
Simple public-facing page, single content areaFull WidthDefault
Page with a left sidebar/aside panel (4/8 split)Full WidthAside Left
Page with a right sidebar/aside panel (8/4 split)Full WidthAside Right
Page with both left and right aside panels (3/6/3)Full WidthAside Both
Two equal content panels side by sideFull WidthSplit
Page with breadcrumb navigation barFull WidthBreadcrumb
Dashboard/internal tool, single content areaWith SidebarDefault
Dashboard with left aside panelWith SidebarAside Left
Dashboard with right aside panelWith SidebarAside Right
Collapsible overlay sidebar with breadcrumbWith SidebarOverlay
Dashboard with two equal content panelsWith SidebarSplit

Two Layout Categories

Full Width — Public-facing pages

For general-purpose applications, public-facing digital services, and pages without persistent side navigation.

Key characteristics:

  • Uses .sgds-container for centred, responsive content
  • Standard <sgds-masthead>, <sgds-mainnav>, <sgds-footer>
  • Content flows with the document (no viewport containment)
  • Grid-based aside panels use .sgds-grid with sgds-col-* classes

→ Read reference/full-width.md for all 6 Full Width layout variants.


With Sidebar — Dashboards and internal tools

For internal tools, dashboards, admin portals, and transactional apps that need persistent side navigation alongside the main content.

Key characteristics:

  • Uses .sgds-container-sidebar for narrower content (accounts for sidebar width)
  • fluid attribute on <sgds-masthead> and <sgds-mainnav>
  • <sgds-sidebar> component for persistent navigation
  • <sgds-footer tone="neutral" layout="sidebar"> for sidebar-aware footer
  • Viewport-height containment: sgds:h-screen sgds:flex sgds:flex-col sgds:overflow-hidden
  • Main content area scrolls independently: sgds:overflow-y-auto

→ Read reference/with-sidebar.md for all 5 With Sidebar layout variants.


How to Extract HTML from Raw GitHub Links

All layouts have working story implementations in the stories/layouts/ directory. To use them:

Step 1: Fetch the raw file

curl https://raw.githubusercontent.com/GovTechSG/sgds-web-component/master/stories/layouts/{Category}/{File}.stories.js

Step 2: Extract the HTML from the template literal

Story files export a Template function that returns an html template literal:

const Template = () => html`
  <!-- YOUR HTML STARTS HERE -->
  <sgds-masthead></sgds-masthead>
  ...
  <sgds-footer></sgds-footer>
  <!-- YOUR HTML ENDS HERE -->
`;

Step 3: Clean the HTML

  1. Remove the `html`` wrapper and trailing backtick
  2. Remove Lit-specific syntax (${variable} interpolations) — replace with inline HTML
  3. Remove <style> blocks (these are just for Storybook placeholders)
  4. Preserve all SGDS components and utility classes exactly as-is
  5. Format with consistent indentation (2 spaces)

For AI agents

Workflow

  1. Load sgds-utilities skill (for utility class reference)
  2. Load sgds-components skill (for component APIs)
  3. Load this skill
  4. Read the appropriate reference file based on the user's needs
  5. Fetch the raw GitHub story file if you need the complete implementation
  6. Adapt the layout to the user's content

Guidelines

  • Every layout includes the mandatory Application Shell (<sgds-masthead>, <sgds-mainnav>, <sgds-footer>)
  • Do not mix Full Width and With Sidebar patterns — pick one based on the use case
  • For sidebar layouts, always include the viewport-containment classes on the root wrapper
  • Populate aside panels and content areas with blocks from sgds-blocks or templates from sgds-templates

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-layouts">View sgds-layouts on skillZs</a>