公共服务 · 新资源

Digital Agency 设计系统.

使用 DADS 文本角色、语义令牌和原生 HTML 组件结构,构建易读的日语公共服务界面。试用可运行的收据查询功能,体验格式错误、无匹配结果和可供审核的状态记录。

OpenDesign 指南8 个章节17 个参考条目原始应用指南
01

Digital Agency 设计系统 界面预览

依次尝试无效的参考编号、查无结果的参考编号,再输入 123456,即可查看虚构的状态记录。

办事回执查询打开完整示例
原生 DADS HTML 输入框/按钮样式,日期为 2026 年 10 月 3 日,使用 design-tokens 2.0.1;布局和本地查询逻辑为原创。· 实现参考
02

Digital Agency 设计系统 设计参考

DADS beta v2.18.0 文档;原生 HTML 示例样式于 2026 年 10 月 3 日查阅;design-tokens 2.0.1。文档、示例仓库和令牌包各自采用独立的版本历史。下文会明确区分布局选择与官方组件值。

排版

来源
名称 / 规则值 / 配置用途
Sans familyNoto Sans JP, system fallbacks预览使用文档中说明的后备字体栈,不会下载字体。
Std-17N-17017px / 1.7; weight 400标准正文文本;令牌名称描述字号、字重和行高。
Body / UI baseline16px or greater14px 仅用于有限的辅助性场景。
Weight rolesN = 400; B = 700使用原生常规体和粗体。

原生输入框结构

来源
名称 / 规则值 / 配置用途
data-size sm / md / lg2.5rem / 3rem / 3.5rem基于根字号设置控件高度,而不是使用三种不同的文本大小。
Input border / radius1px / 0.5rem边框使用 neutral-solid-gray-600;圆角为组件 CSS。
Input padding0.75rem 1rem块级和行内内边距;最大宽度为 100%。
Focus4px black outline, 2px offset, 2px yellow shadow原生 focus-visible 样式;避免在容器边缘被裁切。

令牌包颜色

来源
名称 / 规则值 / 配置用途
--color-key-900#0017c1 默认 key 别名指向 primitive-blue-900。
--color-semantic-error-1#ec0000 别名指向 primitive-red-800;应配合错误提示使用。
--color-neutral-solid-gray-900#1a1a1a 输入文本。
--color-neutral-solid-gray-600#666666 默认输入框边框。
--color-primitive-yellow-300#ffd43d 黑色轮廓线后方的焦点阴影。

按钮与应用间距

来源
名称 / 规则值 / 配置用途
Large minimum136 × 56px允许标签展开并换行。
Medium minimum96 × 48px适用于次要操作。
Small / extra-small minimum80 × 36px / 72 × 28px即使可见控件较矮,也要确保目标区域达到 44 CSS px。
Preview rhythm8 / 24 / 64px应用根据间距指南中的示例进行选择;并非强制采用的 DADS 间距比例。
03

Digital Agency 设计系统 完整指南

实用指南,介绍如何为真实界面选择、应用和评审此系统。

DESIGN-japan-dads.md

完整指导、实现起点和源代码链接。

下载指南

Digital Agency 设计系统 资源与范围

选择 HTML 源路径

官方资源索引提供 HTML/CSS/JavaScript 示例、React/Tailwind 示例、Tailwind 插件和 Figma 设计数据。本示例选择纯 HTML 路径:输入框和按钮 CSS 原样复制,周边的状态查询与客户端验证则属于应用代码。这里没有虚构通用的 DADS 组件包。

摘自本 OpenDesign 指南

此预览是一个独立的虚构市政办事查询示例。它不仿制政府网站页眉、不查询公共数据库,也不声称提供官方服务状态。凭证格式和状态记录均为示例数据。

  1. 先加载 design-tokens,再加载两个组件样式表。
  2. 在原生 HTML 控件上保留文档中说明的类名和 data 属性。
  3. 在应用代码中添加特定于服务的验证、状态内容和焦点移动逻辑。

阅读配套规范

Digital Agency 设计系统 字体排印与语言

解读文本样式名称

