Overview
The digital stamp tells people that the site is a government website registered with the Digital Government Authority (DGA). Its tab sits first in the Top Bar. The tab opens the stamp below the bar: two cards, one on the site’s address and one on HTTPS, and the site’s DGA registration number.
The stamp is a top bar expander: the top bar opens and closes it. This page covers its content and its text.
The stamp is a page shell part. The preview shows it open, in a frame of its own, so it does not clash with this page’s own stamp. The tab’s markup is in the Top Bar canon.
Markup
Parts
| Part | Holds | Required |
|---|---|---|
button.nds-digital-stamp-tab |
The tab, first in .nds-topbar: the flag, the long text (.nds-digital-stamp-lg-text), the short text (.nds-digital-stamp-sm-text) and #nds-digital-stamp-verify-text. It is a top bar toggle: aria-controls names the stamp |
Yes |
#nds-digital-stamp |
The stamp, a .nds-topbar-expander right after the bar. It ships hidden |
Yes |
.nds-topbar-expander-content |
Inside the stamp’s .nds-content-wrapper: the notices and the register, with the stamp’s space above and below them |
Yes |
.nds-digital-stamp-notices |
Two .nds-digital-stamp-card cards: the site’s address, then HTTPS |
Yes |
.nds-digital-stamp-card |
.nds-digital-stamp-icon, then .nds-digital-stamp-content with a .nds-digital-stamp-heading and a .nds-digital-stamp-description. The heading holds two spans: the words, then the domain or HTTPS in .nds-digital-stamp-highlight |
Yes |
.nds-digital-stamp-register |
The DGA logo, .nds-digital-stamp-register-text and the registration number, a link a.nds-digital-stamp-registration. Its number and href="#" are samples: write your DGA registration number and link |
Yes |
Variants
Domain picks the address card’s words. The default writes nothing: the script reads the site’s own address.
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Domain | From the address (default) (hint: The site’s own domain) | — | — | The stamp reads the site’s address: iu.edu.sa shows the .edu.sa card. An address outside .sa, such as a test server, shows .gov.sa |
| Domain | Government (hint: .gov.sa) | [data-digital-stamp-domain="gov.sa"] |
#nds-digital-stamp |
A government body |
| Domain | Education (hint: .edu.sa) | [data-digital-stamp-domain="edu.sa"] |
#nds-digital-stamp |
A university or another educational site |
| Domain | School (hint: .sch.sa) | [data-digital-stamp-domain="sch.sa"] |
#nds-digital-stamp |
A school |
| Domain | Medical (hint: .med.sa) | [data-digital-stamp-domain="med.sa"] |
#nds-digital-stamp |
A hospital or another medical site |
| Domain | Non-profit (hint: .org.sa) | [data-digital-stamp-domain="org.sa"] |
#nds-digital-stamp |
A non-profit organization |
| Domain | Activities and initiatives (hint: .sa) | [data-digital-stamp-domain="sa"] |
#nds-digital-stamp |
An activity or an initiative on a .sa address |
Behavior
Stamp Text
The stamp’s text is DGA’s, and each word carries a data-i18n marker: NDS writes it in the page language from the digital-stamp section of the string pack. That covers the tab’s texts, the two cards, .nds-digital-stamp-register-text, the flag’s and the logo’s alt and the stamp’s aria-label.
Address Card
The canon’s address card holds the .gov.sa text. The stamp follows the site’s own domain: on iu.edu.sa it points the card’s markers at the .edu.sa text. An address outside .sa, such as localhost, keeps .gov.sa. data-digital-stamp-domain on #nds-digital-stamp picks the card instead.
Built-in Features
-
Short Stamp Text
The tab shows its long text at 960px and up, and its short text below that.
-
DGA Text
The stamp ships DGA's text in Arabic and English, with an address card for each
.sadomain.
Best Practices
- Include the stamp on every government website. DGA requires it.
- Keep the stamp’s
data-i18nmarkers. A word whose marker you remove stays as you wrote it. - On a test server, write
data-digital-stamp-domainwith the site’s own domain, so the address card matches the live site. - Remove the stamp on a site that DGA has not registered.
API
Data Attributes
| Attribute | Element | Effect |
|---|---|---|
data-digital-stamp-domain |
#nds-digital-stamp |
gov.sa, edu.sa, sch.sa, med.sa, org.sa or sa: the address card’s text. Any other value warns in the console and shows gov.sa. See Address Card |
data-i18n |
Each word in the tab and the stamp | The word’s key in the digital-stamp section of the string pack. The address card’s keys start with gov_: the script changes them to the domain’s |
The attributes that open and close the stamp are on Top Bar.
JavaScript
| Method | Effect |
|---|---|
NDS.DigitalStamp.init() |
Points the address card at the site’s domain. The loader runs it when #nds-digital-stamp is on the page |
Open and close the stamp with NDS.Topbar. The top bar fires nds:topbar:opened and nds:topbar:closed on #nds-digital-stamp, with the stamp in detail.expander.
The full API is in the banner of _js/nds-digital-stamp.js.