HTML & CSS
SGDS library is built on Bootstrap 5, it offers CSS styles directly applied to HTML elements and CSS tokens for modular customisation.
Step 1: Install SGDS library
@govtechsg/sgds uses bootstrap-icons for certain components like Form but it is not ship with it. Install bootstrap-icons or use CDN if you need it. Please refer to bootstrap-icons for usage instructions.
Method 1: Local installation
Import SGDS style library and bootstrap icons in your entry point
If you plan to use components that require interactions e.g. accordion and tooltips, you would need to import the javascript file from bootstrap library, as shown below, on top of the SGDS style library.
Method 2: Using CDN
Include this code into your applications index.html to load the SGDS style library and the javascript file
Step 2: Start building your application
There are ready made components, patterns, layouts and templates to use. You may refer to the components page, patterns page, layouts page or templates page to copy the relevant HTML & CSS code.
Last updated 28 May 2024