@govtechsg/sgds

中文文档
2.3.6发布于 2024/12/18MIT近 30 天下载 1.2万

Design System unites Singapore Government digital services around a common visual language and user experience

原始使用文档
文档目录6 节
  1. Installation
  2. CSS
  3. Vanilla JavaScript
  4. Via NPM
  5. For Webpack
  6. Patch Notes

Singapore Government Design System

npm

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Visit our React storybook Visit our Web Component storybook


Installation

CSS

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

Vanilla JavaScript

SGDS components makes use of bootstrap v5.1.3 js library 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.

@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.

<head>
  ...
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@govtechsg/sgds/css/sgds.css" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
  ...
</head>

<body>
  ...
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
    crossorigin="anonymous"></script>
</body>

For more information, please refer to the components documentation.

Via NPM

$ npm i @govtechsg/sgds bootstrap-icons

For Webpack

//importing css
import '@govtechsg/sgds/css/sgds.css';

import '@popperjs/core';
import * as bootstrap from 'bootstrap';

Patch Notes

See Changelog

版本与发布记录

@govtechsg/sgds 共发布 25 个版本,首次发布于 2022/06/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.3.6latest2024/12/181.9 年前
2.3.52024/09/232 年前
2.3.42024/08/302 年前
2.3.32024/05/312 年前
1.4.2latest-12024/05/302 年前
2.3.22024/05/302 年前

其他发布通道:beta → 2.2.0-beta.1,alpha → 2.3.0-alpha.0,latest-1 → 1.4.2。

关于 @govtechsg/sgds 的常见问题

@govtechsg/sgds 是什么?

Design System unites Singapore Government digital services around a common visual language and user experience

如何安装 @govtechsg/sgds?

在项目目录运行 npm install @govtechsg/sgds,或使用 pnpm add / yarn add / bun add。

@govtechsg/sgds 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/govtechsg__sgds 是否存在。

@govtechsg/sgds 可以商用吗?

@govtechsg/sgds 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@govtechsg/sgds 的下载量有多少?

根据 npm 官方下载统计,@govtechsg/sgds 在 2026/10/17 – 2026/11/15 这 30 天内被下载 12,053 次,日均约 402 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@govtechsg/sgds 还在维护吗?

最新版本 2.3.6 发布于 2024/12/18(1.9 年前);至今共发布 25 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/06/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。