Std-17N-170 表示 17px 常规字重,行高为无单位的 1.7。预览将这一节奏用于正文,并为标题选用 32px 粗体、1.5 行高。文档指定 Noto Sans JP 为无衬线字体;未加载网络字体时,可使用系统后备字体。本地示例特意采用这些后备字体。

日文和英文文本的占用宽度并不相同。标签应显示在控件上方,标题应允许换行,也不要根据假定的字符数来设定按钮尺寸。翻译后的文本可能需要更多垂直空间,但组件的作用不变。

阅读配套规范

Digital Agency 设计系统 语义颜色与焦点

使用 CSS 实际采用的别名

示例按钮通过 --color-key-900 设置默认颜色。分发的令牌样式表会将该别名解析为 blue-900,即 #0017c1。悬停和激活状态分别使用 key-1000 和 key-1200,而不是随意调整不透明度。输入框错误边框使用 --color-semantic-error-1。

控件获得键盘焦点时,黑色轮廓线和黄色阴影仍清晰可见。应将控件放在不会裁切它的容器中;即使组件 CSS 本身设置正确,overflow-hidden 卡片也可能裁掉焦点环。错误文本和 aria-invalid 属性可作为红色边框的补充。

阅读配套规范

Digital Agency 设计系统 间距与响应式布局

选择简洁的应用间距节奏

DADS 间距指南提供示例,并未规定每种界面都必须采用同一套间距序列。本布局在相关元素组内使用 8px 间距,在表单区块之间使用 24px 间距,并为桌面页面设置宽裕的 64px 内边距。内容最大宽度 52rem 是应用层面的选择,并非 DADS 令牌。

在窄屏下,结果说明会纵向堆叠,控件则填满可用空间。此示例仅使用 768px 媒体查询,并未将其视为通用的 DADS 断点;触发调整的依据是内容换行和按钮的最小尺寸。

css
.lookup { max-width:52rem; margin-inline:auto; padding:64px 24px; }
@media(max-width:767px) { .lookup { padding:24px; } .actions { align-items:stretch; } }

代码参考

阅读配套规范

Digital Agency 设计系统 输入结构与错误

将标签、提示和错误信息分开

原生 .dads-input-text 外层容器定义文本默认样式。内部的 .dads-input-text__input 子元素负责尺寸、边框、内边距、圆角和焦点状态。配套标签通过 for/id 明确关联输入框。即使出现错误,提示内容仍会保留,以便用户查看所需格式。

示例仅接受恰好六位 ASCII 数字。输入格式错误时,会设置 aria-invalid=true、显示关联的错误信息,并将焦点移回输入框。格式正确但不等于 123456 时,则显示单独的未匹配信息,不会将其描述为格式错误。这两种行为都是本地演示规则。

  • 输入类型保持为文本:参考编号是标识符,不是数量。
  • 使用 inputmode=numeric 作为键盘提示,同时避免出现数字输入框的微调按钮。
  • 保留已输入的值,同时说明接下来需要如何修改。

阅读配套规范

Digital Agency 设计系统 按钮层级与状态

此查询只设置一个主要操作

实心大号按钮用于触发查询,文本样式按钮用于清除示例。原生 data-type 的取值为 solid-fill、outline 和 text;data-size 用于选择 lg、md、sm 或 xs。这些是示例中的 HTML 属性值,并非 React 属性。

大号按钮的最小宽度为 136px,高度为 56px。若标签需要更多空间,按钮可以扩展。所提供的 CSS 中,小号和超小号变体会增大目标区域;不要在该区域内紧挨着排列其他目标。演示使用较大的变体,以避免这一问题。

阅读配套规范

Digital Agency 设计系统 实用的状态结果

让本地状态清晰可查

输入 123456 后,会显示一张虚构凭证,其中的定义列表列出参考编号、提交日期和后续操作。查询完成后,焦点会移至标题,让键盘用户直接到达新结果。未匹配状态同样会获得焦点,并提供重试方式。

三阶段列表使用原创的应用标记语言。列表通过文字、形状和颜色区分已接收、核查中和已作出决定。真实实现必须从服务端获取这些状态,并处理未授权、服务不可用和记录过期等情况。此预览不会发出外部请求,也不会让人误以为查到了真实公民记录。

