Skip to content
SGDS is a frontend framework that aims to provide a beautiful common visual language and user experience for visitors of Singapore Government websites.
JavaScript HTML CSS Vue Ruby Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
_data
_includes
_layouts
apps/src
assets
build
collections
contents
search
sgds
.gitignore
.snyk
404.html
CHANGELOG.md
Dockerfile
Gemfile
Gemfile.lock
LICENSE
README.md
_compress_images_cache.yml
_config.yml
index.html
netlify.toml
package-lock.json
package.json
version
webpack.config.js

README.md

Singapore Government Design System

npm

SGDS is a frontend framework that aims to provide a beautiful common visual language and user experience for visitors of Singapore Government websites. It provides designers and developers with customisable components to help them easily implement the Singapore Government's Digital Service Standards.

Installation

Browsers

CSS

<head>
    ...
    <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/sgds-govtech@1.3.5/css/sgds.css"
    />
    ...
</head>

JavaScript

Certain components of SGDS makes use of sgds.js, with jQuery as an external dependency. If you only need the visual parts of SGDS, or if you are using frontend frameworks like React, you do not need to import this.

<body>
    ...
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sgds-govtech@1.3.5/js/sgds.js"></script>
    ...
</body>
JavaScript components
  • Mandatory
    • Main Nav
    • Side Nav
  • General
    • Accordions
    • Dropdowns
    • Tabs

For more information, please refer to the documentation.

NPM

$ npm i sgds-govtech

Webpack

import "sgds-govtech/css/sgds.css";
import "sgds-govtech/js/sgds"; // Do not use with other web frameworks*
Frontend frameworks

Usage with frameworks such as React, Vue or Angular is discouraged since they manipulate the DOM in their own environments. Framework-specific implementations are in early development and can be found at sgds-govtech-react and sgds-govtech-vue.

Usage

See docs.

Development

Requirements

  • Ruby & Bundler. Install Jekyll and dependencies through bundle install
  • Nodejs & NPM. Install webpack and dependencies through npm install

To spin up a live-reloading Jekyll + Webpack development server it is recommended that you use two separate terminal sessions so that you can kill any of them easily:

# Terminal 1
$ npm run dev:static
# Terminal 2
$ npm run dev:jekyll # Access from localhost:4000

Development Build Build Status

Test out the latest development build:

<!-- CSS in <head> -->
<link rel="stylesheet" href="https://dev.designsystem.gov.sg/css/sgds.css"/>

<!-- JS in <body> -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://dev.designsystem.gov.sg/js/sgds.js"></script>

Patch Notes

See Changelog

You can’t perform that action at this time.