Browse Foundations

Foundations

Token naming

How SGDS names design tokens — the four-part pattern, the principles behind it, and worked examples for each token type.

Naming convention

SGDS tokens are named in four ordered parts: namespace, object, base, and modifier. Each part narrows the meaning, so a token name reads from the broadest system context down to a specific design attribute. The legend below names each position; the worked example shows how the parts combine for a real token.

1sgds1Namespace
Object2form2
3padding3Base
Modifier4y4
  1. Namespace

    The system name: sgds for the Singapore Government Design System.

  2. Object

    The thing the token applies to: a group like action, a component like btn, or a context like form.

  3. Base

    The design element or property: the role (primary, danger), the property (bg, border, padding), or the concept (heading, body).

  4. Modifier

    The design attribute: emphasis (default, muted, subtle, emphasis), state (hover, focus), or scale (md, lg, 100, 200).

Example breakdown

Primitive token
sgdspurple700
1
3
4
Semantic token
sgdsprimarybgemphasis
1
3
4
Component token
sgdsbtnprimaryhoverbg
1
2
3

Anatomy by token type

Each token type uses the four positions slightly differently. The diagrams below show how primitive, semantic, and component tokens combine namespace, object, base, and modifier.

Primitive token

For primitive tokens, the name usually identifies a foundation scale and a step:

sgdspurple700
sgdsborderwidth1
sgdsiconsizemd
sgdsline-heightbody
Semantic token (simplified)

Names a role, the property it controls, and the emphasis level.

sgdsprimarybgemphasis
sgdsdefaultbgmuted
sgdsprimarybordercolorsubtle
Semantic token (granular)

Adds a context segment, such as form, when the decision is scoped to a specific surface.

sgdsformprimarybgemphasis
sgdsformpaddingy
sgdsformpaddinginlinexs
Component token

Names a component, then the role, property, and emphasis scoped to that component.

sgdssteppervisitedbordercolor
sgdsbadgeinfooutlinedbg
sgdsbtnlabelpaddingx
sgdsbtnmdminwidth

Naming principles

We follow five principles when naming SGDS tokens. They explain the choices behind every name shown above.

  • Short: keep names compact enough to scan in code, design tools, and documentation.
  • Meaningful: name the decision, not the current value. Prefer role-based words like danger, warning, success, surface, border-color, heading, and body.
  • Scalable: choose names that can support more products, themes, states, and component variants over time.
  • Flexible: keep shared tokens broad enough for reuse. Add context, such as form or btn, only when the decision is genuinely scoped.
  • Clear: make each segment easy to understand without resolving the token value.

Full naming structure

For the full picture, the chart below maps every position, segment, and modifier the system can produce. Use it as the reference whenever a new token name needs to slot into the system.

Worked example

The button-with-hover-state example below traces every position through a real token name, from primitive to component.

Singapore Government Design System

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

Past VersionsSGDS v1SGDS v2