阅读配套规范

Digital Agency 设计系统 集成示例

分离令牌、样式与行为

令牌包提供 dist/tokens.css。HTML 示例是一个包含 Storybook 脚本的源代码仓库;克隆该仓库即可获得检查环境。复制所需组件样式时,请保留其许可证,并在用于生产环境前记录源代码版本。

本页面使用的令牌包固定为 2.0.1,HTML 样式则来自带日期的源代码快照。独立演示加载本地文件,因此已验证的渲染效果不依赖在线 CDN。Storybook 设置命令作为官方仓库入口提供;本次预览未执行全新依赖安装。

阅读配套规范

Digital Agency 设计系统组件示例

带标签的参考编号输入框

使用原生 DADS 输入框类,并显示始终可见的提示和关联错误信息。

html
<div class="dads-input-text">
  <label for="reference">Reference number (required)</label>
  <p id="reference-hint">Use the 6 digits on your example receipt.</p>
  <input class="dads-input-text__input" data-size="lg"
    id="reference" inputmode="numeric" autocomplete="off"
    aria-describedby="reference-hint reference-error" aria-invalid="true">
  <span class="dads-input-text__error-text" id="reference-error">
    Enter 6 digits, for example 123456.
  </span>
</div>

代码参考

  • 更正有效后,移除 aria-invalid 并隐藏错误信息。
  • 参考编号验证属于应用逻辑。

主要查询和重置操作

使用原生按钮变体和 HTML 操作类型。

html
<button class="dads-button" data-type="solid-fill" data-size="lg" type="submit">
  Show example status
</button>
<button class="dads-button" data-type="text" data-size="md" type="reset">
  Clear reference
</button>

代码参考

完整的独立示例

完整文档包含其布局、控件与初始化。解压所链接的示例归档,即可获得完全一致的相对 vendor 资源,然后通过 HTTP 提供服务。

html
<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>DADS procedure receipt example</title><link rel="stylesheet" href="vendor/dads-2026-10-03/tokens.css"><link rel="stylesheet" href="vendor/dads-2026-10-03/input-text.css"><link rel="stylesheet" href="vendor/dads-2026-10-03/button.css"><style>
*{box-sizing:border-box}body{margin:0;color:var(--color-neutral-solid-gray-900);font:400 17px/1.7 var(--font-family-sans);background:#fff}.lookup{max-width:52rem;padding:64px 24px;margin:auto}.eyebrow{font-size:14px;letter-spacing:.08em;border-bottom:1px solid #b3b3b3;padding-bottom:16px}h1{font-size:32px;line-height:1.5;margin:24px 0}h2{font-size:24px;line-height:1.5}p{margin:8px 0 24px}.field{margin:32px 0}label{font-weight:700;display:block}.dads-input-text__input{width:22rem}#reference-hint{margin:8px 0}.actions{display:flex;gap:24px;flex-wrap:wrap;align-items:center;margin:24px 0}.result{border-top:4px solid var(--color-key-900);background:#f5f5f5;padding:24px;margin-top:32px}.result:focus{outline:3px solid #111;outline-offset:4px}dl{display:grid;grid-template-columns:10rem 1fr;gap:16px}dt{font-weight:700}dd{margin:0;overflow-wrap:anywhere}ol{padding-left:24px}li{padding:8px}li.current{font-weight:700;color:var(--color-key-900)}small{display:block;font-size:14px;margin-top:32px;color:#555}[hidden]{display:none!important}@media(max-width:767px){.lookup{padding:24px}h1{font-size:28px}.actions{align-items:stretch;flex-direction:column}.actions button{width:100%}dl{grid-template-columns:1fr;gap:4px}dd{margin-bottom:16px}}
</style><main class="lookup"><div class="eyebrow">SERVICE PATTERN · DADS HTML</div><h1>Check a procedure receipt</h1><p>Use the reference from your receipt to view the next step. This is a fictional local example.</p><form id="lookup-form" novalidate><div class="dads-input-text field"><label for="reference">Reference number (required)</label><p id="reference-hint">Enter 6 digits. Try <strong>123456</strong> for the example record.</p><input id="reference" class="dads-input-text__input" data-size="lg" inputmode="numeric" autocomplete="off" aria-describedby="reference-hint reference-error"><span id="reference-error" class="dads-input-text__error-text" hidden>Enter 6 digits, for example 123456.</span></div><div class="actions"><button class="dads-button" data-type="solid-fill" data-size="lg" type="submit">Show example status</button><button class="dads-button" data-type="text" data-size="md" type="reset">Clear reference</button></div></form><section class="result" id="missing" tabindex="-1" hidden><h2>No matching example</h2><p>This reference has the correct format, but is not in the local example data. Try 123456.</p></section><section class="result" id="found" tabindex="-1" hidden><h2>Receipt 123456</h2><dl><dt>Procedure</dt><dd>Community room request</dd><dt>Submitted</dt><dd>1 October 2026 — fictional date</dd><dt>Next action</dt><dd>Wait for the example review. No documents are currently requested.</dd></dl><ol aria-label="Procedure progress"><li>Received</li><li class="current" aria-current="step">Checking the request — current step</li><li>Decision — not started</li></ol></section><small>Independent OpenDesign demonstration. Native DADS component CSS; system font fallback. No information is sent or stored.</small></main><script>
const f=document.querySelector('form'),i=document.querySelector('input'),e=document.querySelector('#reference-error'),found=document.querySelector('#found'),missing=document.querySelector('#missing');f.addEventListener('submit',ev=>{ev.preventDefault();found.hidden=missing.hidden=true;const valid=/^[0-9]{6}$/.test(i.value.trim());e.hidden=valid;i.setAttribute('aria-invalid',String(!valid));if(!valid){i.focus();return}const target=i.value.trim()==='123456'?found:missing;target.hidden=false;target.focus()});f.addEventListener('reset',()=>{found.hidden=missing.hidden=e.hidden=true;i.removeAttribute('aria-invalid');i.focus()});
</script></html>

代码参考

  • 从“来源”一节下载完整示例。其 README 给出了确切的本地启动命令。
  • 保持 vendor 路径相对于本文档;该归档包含此预览所使用的全部资源。
04

Digital Agency 设计系统 Agent 设置

实现起点

采用官方示例仓库工作流和经过验证的令牌导入路径。此预览使用本地复制的 CSS 运行;不需要 React 或后端。Sources 中提供的完整可运行示例 ZIP 还包含准确的预览依赖项和完整文档。解压后,在该目录运行 python3 -m http.server 8080,然后打开 http://localhost:8080/japan-dads.html。请勿通过 file:// 打开基于模块的示例。

bash
# Official HTML samples are a source repository, not a published component SDK.
git clone https://github.com/digital-go-jp/design-system-example-components-html.git
cd design-system-example-components-html
npm install
npm run storybook
# For the standalone composition, copy these component styles into your app:
# src/components/input-text/input-text.css
# src/components/button/button.css
# Install the independently versioned token package:
npm install @digital-go-jp/[email protected]
# In a CSS-aware bundler entry:
# import '@digital-go-jp/design-tokens/dist/tokens.css';
# import './input-text.css';
# import './button.css';

适用于你项目的提示词

Agent 提示词
使用 DADS HTML 输入文本和按钮样式,以及 design-tokens 2.0.1,实现一个虚构的公共服务回执查询页面。保留可见标签、格式提示、aria-describedby 和无效状态。采用 Std-17N-170 文案节奏和大型主操作按钮。分别展示格式错误、未找到和已找到状态。保留已输入文本,将焦点移至新的状态标题,避免使用真实个人数据和政府身份标识。将 52rem 内容宽度及 8/24/64px 间距视为应用层选择。
05

Digital Agency 设计系统 来源与范围

基于官方示例 CSS 和令牌独立制作的教育示例。未获政府背书,不提供实时查询,也未复制任何机构的身份标识。字体回退为本地可用的系统无衬线字体。应用布局和记录数据并非官方 DADS 规范。