<!-- สร้างโดย scripts/build-docs.mjs จาก custom-elements.json — อย่าแก้ไฟล์นี้ตรงๆ แก้ JSDoc ของ component แล้วรัน `npm run docs` -->

# API reference — @purpurabog/ui 2.3.0

178 elements · attribute/property/event/slot/part ทุกตัวในหน้านี้เป็น public API ตามกติกา semver ใน CHANGELOG.md

| Element | Attributes | Slots | Parts | Events |
| --- | --- | --- | --- | --- |
| [`ui-accordion`](#ui-accordion) | 4 | 1 | 0 | 0 |
| [`ui-accordion-item`](#ui-accordion-item) | 4 | 2 | 4 | 1 |
| [`ui-accordion-skeleton`](#ui-accordion-skeleton) | 3 | 0 | 2 | 0 |
| [`ui-action-set`](#ui-action-set) | 3 | 1 | 1 | 0 |
| [`ui-badge-indicator`](#ui-badge-indicator) | 1 | 0 | 0 | 0 |
| [`ui-big-number`](#ui-big-number) | 12 | 3 | 5 | 0 |
| [`ui-big-number-skeleton`](#ui-big-number-skeleton) | 1 | 0 | 2 | 0 |
| [`ui-breadcrumb`](#ui-breadcrumb) | 5 | 1 | 3 | 0 |
| [`ui-breadcrumb-item`](#ui-breadcrumb-item) | 2 | 1 | 1 | 1 |
| [`ui-breadcrumb-skeleton`](#ui-breadcrumb-skeleton) | 3 | 0 | 1 | 0 |
| [`ui-button`](#ui-button) | 20 | 3 | 4 | 1 |
| [`ui-button-set`](#ui-button-set) | 1 | 1 | 1 | 0 |
| [`ui-button-skeleton`](#ui-button-skeleton) | 1 | 0 | 1 | 0 |
| [`ui-calendar`](#ui-calendar) | 18 | 3 | 21 | 8 |
| [`ui-calendar-select-month`](#ui-calendar-select-month) | 1 | 1 | 2 | 1 |
| [`ui-calendar-select-year`](#ui-calendar-select-year) | 1 | 1 | 2 | 1 |
| [`ui-card`](#ui-card) | 10 | 3 | 1 | 1 |
| [`ui-card-action`](#ui-card-action) | 1 | 1 | 0 | 0 |
| [`ui-card-actions`](#ui-card-actions) | 1 | 1 | 0 | 0 |
| [`ui-card-body`](#ui-card-body) | 1 | 1 | 0 | 0 |
| [`ui-card-footer`](#ui-card-footer) | 0 | 1 | 0 | 0 |
| [`ui-card-header`](#ui-card-header) | 0 | 1 | 0 | 0 |
| [`ui-card-header-media`](#ui-card-header-media) | 0 | 1 | 0 | 0 |
| [`ui-card-media`](#ui-card-media) | 2 | 1 | 0 | 0 |
| [`ui-card-title`](#ui-card-title) | 6 | 5 | 0 | 0 |
| [`ui-card-title-media`](#ui-card-title-media) | 0 | 1 | 0 | 0 |
| [`ui-checkbox`](#ui-checkbox) | 13 | 1 | 10 | 1 |
| [`ui-checkbox-group`](#ui-checkbox-group) | 12 | 5 | 8 | 0 |
| [`ui-checkbox-skeleton`](#ui-checkbox-skeleton) | 0 | 0 | 2 | 0 |
| [`ui-code-snippet`](#ui-code-snippet) | 18 | 1 | 4 | 2 |
| [`ui-code-snippet-skeleton`](#ui-code-snippet-skeleton) | 1 | 0 | 2 | 0 |
| [`ui-column`](#ui-column) | 6 | 1 | 0 | 0 |
| [`ui-column-hang`](#ui-column-hang) | 0 | 1 | 0 | 0 |
| [`ui-combo-button`](#ui-combo-button) | 8 | 1 | 3 | 3 |
| [`ui-combobox`](#ui-combobox) | 20 | 4 | 16 | 4 |
| [`ui-contained-list`](#ui-contained-list) | 5 | 3 | 4 | 0 |
| [`ui-contained-list-item`](#ui-contained-list-item) | 3 | 3 | 2 | 1 |
| [`ui-content`](#ui-content) | 0 | 1 | 0 | 0 |
| [`ui-content-switcher`](#ui-content-switcher) | 5 | 1 | 0 | 1 |
| [`ui-content-switcher-item`](#ui-content-switcher-item) | 6 | 2 | 2 | 0 |
| [`ui-copy-button`](#ui-copy-button) | 9 | 0 | 1 | 1 |
| [`ui-date-field`](#ui-date-field) | 17 | 0 | 5 | 5 |
| [`ui-date-picker`](#ui-date-picker) | 33 | 5 | 25 | 3 |
| [`ui-date-picker-skeleton`](#ui-date-picker-skeleton) | 4 | 0 | 2 | 0 |
| [`ui-definition-tooltip`](#ui-definition-tooltip) | 5 | 2 | 3 | 1 |
| [`ui-dropdown`](#ui-dropdown) | 18 | 4 | 14 | 3 |
| [`ui-dropdown-skeleton`](#ui-dropdown-skeleton) | 3 | 0 | 2 | 0 |
| [`ui-edit-in-place`](#ui-edit-in-place) | 16 | 0 | 4 | 4 |
| [`ui-expandable-tile`](#ui-expandable-tile) | 1 | 2 | 3 | 2 |
| [`ui-expressive-card`](#ui-expressive-card) | 15 | 10 | 15 | 3 |
| [`ui-file-uploader`](#ui-file-uploader) | 25 | 1 | 5 | 5 |
| [`ui-file-uploader-item`](#ui-file-uploader-item) | 12 | 0 | 8 | 2 |
| [`ui-file-uploader-skeleton`](#ui-file-uploader-skeleton) | 0 | 0 | 3 | 0 |
| [`ui-fluid-form`](#ui-fluid-form) | 0 | 1 | 0 | 0 |
| [`ui-form-group`](#ui-form-group) | 4 | 3 | 3 | 0 |
| [`ui-grid`](#ui-grid) | 5 | 1 | 1 | 0 |
| [`ui-header`](#ui-header) | 1 | 1 | 1 | 0 |
| [`ui-header-global-action`](#ui-header-global-action) | 4 | 1 | 1 | 0 |
| [`ui-header-global-bar`](#ui-header-global-bar) | 1 | 1 | 0 | 0 |
| [`ui-header-mega-group`](#ui-header-mega-group) | 1 | 1 | 2 | 0 |
| [`ui-header-mega-item`](#ui-header-mega-item) | 5 | 2 | 2 | 1 |
| [`ui-header-mega-menu`](#ui-header-mega-menu) | 3 | 1 | 3 | 1 |
| [`ui-header-menu`](#ui-header-menu) | 3 | 1 | 2 | 1 |
| [`ui-header-menu-button`](#ui-header-menu-button) | 4 | 0 | 1 | 1 |
| [`ui-header-menu-item`](#ui-header-menu-item) | 4 | 1 | 1 | 1 |
| [`ui-header-name`](#ui-header-name) | 4 | 1 | 1 | 1 |
| [`ui-header-nav`](#ui-header-nav) | 2 | 1 | 4 | 0 |
| [`ui-header-panel`](#ui-header-panel) | 2 | 1 | 1 | 1 |
| [`ui-heading`](#ui-heading) | 0 | 1 | 1 | 0 |
| [`ui-icon-button`](#ui-icon-button) | 14 | 2 | 2 | 2 |
| [`ui-icon-indicator`](#ui-icon-indicator) | 7 | 0 | 2 | 0 |
| [`ui-inline-loading`](#ui-inline-loading) | 3 | 1 | 3 | 1 |
| [`ui-layer`](#ui-layer) | 2 | 1 | 1 | 0 |
| [`ui-link`](#ui-link) | 8 | 2 | 2 | 1 |
| [`ui-list-item`](#ui-list-item) | 0 | 1 | 0 | 0 |
| [`ui-loading`](#ui-loading) | 7 | 1 | 4 | 0 |
| [`ui-menu`](#ui-menu) | 6 | 1 | 0 | 1 |
| [`ui-menu-button`](#ui-menu-button) | 8 | 1 | 2 | 2 |
| [`ui-menu-divider`](#ui-menu-divider) | 0 | 0 | 0 | 0 |
| [`ui-menu-group`](#ui-menu-group) | 3 | 1 | 0 | 1 |
| [`ui-menu-item`](#ui-menu-item) | 8 | 3 | 5 | 1 |
| [`ui-modal`](#ui-modal) | 7 | 4 | 8 | 2 |
| [`ui-multi-select`](#ui-multi-select) | 20 | 4 | 21 | 4 |
| [`ui-notification`](#ui-notification) | 17 | 3 | 7 | 3 |
| [`ui-number-input`](#ui-number-input) | 29 | 4 | 14 | 2 |
| [`ui-number-input-skeleton`](#ui-number-input-skeleton) | 3 | 0 | 2 | 0 |
| [`ui-ordered-list`](#ui-ordered-list) | 3 | 1 | 1 | 0 |
| [`ui-overflow-menu`](#ui-overflow-menu) | 7 | 2 | 2 | 2 |
| [`ui-page-header`](#ui-page-header) | 2 | 1 | 0 | 1 |
| [`ui-page-header-actions`](#ui-page-header-actions) | 1 | 1 | 1 | 0 |
| [`ui-page-header-breadcrumb`](#ui-page-header-breadcrumb) | 4 | 4 | 0 | 0 |
| [`ui-page-header-content`](#ui-page-header-content) | 2 | 5 | 1 | 0 |
| [`ui-page-header-content-text`](#ui-page-header-content-text) | 2 | 1 | 1 | 0 |
| [`ui-page-header-hero-image`](#ui-page-header-hero-image) | 1 | 1 | 0 | 0 |
| [`ui-page-header-scroller`](#ui-page-header-scroller) | 2 | 0 | 0 | 0 |
| [`ui-page-header-tabs`](#ui-page-header-tabs) | 1 | 3 | 0 | 0 |
| [`ui-page-header-tags`](#ui-page-header-tags) | 1 | 0 | 3 | 1 |
| [`ui-page-header-title-breadcrumb`](#ui-page-header-title-breadcrumb) | 2 | 1 | 1 | 1 |
| [`ui-pagination`](#ui-pagination) | 16 | 0 | 7 | 1 |
| [`ui-pagination-nav`](#ui-pagination-nav) | 7 | 0 | 3 | 1 |
| [`ui-popover`](#ui-popover) | 10 | 2 | 2 | 2 |
| [`ui-productive-card`](#ui-productive-card) | 18 | 9 | 14 | 3 |
| [`ui-progress-bar`](#ui-progress-bar) | 8 | 0 | 5 | 0 |
| [`ui-progress-indicator`](#ui-progress-indicator) | 4 | 1 | 1 | 1 |
| [`ui-progress-indicator-skeleton`](#ui-progress-indicator-skeleton) | 2 | 0 | 2 | 0 |
| [`ui-progress-step`](#ui-progress-step) | 6 | 1 | 5 | 1 |
| [`ui-radio`](#ui-radio) | 4 | 1 | 2 | 0 |
| [`ui-radio-group`](#ui-radio-group) | 15 | 5 | 8 | 2 |
| [`ui-radio-skeleton`](#ui-radio-skeleton) | 0 | 0 | 1 | 0 |
| [`ui-radio-tile`](#ui-radio-tile) | 4 | 1 | 2 | 0 |
| [`ui-search`](#ui-search) | 18 | 0 | 6 | 4 |
| [`ui-search-skeleton`](#ui-search-skeleton) | 2 | 0 | 3 | 0 |
| [`ui-section`](#ui-section) | 1 | 1 | 0 | 0 |
| [`ui-select`](#ui-select) | 16 | 4 | 10 | 1 |
| [`ui-select-skeleton`](#ui-select-skeleton) | 3 | 0 | 2 | 0 |
| [`ui-selectable-tile`](#ui-selectable-tile) | 13 | 1 | 10 | 1 |
| [`ui-shape-indicator`](#ui-shape-indicator) | 7 | 0 | 2 | 0 |
| [`ui-side-nav`](#ui-side-nav) | 5 | 1 | 2 | 1 |
| [`ui-side-nav-divider`](#ui-side-nav-divider) | 0 | 0 | 0 | 0 |
| [`ui-side-nav-items`](#ui-side-nav-items) | 0 | 1 | 0 | 0 |
| [`ui-side-nav-link`](#ui-side-nav-link) | 5 | 2 | 1 | 1 |
| [`ui-side-nav-menu`](#ui-side-nav-menu) | 3 | 2 | 2 | 1 |
| [`ui-side-nav-menu-item`](#ui-side-nav-menu-item) | 4 | 1 | 1 | 1 |
| [`ui-side-panel`](#ui-side-panel) | 17 | 6 | 6 | 3 |
| [`ui-skeleton`](#ui-skeleton) | 2 | 0 | 2 | 0 |
| [`ui-skip-to-content`](#ui-skip-to-content) | 1 | 1 | 0 | 0 |
| [`ui-slider`](#ui-slider) | 23 | 3 | 16 | 2 |
| [`ui-slider-skeleton`](#ui-slider-skeleton) | 2 | 0 | 2 | 0 |
| [`ui-stack`](#ui-stack) | 2 | 1 | 0 | 0 |
| [`ui-structured-list`](#ui-structured-list) | 6 | 1 | 0 | 1 |
| [`ui-structured-list-cell`](#ui-structured-list-cell) | 2 | 1 | 0 | 0 |
| [`ui-structured-list-row`](#ui-structured-list-row) | 6 | 1 | 1 | 1 |
| [`ui-structured-list-skeleton`](#ui-structured-list-skeleton) | 1 | 0 | 2 | 0 |
| [`ui-switcher`](#ui-switcher) | 1 | 1 | 0 | 0 |
| [`ui-switcher-item`](#ui-switcher-item) | 4 | 1 | 0 | 1 |
| [`ui-tab`](#ui-tab) | 7 | 2 | 3 | 2 |
| [`ui-tab-panel`](#ui-tab-panel) | 1 | 1 | 0 | 0 |
| [`ui-table`](#ui-table) | 17 | 6 | 5 | 7 |
| [`ui-table-batch-actions`](#ui-table-batch-actions) | 4 | 3 | 3 | 2 |
| [`ui-table-body`](#ui-table-body) | 1 | 1 | 0 | 1 |
| [`ui-table-cell`](#ui-table-cell) | 4 | 1 | 4 | 0 |
| [`ui-table-column-settings`](#ui-table-column-settings) | 0 | 0 | 2 | 0 |
| [`ui-table-csv-export`](#ui-table-csv-export) | 1 | 0 | 1 | 1 |
| [`ui-table-expanded-row`](#ui-table-expanded-row) | 6 | 1 | 1 | 0 |
| [`ui-table-head`](#ui-table-head) | 0 | 1 | 0 | 0 |
| [`ui-table-header-cell`](#ui-table-header-cell) | 14 | 1 | 5 | 1 |
| [`ui-table-header-description`](#ui-table-header-description) | 0 | 1 | 0 | 0 |
| [`ui-table-header-row`](#ui-table-header-row) | 13 | 1 | 3 | 3 |
| [`ui-table-header-title`](#ui-table-header-title) | 0 | 1 | 0 | 0 |
| [`ui-table-row`](#ui-table-row) | 15 | 1 | 3 | 3 |
| [`ui-table-skeleton`](#ui-table-skeleton) | 5 | 0 | 1 | 0 |
| [`ui-table-toolbar`](#ui-table-toolbar) | 0 | 1 | 0 | 0 |
| [`ui-table-toolbar-content`](#ui-table-toolbar-content) | 1 | 1 | 0 | 0 |
| [`ui-table-toolbar-search`](#ui-table-toolbar-search) | 19 | 0 | 6 | 4 |
| [`ui-tabs`](#ui-tabs) | 9 | 3 | 4 | 4 |
| [`ui-tabs-skeleton`](#ui-tabs-skeleton) | 1 | 0 | 1 | 0 |
| [`ui-tag`](#ui-tag) | 11 | 2 | 3 | 2 |
| [`ui-tag-skeleton`](#ui-tag-skeleton) | 1 | 0 | 1 | 0 |
| [`ui-tearsheet`](#ui-tearsheet) | 12 | 7 | 8 | 2 |
| [`ui-text-area`](#ui-text-area) | 26 | 4 | 10 | 2 |
| [`ui-text-area-skeleton`](#ui-text-area-skeleton) | 3 | 0 | 2 | 0 |
| [`ui-text-input`](#ui-text-input) | 31 | 4 | 14 | 3 |
| [`ui-text-input-skeleton`](#ui-text-input-skeleton) | 3 | 0 | 2 | 0 |
| [`ui-theme-switcher`](#ui-theme-switcher) | 8 | 0 | 2 | 1 |
| [`ui-tile`](#ui-tile) | 3 | 2 | 1 | 1 |
| [`ui-time-picker`](#ui-time-picker) | 17 | 4 | 7 | 1 |
| [`ui-time-picker-select`](#ui-time-picker-select) | 6 | 1 | 1 | 1 |
| [`ui-time-picker-skeleton`](#ui-time-picker-skeleton) | 1 | 0 | 1 | 0 |
| [`ui-toaster`](#ui-toaster) | 2 | 1 | 0 | 0 |
| [`ui-toggle`](#ui-toggle) | 10 | 1 | 5 | 2 |
| [`ui-toggle-skeleton`](#ui-toggle-skeleton) | 0 | 0 | 2 | 0 |
| [`ui-toggletip`](#ui-toggletip) | 4 | 2 | 3 | 1 |
| [`ui-tooltip`](#ui-tooltip) | 7 | 1 | 2 | 0 |
| [`ui-tree-node`](#ui-tree-node) | 7 | 4 | 4 | 3 |
| [`ui-tree-view`](#ui-tree-view) | 5 | 1 | 2 | 2 |
| [`ui-truncated-text`](#ui-truncated-text) | 8 | 0 | 3 | 1 |
| [`ui-unordered-list`](#ui-unordered-list) | 2 | 1 | 1 | 0 |
| [`ui-user-avatar`](#ui-user-avatar) | 7 | 1 | 3 | 0 |

## Events: ชื่อและความหมาย

ชื่อ event หนึ่งชื่อมีความหมายเดียวในทุก element: ชื่อ native (`change`, `input`, `click`) มีความหมายแบบ native ส่วน event อื่นทั้งหมดขึ้นต้นด้วย `ui-` และส่งข้อมูลใน `event.detail` ·
wrapper `@lit/react` (`/react`) รับ event เป็น prop `on` + PascalCase ของชื่อ · รายละเอียดของแต่ละ element อยู่ในหัวข้อ Events ของ element นั้น

| Event | React prop | ความหมาย | Elements |
| --- | --- | --- | --- |
| `change` | `onChange` | ผู้ใช้ commit ค่าหรือสถานะใหม่ของ form control (`value` / `checked` / `selected` เป็นค่าใหม่แล้ว) | [`ui-calendar`](#ui-calendar) [`ui-checkbox`](#ui-checkbox) [`ui-combobox`](#ui-combobox) [`ui-date-picker`](#ui-date-picker) [`ui-dropdown`](#ui-dropdown) [`ui-file-uploader`](#ui-file-uploader) [`ui-multi-select`](#ui-multi-select) [`ui-number-input`](#ui-number-input) [`ui-radio-group`](#ui-radio-group) [`ui-search`](#ui-search) [`ui-select`](#ui-select) [`ui-selectable-tile`](#ui-selectable-tile) [`ui-table-toolbar-search`](#ui-table-toolbar-search) [`ui-tag`](#ui-tag) [`ui-text-area`](#ui-text-area) [`ui-text-input`](#ui-text-input) [`ui-time-picker-select`](#ui-time-picker-select) [`ui-toggle`](#ui-toggle) |
| `click` | `onClick` | Native | [`ui-icon-button`](#ui-icon-button) |
| `input` | `onInput` | ค่า (`value`) เปลี่ยน ยิงทุกครั้งก่อน `change` และ `value` เป็นค่าใหม่แล้ว · text field ยิงทุกครั้งที่พิมพ์ (ข้อความคือค่า) · ui-combobox / ui-multi-select `filterable` ยังยิง native `input` ตอนพิมพ์ด้วย (เพื่อความเข้ากันได้ `value` ยังไม่เปลี่ยน) ให้ฟัง `ui-input` แทน | [`ui-combobox`](#ui-combobox) [`ui-dropdown`](#ui-dropdown) [`ui-edit-in-place`](#ui-edit-in-place) [`ui-multi-select`](#ui-multi-select) [`ui-number-input`](#ui-number-input) [`ui-search`](#ui-search) [`ui-table-toolbar-search`](#ui-table-toolbar-search) [`ui-text-area`](#ui-text-area) [`ui-text-input`](#ui-text-input) |
| `ui-action` | `onUiAction` | The action button was pressed | [`ui-notification`](#ui-notification) |
| `ui-activate` | `onUiActivate` | detail: { active } when a node becomes the active one | [`ui-tree-view`](#ui-tree-view) |
| `ui-add` | `onUiAdd` | detail: { addedFiles } right after the user picks files (invalid ones included) | [`ui-file-uploader`](#ui-file-uploader) |
| `ui-before-toggle` | `onUiBeforeToggle` | Cancelable; ก่อนเปิดหรือปิด `preventDefault()` ยกเลิก | [`ui-expandable-tile`](#ui-expandable-tile) |
| `ui-blur` | `onUiBlur` | detail `{ next }`: the text box lost focus to `next` (may be null) | [`ui-date-field`](#ui-date-field) |
| `ui-cancel` | `onUiCancel` | detail: { value } the value was put back (Cancel, Escape, leaving it without a valid change) | [`ui-edit-in-place`](#ui-edit-in-place) |
| `ui-change` | `onUiChange` | detail: {...} ผู้ใช้เลือกหรือเปลี่ยนค่าที่ส่งใน `detail` (ส่วนใหญ่เป็น element ที่ไม่ใช่ form control; ui-file-uploader ยิงคู่กับ `change`) | [`ui-content-switcher`](#ui-content-switcher) [`ui-file-uploader`](#ui-file-uploader) [`ui-menu-group`](#ui-menu-group) [`ui-pagination`](#ui-pagination) [`ui-pagination-nav`](#ui-pagination-nav) [`ui-progress-indicator`](#ui-progress-indicator) [`ui-structured-list`](#ui-structured-list) |
| `ui-clear` | `onUiClear` | ผู้ใช้ล้างค่าด้วยปุ่ม × (หรือ Esc) | [`ui-date-field`](#ui-date-field) [`ui-search`](#ui-search) [`ui-table-toolbar-search`](#ui-table-toolbar-search) |
| `ui-click` | `onUiClick` | ส่วนหลักของ element ถูก activate (ปุ่มหลักของ combo button, รายการ, การ์ด) | [`ui-combo-button`](#ui-combo-button) [`ui-contained-list-item`](#ui-contained-list-item) [`ui-expressive-card`](#ui-expressive-card) [`ui-productive-card`](#ui-productive-card) |
| `ui-close` | `onUiClose` | หลังปิดแล้ว | [`ui-modal`](#ui-modal) [`ui-notification`](#ui-notification) [`ui-side-panel`](#ui-side-panel) [`ui-tab`](#ui-tab) [`ui-tabs`](#ui-tabs) [`ui-tearsheet`](#ui-tearsheet) |
| `ui-copy` | `onUiCopy` | detail: { text }; cancelable | [`ui-code-snippet`](#ui-code-snippet) [`ui-copy-button`](#ui-copy-button) |
| `ui-delete` | `onUiDelete` | detail: { deletedFile, remainingFiles } | [`ui-file-uploader`](#ui-file-uploader) [`ui-file-uploader-item`](#ui-file-uploader-item) |
| `ui-dismiss` | `onUiDismiss` | The dismiss button was pressed (the tag stays until you remove it) | [`ui-tag`](#ui-tag) |
| `ui-focus` | `onUiFocus` | detail `{ from }`: the text box gained focus from `from` (may be null) | [`ui-date-field`](#ui-date-field) |
| `ui-focus-change` | `onUiFocusChange` | Detail `{ date }`, when keyboard or navigation moves the focused date | [`ui-calendar`](#ui-calendar) |
| `ui-focus-day` | `onUiFocusDay` | Detail `{ date }`, a month was chosen: the enclosing calendar moves its focus there | [`ui-calendar-select-month`](#ui-calendar-select-month) [`ui-calendar-select-year`](#ui-calendar-select-year) |
| `ui-input` | `onUiInput` | detail: { value } ข้อความที่พิมพ์ (`inputValue`) ในช่องค้นหาของ ui-combobox / ui-multi-select `filterable`; `value` ไม่เปลี่ยน | [`ui-combobox`](#ui-combobox) [`ui-multi-select`](#ui-multi-select) |
| `ui-lazy-load` | `onUiLazyLoad` | detail: { value } when a `lazy` node is expanded and its children should be fetched | [`ui-tree-node`](#ui-tree-node) |
| `ui-multi-pick` | `onUiMultiPick` | Detail `{ date, values }`, in multi mode when a day is toggled | [`ui-calendar`](#ui-calendar) |
| `ui-native-change` | `onUiNativeChange` | detail `{ iso }`, the OS date picker chose a day | [`ui-date-field`](#ui-date-field) |
| `ui-navigate` | `onUiNavigate` | Cancelable; detail: { href } คลิกลิงก์แบบธรรมดา ยกเลิกเพื่อ route ฝั่ง client | [`ui-breadcrumb-item`](#ui-breadcrumb-item) [`ui-button`](#ui-button) [`ui-card`](#ui-card) [`ui-header-mega-item`](#ui-header-mega-item) [`ui-header-menu-item`](#ui-header-menu-item) [`ui-header-name`](#ui-header-name) [`ui-icon-button`](#ui-icon-button) [`ui-link`](#ui-link) [`ui-page-header-title-breadcrumb`](#ui-page-header-title-breadcrumb) [`ui-side-nav-link`](#ui-side-nav-link) [`ui-side-nav-menu-item`](#ui-side-nav-menu-item) [`ui-switcher-item`](#ui-switcher-item) [`ui-tile`](#ui-tile) [`ui-tree-node`](#ui-tree-node) |
| `ui-navigate-back` | `onUiNavigateBack` | The back button (`current-step` > 0) was pressed | [`ui-side-panel`](#ui-side-panel) |
| `ui-page-change` | `onUiPageChange` | Detail `{ start, end }`, the first and last day shown after the months on show changed (Cally `pagechange`) | [`ui-calendar`](#ui-calendar) |
| `ui-page-header-state` | `onUiPageHeaderState` | The state changed (`state`: fullyCollapsed, titleClipped, contentActionsClipped …); not bubbling | [`ui-page-header`](#ui-page-header) |
| `ui-pick` | `onUiPick` | Detail `{ date }`, when a day is activated | [`ui-calendar`](#ui-calendar) |
| `ui-primary-button-click` | `onUiPrimaryButtonClick` | The primary button was activated | [`ui-expressive-card`](#ui-expressive-card) [`ui-productive-card`](#ui-productive-card) |
| `ui-range-end` | `onUiRangeEnd` | Detail `{ date }`, with `range`: the second end was picked (Cally `rangeend`) | [`ui-calendar`](#ui-calendar) [`ui-date-picker`](#ui-date-picker) |
| `ui-range-start` | `onUiRangeStart` | Detail `{ date }`, with `range`: the first end was picked (Cally `rangestart`) | [`ui-calendar`](#ui-calendar) [`ui-date-picker`](#ui-date-picker) |
| `ui-request-close` | `onUiRequestClose` | Cancelable; detail: { reason } (หรือ { name }) ก่อนปิด `preventDefault()` ให้เปิดค้างไว้ | [`ui-modal`](#ui-modal) [`ui-notification`](#ui-notification) [`ui-popover`](#ui-popover) [`ui-side-panel`](#ui-side-panel) [`ui-tab`](#ui-tab) [`ui-tabs`](#ui-tabs) [`ui-tearsheet`](#ui-tearsheet) |
| `ui-retry` | `onUiRetry` | detail: { retriedFile } when the user retries a failed upload | [`ui-file-uploader`](#ui-file-uploader) [`ui-file-uploader-item`](#ui-file-uploader-item) |
| `ui-save` | `onUiSave` | detail: { value } a change was saved (Save, Enter, leaving it) | [`ui-edit-in-place`](#ui-edit-in-place) |
| `ui-secondary-button-click` | `onUiSecondaryButtonClick` | The secondary button was activated | [`ui-expressive-card`](#ui-expressive-card) [`ui-productive-card`](#ui-productive-card) |
| `ui-select` | `onUiSelect` | detail: {...} ผู้ใช้ activate รายการ (menu item, tree node) | [`ui-combo-button`](#ui-combo-button) [`ui-menu-button`](#ui-menu-button) [`ui-menu-item`](#ui-menu-item) [`ui-overflow-menu`](#ui-overflow-menu) [`ui-tree-view`](#ui-tree-view) |
| `ui-success` | `onUiSuccess` | `success-delay` ms after `status` became `finished` | [`ui-inline-loading`](#ui-inline-loading) |
| `ui-tab-before-change` | `onUiTabBeforeChange` | Cancelable; detail: { name, previous }. preventDefault() keeps the current tab (e.g. unsaved changes). | [`ui-tabs`](#ui-tabs) |
| `ui-tab-change` | `onUiTabChange` | detail: { name } after the user selects a tab | [`ui-tabs`](#ui-tabs) |
| `ui-table-batch-actions-cancel-clicked` | `onUiTableBatchActionsCancelClicked` | Cancel was clicked (the table releases every row) | [`ui-table-batch-actions`](#ui-table-batch-actions) |
| `ui-table-batch-actions-select-all-clicked` | `onUiTableBatchActionsSelectAllClicked` | "Select all (N)" was clicked | [`ui-table-batch-actions`](#ui-table-batch-actions) |
| `ui-table-body-content-change` | `onUiTableBodyContentChange` | its rows were added, removed or reordered (the table listens) | [`ui-table-body`](#ui-table-body) |
| `ui-table-cell-edit` | `onUiTableCellEdit` | from the cell, cancelable; detail: { row, cell, column, value, previous } before an edited value is written into the cell (`preventDefault()` to write it yourself) | [`ui-table`](#ui-table) |
| `ui-table-change-selection-all` | `onUiTableChangeSelectionAll` | cancelable; detail: { selected } before every row is chosen or released | [`ui-table-header-row`](#ui-table-header-row) |
| `ui-table-columns-change` | `onUiTableColumnsChange` | detail: { hiddenColumns, column, hidden } after a column was shown or hidden (`column` is '' after Reset) | [`ui-table`](#ui-table) |
| `ui-table-csv-export` | `onUiTableCsvExport` | cancelable; detail: { csv, rows, fileName } before the download | [`ui-table-csv-export`](#ui-table-csv-export) |
| `ui-table-filtered` | `onUiTableFiltered` | detail: { unfilteredRows } after the search changed which rows show | [`ui-table`](#ui-table) |
| `ui-table-header-cell-sort` | `onUiTableHeaderCellSort` | cancelable; detail: { oldSortDirection, sortDirection } before the column sorts (`preventDefault()` keeps the rows and this header as they are: sort the data yourself and set `sort-direction`) | [`ui-table-header-cell`](#ui-table-header-cell) |
| `ui-table-page-change` | `onUiTablePageChange` | detail: { page, pageSize } after the built-in pagination changed (`page-size`) | [`ui-table`](#ui-table) |
| `ui-table-row-all-selected` | `onUiTableRowAllSelected` | detail: { selectedRows } after select-all or Cancel | [`ui-table`](#ui-table) |
| `ui-table-row-change-selection` | `onUiTableRowChangeSelection` | cancelable; detail: { selected } before the row is chosen or released | [`ui-table-row`](#ui-table-row) |
| `ui-table-row-expando-beingtoggled` | `onUiTableRowExpandoBeingtoggled` | cancelable; detail: { expanded } before the row opens or closes | [`ui-table-row`](#ui-table-row) |
| `ui-table-row-expando-toggled` | `onUiTableRowExpandoToggled` | detail: { expanded } after the row opened or closed | [`ui-table-row`](#ui-table-row) |
| `ui-table-row-selected` | `onUiTableRowSelected` | detail: { selectedRow, selectedRows } after the user chose or released a row | [`ui-table`](#ui-table) |
| `ui-table-sorted` | `onUiTableSorted` | detail: { sortedHeader } after the rows were sorted by a header click | [`ui-table`](#ui-table) |
| `ui-tag-dismiss` | `onUiTagDismiss` | detail: { tag, index } after a dismissible tag was dismissed (it is already gone from `tags`) | [`ui-page-header-tags`](#ui-page-header-tags) |
| `ui-theme-change` | `onUiThemeChange` | The person picked a mode: { mode, theme } | [`ui-theme-switcher`](#ui-theme-switcher) |
| `ui-toggle` | `onUiToggle` | หลังส่วนที่เปิดปิดได้เปิดหรือปิด (list, menu, panel, tooltip, ข้อความที่ย่อไว้) · detail บอกสถานะใหม่: `open`, `expanded`, `visible` (password) หรือ `active` (ui-header-menu-button ซึ่ง cancelable และยิงก่อนเปลี่ยน) | [`ui-accordion-item`](#ui-accordion-item) [`ui-code-snippet`](#ui-code-snippet) [`ui-combo-button`](#ui-combo-button) [`ui-combobox`](#ui-combobox) [`ui-definition-tooltip`](#ui-definition-tooltip) [`ui-dropdown`](#ui-dropdown) [`ui-expandable-tile`](#ui-expandable-tile) [`ui-header-mega-menu`](#ui-header-mega-menu) [`ui-header-menu`](#ui-header-menu) [`ui-header-menu-button`](#ui-header-menu-button) [`ui-header-panel`](#ui-header-panel) [`ui-menu`](#ui-menu) [`ui-menu-button`](#ui-menu-button) [`ui-multi-select`](#ui-multi-select) [`ui-overflow-menu`](#ui-overflow-menu) [`ui-popover`](#ui-popover) [`ui-search`](#ui-search) [`ui-side-nav`](#ui-side-nav) [`ui-side-nav-menu`](#ui-side-nav-menu) [`ui-table-toolbar-search`](#ui-table-toolbar-search) [`ui-text-input`](#ui-text-input) [`ui-toggletip`](#ui-toggletip) [`ui-tree-node`](#ui-tree-node) [`ui-truncated-text`](#ui-truncated-text) |

## `<ui-accordion>`

Carbon `Accordion`: a vertical list of `<ui-accordion-item>`s with 1px dividers. Sets the size (heading height sm 32 / md 40 / lg 48), the chevron side (`align="start"`) and `flush` on its items. Several items may be open at once, as in Carbon.

นำเข้า: `import '@purpurabog/ui/accordion';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `AccordionSize` | `'md'` | Heading height: sm 32px, md 40px (default), lg 48px. |
| `align` | `'start' \| 'end'` | `'end'` | Chevron before the title instead of after it. |
| `flush` | `boolean` | `false` | No outer dividers; an inset line between items (Carbon `isFlush`, ignored with `align="start"`). |
| `disabled` | `boolean` | `false` | Disables every item; removing it again leaves disabled only the items that have their own `disabled`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-accordion-item>` elements |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-accordion-focus-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-accordion-item>`

Carbon `AccordionItem`: a heading button that shows or hides its content. Place inside `<ui-accordion>`, which provides the dividers, size and chevron side.

นำเข้า: `import '@purpurabog/ui/accordion';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `title` |  |  |  |
| `heading` | `string` | `''` | Heading text; the `title` slot replaces it when markup is needed. (Before 0.5: the `title` attribute, still accepted.) |
| `open` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `titleText` |  |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Content |
| `title` | Heading text with markup; the `heading` attribute is the plain-text fallback |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `heading` | The heading button |
| `arrow` | The chevron |
| `title` | The heading text |
| `content` | The content wrapper |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } after the user opened or closed it |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-accordion-focus-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-accordion-skeleton>`

Carbon `AccordionSkeleton` (`cds-accordion-skeleton`): `count` headings (a title bar and the chevron), the first open with three lines (90 / 80 / 95%) unless `open` is off; `alignment="start"` puts the chevron first. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/accordion';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `count` | `number` | `4` |  |
| `open` | `boolean` | `true` | The first item shows its content. |
| `alignment` | `'start' \| 'end'` | `'end'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `title` | Each title bar |
| `line` | Each line of the open item |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-action-set>`

Carbon for IBM Products `ActionSet` (`c4p-action-set`): the action buttons at the foot of a side panel or tearsheet — 64px expressive buttons with their text at the top (48px `condensed`), separated by 1px lines, laid out by `size` (the panel's) and how many there are: a lone button fills a medium set and takes half a large one; two take half each; three or four a quarter (232px at most) in large sets; a ghost takes what the others leave; small sets, and medium ones with three, stack them (primary on top). Put `<ui-button>`s inside in Carbon's order — ghost, tertiary, secondary, danger, primary — and a stack shows it reversed.

นำเข้า: `import '@purpurabog/ui/action-set';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `ActionSetSize` | `'md'` | The set's size (a side panel's size; xs counts as sm): how the buttons share the row, or stack. |
| `condensed` | `boolean` | `false` | 48px buttons instead of 64px (Carbon `condensedActions` of a side panel). |
| `disable-stacking` | `boolean` | `false` | Keep the buttons in a row even where Carbon would stack them. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `stacked` |  | Whether the buttons stack, one per row. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The buttons |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The row of buttons |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-actions-button-align` | `(ตามบริบท)` |
| `--ui-actions-button-flex` | `(ตามบริบท)` |
| `--ui-actions-button-padding-top` | `(ตามบริบท)` |
| `--ui-actions-gap` | `(ตามบริบท)` |
| `--ui-actions-padding` | `(ตามบริบท)` |
| `--ui-actions-stacked-direction` | `(ตามบริบท)` |
| `--ui-actions-stacked-width` | `(ตามบริบท)` |
| `--ui-actions-stacked-wrap` | `(ตามบริบท)` |
| `--ui-button-separator` | `(ตามบริบท)` |
| `--ui-button-set-separator` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |

## `<ui-badge-indicator>`

Carbon `BadgeIndicator` (`cds-badge-indicator`): a support-error badge in the top-end corner of a ghost `<ui-icon-button>` — an 8px dot 8px in, or with `count` a 16px pill (helper-text-01) 4px in, "999+" past 999 (4px in on a small button either way). Put it inside the icon button (it takes the `badge-indicator` slot); the button reads the count to screen readers as its description, and hides the badge while disabled. `<ui-icon-button badge-count>` makes one for you.

นำเข้า: `import '@purpurabog/ui/badge-indicator';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `count` | `number \| undefined` |  | The number shown; unset or 0 = a dot. |

### Slots
_ไม่มี_

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-big-number>`

Carbon for IBM Products `BigNumber` (`c4p-big-number`): a large value under a small label — "12.3K", or "12.3K/50.0K" with a `total` larger than the value (hidden for `percentage`, which adds "%", unless `force-show-total`). Abbreviated by Intl compact notation in `locale` (en-US by default, as Carbon) with `fraction-digits`; `truncate="false"` shows the whole grouped number. `trending` puts an up arrow before it, `tooltip-description` an info button after the label that shows it in a tooltip, `loading` the skeleton. Sizes: default (label-01 / heading-04 / body-compact-01), lg (label-01 / heading-06 / heading-03), xl (body-compact-01 / heading-07 / heading-04).

นำเข้า: `import '@purpurabog/ui/big-number';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `number \| undefined` |  | The value (the numerator of a fraction). |
| `total` | `number \| undefined` |  | The total after the slash; shown only when larger than `value` and different once abbreviated. |
| `label` | `string` | `''` | The label above the value. |
| `locale` | `string` | `''` | How the numbers are written (Intl locale); en-US when empty or invalid. |
| `fraction-digits` | `number` | `1` | Fraction digits of an abbreviated number. |
| `truncate` | `boolean` | `true` | Abbreviate the numbers (12,345 → 12.3K); `truncate="false"` writes them in full. |
| `percentage` | `boolean` | `false` | Add "%" after the value; the total never shows. |
| `trending` | `boolean` | `false` | An up arrow before the value. |
| `force-show-total` | `boolean` | `false` | Show the total even when it would be hidden ("Unknown" without one). |
| `tooltip-description` | `string` | `''` | Text of an info button after the label, shown in a tooltip. |
| `size` | `BigNumberSize` | `'default'` |  |
| `loading` | `boolean` | `false` | Show the skeleton instead. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Replaces the label text (e.g. with your own info toggletip) |
| `trending-icon` | Replaces the up arrow of `trending` |
| `icon-button` | An icon button after the value |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `figure` | The figure |
| `label` | The label |
| `value` | The value |
| `total` | The "/total" |
| `info` | The info button of `tooltip-description` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-04` | `(ตามบริบท)` |
| `--ui-font-heading-06` | `(ตามบริบท)` |
| `--ui-font-heading-07` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-big-number-skeleton>`

Carbon for IBM Products `BigNumberSkeleton` (`c4p-big-number-skeleton`): the shape of a `<ui-big-number>` while it loads — 64px wide (lg 80, xl 96), a 70% × 16px label bar, then a 40px value bar (lg 48, xl 64) 4px under it (lg 8, xl 12). `<ui-big-number loading>` shows one. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/big-number';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `BigNumberSize` | `'default'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `value` | The value bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |

## `<ui-breadcrumb>`

Carbon `Breadcrumb`: a `<nav aria-label="Breadcrumb">` holding an ordered list of `<ui-breadcrumb-item>`s separated by slashes. `no-trailing-slash` drops the slash after the last item; `size="sm"` uses label-01 type.

นำเข้า: `import '@purpurabog/ui/breadcrumb';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Accessible name of the navigation landmark. |
| `no-trailing-slash` | `boolean` | `false` |  |
| `size` | `BreadcrumbSize` | `'md'` |  |
| `overflow` | `boolean` | `false` | On one line, the crumbs that don't fit go into a "…" menu before the last one. |
| `overflow-label` | `string` | `''` | The overflow menu's name (default: the translation's "More breadcrumbs"). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-breadcrumb-item>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The `<nav>` |
| `list` | The `<ol>` |
| `overflow` | The "…" item holding the overflow menu (`overflow` only) |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-breadcrumb-trailing-slash` | `(ตามบริบท)` |
| `--ui-breadcrumb-wrap` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-link-hover` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-breadcrumb-item>`

Carbon `BreadcrumbItem`: a link in the trail, or the current page (`current`, rendered as text with `aria-current="page"`). Place inside `<ui-breadcrumb>`.

นำเข้า: `import '@purpurabog/ui/breadcrumb';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `''` |  |
| `current` | `boolean` | `false` | The page the user is on: plain text with `aria-current="page"`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The item text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link or the current-page text |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-breadcrumb-trailing-slash` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-link-hover` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-breadcrumb-skeleton>`

Carbon `BreadcrumbSkeleton` (`cds-breadcrumb-skeleton`): `items` bars of 100×16, each followed by the trail's "/" (not after the last with `no-trailing-slash`). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/breadcrumb';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | `number` | `3` |  |
| `no-trailing-slash` | `boolean` | `false` |  |
| `size` | `'sm' \| 'md'` | `'md'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `item` | Each bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-button>`

Carbon-style button (Carbon `Button`).

นำเข้า: `import '@purpurabog/ui/button';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `variant` |  |  | Same as `kind`, kept for teams used to `variant` (shadcn, MUI); `kind` is Carbon's name and the one in the docs |
| `kind` | `ButtonKind` | `'primary'` | Carbon `kind`: primary, secondary, tertiary, ghost, danger, danger-tertiary, danger-ghost. |
| `size` | `ButtonSize` | `'lg'` |  |
| `disabled` | `boolean` | `false` |  |
| `disabled-focusable` | `boolean` | `false` | Disabled, but still focusable: aria-disabled, ignores clicks — so a tooltip can explain why. |
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` |  |
| `full-width` | `boolean` | `false` | Stretch to the container width. |
| `icon-only` | `boolean` | `false` | Square button (as wide as it is tall, no padding) with its content centred: put the icon in the `prefix` slot and leave the label empty — nothing is hidden for you. Set `label` for its name; it shows no tooltip (use `<ui-icon-button>` for one). |
| `label` | `string` | `''` | Accessible name; required when the button shows only an icon. |
| `description` | `string` | `''` | Accessible description (set by ui-tooltip). |
| `danger-description` | `string` | `''` | Carbon `dangerDescription`: read after the name of a danger kind (danger, danger-tertiary, danger-ghost), e.g. "Deletes the contract for good". Empty by default, as Carbon v11 (React `ButtonBase`, WC `cds-button`). |
| `href` | `string` | `''` | Render as a link. |
| `target` | `'_self' \| '_blank'` | `'_self'` |  |
| `loading` | `boolean` | `false` | Busy: looks disabled with a spinner, ignores clicks, keeps focus, announces `loading-label`. |
| `loading-label` | `string` | `''` | What `loading` announces (default: `loading-text`, else the translation's "Loading"). |
| `loading-position` | `ButtonLoadingPosition` | `'end'` | Where the spinner goes (MUI `loadingPosition`): `end` (Carbon ActionSet), `start`, `center`. |
| `loading-text` | `string` | `''` | Shown in the label's place while loading, e.g. "Saving…" (Carbon Modal `loadingDescription`). |
| `pressed` | `boolean \| undefined` |  | Toggle-button state; leave unset for a normal button. |
| `haspopup` | `string` | `''` | The button opens a popup: rendered as `aria-haspopup` (e.g. `menu`, `listbox`, `dialog`). |
| `expanded` | `boolean \| undefined` |  | Whether the popup / disclosed content is open (`aria-expanded`); left unset, only a `haspopup` button reports it. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `variant` | `ButtonKind` | Same as `kind` (permanent alias for teams used to `variant`); a `variant` attribute works too. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Label |
| `prefix` | Leading icon |
| `suffix` | Trailing icon (e.g. the ghost-button chevron) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The native button or link |
| `prefix` | The leading icon slot |
| `suffix` | The trailing icon slot |
| `loading` | The spinner's place: at the end, the start or the centre (`loading` only; not when it takes the label's place) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-blue-60` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-button-align` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-button-gap` | `(ตามบริบท)` |
| `--ui-button-ghost-justify` | `(ตามบริบท)` |
| `--ui-button-ghost-padding-end` | `(ตามบริบท)` |
| `--ui-button-height-2xl` | `(ตามบริบท)` |
| `--ui-button-height-lg` | `(ตามบริบท)` |
| `--ui-button-height-xl` | `(ตามบริบท)` |
| `--ui-button-justify` | `(ตามบริบท)` |
| `--ui-button-padding-2xl` | `(ตามบริบท)` |
| `--ui-button-padding-end` | `(ตามบริบท)` |
| `--ui-button-padding-start` | `(ตามบริบท)` |
| `--ui-button-padding-top` | `(ตามบริบท)` |
| `--ui-button-padding-xl` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-secondary` | `(ตามบริบท)` |
| `--ui-button-secondary-active` | `(ตามบริบท)` |
| `--ui-button-secondary-border` | `(ตามบริบท)` |
| `--ui-button-secondary-hover` | `(ตามบริบท)` |
| `--ui-button-tall-align` | `(ตามบริบท)` |
| `--ui-button-tall-icon-offset` | `(ตามบริบท)` |
| `--ui-button-tall-padding-top` | `(ตามบริบท)` |
| `--ui-button-tertiary-active` | `(ตามบริบท)` |
| `--ui-button-tertiary-active-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border-width` | `(ตามบริบท)` |
| `--ui-button-tertiary-focus` | `(ตามบริบท)` |
| `--ui-button-tertiary-hover` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-button-tertiary-state-ink` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-active` | `(ตามบริบท)` |
| `--ui-error-hover` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-on-button-secondary` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-secondary` | `(ตามบริบท)` |
| `--ui-secondary-active` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-button-set>`

Carbon `ButtonSet`: buttons side by side (or `stacked`), each up to 196px wide, with a 1px button-separator line between neighbours — the footer of a form, side panel or tearsheet. Put `<ui-button>`s inside, the secondary one first.

นำเข้า: `import '@purpurabog/ui/button-set';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `stacked` | `boolean` | `false` | One button per row (Carbon `stacked`), e.g. in a narrow side panel. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The buttons |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `button-set` | The slot that holds the buttons (Carbon's part); the row itself is the element, so style its layout on `ui-button-set` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-button-separator` | `(ตามบริบท)` |
| `--ui-button-set-gap` | `(ตามบริบท)` |
| `--ui-button-set-item-size` | `(ตามบริบท)` |
| `--ui-button-set-separator` | `(ตามบริบท)` |

## `<ui-button-skeleton>`

Carbon `ButtonSkeleton` (`cds-button-skeleton`): a 150px bar at the button's height (sm 32 / md 40 / lg 48 / xl 64 / 2xl 80px). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/button';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `ButtonSize` | `'lg'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `bone` | The bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-blue-60` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-button-align` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-button-gap` | `(ตามบริบท)` |
| `--ui-button-ghost-justify` | `(ตามบริบท)` |
| `--ui-button-ghost-padding-end` | `(ตามบริบท)` |
| `--ui-button-height-2xl` | `(ตามบริบท)` |
| `--ui-button-height-lg` | `(ตามบริบท)` |
| `--ui-button-height-xl` | `(ตามบริบท)` |
| `--ui-button-justify` | `(ตามบริบท)` |
| `--ui-button-padding-2xl` | `(ตามบริบท)` |
| `--ui-button-padding-end` | `(ตามบริบท)` |
| `--ui-button-padding-start` | `(ตามบริบท)` |
| `--ui-button-padding-top` | `(ตามบริบท)` |
| `--ui-button-padding-xl` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-secondary` | `(ตามบริบท)` |
| `--ui-button-secondary-active` | `(ตามบริบท)` |
| `--ui-button-secondary-border` | `(ตามบริบท)` |
| `--ui-button-secondary-hover` | `(ตามบริบท)` |
| `--ui-button-tall-align` | `(ตามบริบท)` |
| `--ui-button-tall-icon-offset` | `(ตามบริบท)` |
| `--ui-button-tall-padding-top` | `(ตามบริบท)` |
| `--ui-button-tertiary-active` | `(ตามบริบท)` |
| `--ui-button-tertiary-active-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border-width` | `(ตามบริบท)` |
| `--ui-button-tertiary-focus` | `(ตามบริบท)` |
| `--ui-button-tertiary-hover` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-button-tertiary-state-ink` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-active` | `(ตามบริบท)` |
| `--ui-error-hover` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-on-button-secondary` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-secondary` | `(ตามบริบท)` |
| `--ui-secondary-active` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-calendar>`

Modern, accessible calendar month grid following the WAI-ARIA APG "Date Picker Dialog" grid model. Inspired by Cally: - Single date, range date, and multi-date selection (`multi`) - Multi-month side-by-side view (`months`, 1 to 12; `page-by="single"` turns one month at a time) - Cally's heading selects (`<ui-calendar-select-month>`, `<ui-calendar-select-year>`; slot `heading` for your own) - Cally's options: `show-outside-days`, `show-week-numbers`, `weekday-format`, `today`, `getDayParts`; ←/→ swap right-to-left - Fully round circular days and seamless continuous range ribbons - Rich CSS parts for deep customization

นำเข้า: `import '@purpurabog/ui/calendar';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `string` | `''` | Chosen day (start day in range mode), ISO yyyy-mm-dd. |
| `end-value` | `string` | `''` | Range mode: chosen end day, ISO yyyy-mm-dd. |
| `range` | `boolean` | `false` | Whether range selection is enabled. |
| `multi` | `boolean` | `false` | Multi-date selection mode: select multiple individual dates (like Cally's calendar-multi). |
| `values` | `string[] \| string` | `[]` | Selected dates in multi mode (array or comma/space-separated ISO string). |
| `months` | `number` | `1` | Months on show side by side, 1 to 12 (default 1; 12 paged by the page is a calendar year, from January). |
| `page-by` | `'months' \| 'single'` | `'months'` | With more than one month, ‹ › and the keys turn a whole page (`months`, the default) or one month (`single`), as Cally's `page-by`. |
| `show-outside-days` | `boolean` | `false` | Show the days of the months before and after, in six weeks (Cally `show-outside-days`); by default they are blank and only the weeks the month needs show. Several months never show them. |
| `show-week-numbers` | `boolean` | `false` | A column of ISO week numbers before the weeks (Cally `show-week-numbers`). |
| `weekday-format` | `'narrow' \| 'short' \| ''` | `''` | Weekday headings `narrow` (S / อา) or `short` (Sun / อา.); by default narrow in Thai, short otherwise (Cally `format-weekday`). |
| `today` | `string` | `''` | The day marked as today, ISO (default the real today): for tests, demos and another time zone (Cally `today`). |
| `active-field` | `'start' \| 'end'` | `'start'` | Range mode: which end a pick will set; drives the preview highlight. |
| `min` | `string` | `''` | Minimum selectable ISO date. |
| `max` | `string` | `''` | Maximum selectable ISO date. |
| `locale` | `string` | `''` | BCP 47 locale for names and labels. Defaults to the nearest `lang`. |
| `era` | `Era \| ''` | `''` | Year era: `be` (พ.ศ.) or `ce` (ค.ศ.). Defaults to `be` for Thai locales. |
| `first-day` | `number` | `0` | 0 = Sunday … 6 = Saturday. |
| `show-today` | `boolean` | `false` | Whether to display the "Today" footer shortcut button. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `getDayParts` | `(date: Date) => string \| undefined` | Extra `part` names for a day, e.g. `holiday` (Cally `getDayParts`). |
| `focusDate` |  | Day that holds the roving tab stop; its month is shown. |
| `isDateDisabled` | `(date: Date) => boolean \| string \| undefined` | Callback to disable individual dates (e.g. weekends, holidays). |
| `multiValues` | `string[]` | Selected dates as clean ISO array in multi mode. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `previous` | Replaces the previous button's arrow icon |
| `next` | Replaces the next button's arrow icon |
| `heading` | Replaces the month and year selects; `<ui-calendar-select-month>` / `<ui-calendar-select-year>` put here follow the calendar |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `months` | Multi-month layout container |
| `month-view` | Container of a single month |
| `month-title` | A month's name above its grid when two months show (the header then has the year only) |
| `header` | Month / year row container |
| `nav` | Previous / next navigation buttons |
| `prev-button` | The previous month button |
| `next-button` | The next month button |
| `heading` | The month and year selects' row (the `heading` slot) |
| `month-select` | The default heading's month select (`<ui-calendar-select-month>`'s `select`) |
| `year-select` | The default heading's year select (`<ui-calendar-select-year>`'s `select`) |
| `grid` | The table grid of days |
| `table` | The table grid of days |
| `thead` | The table header row with weekday labels |
| `th` | Individual weekday heading cell (also `day-N`, 0 = Sunday; the week-number heading also `weeknumber`) |
| `weeknumber` | A week-number cell (`show-week-numbers`) |
| `tbody` | The table body of weeks |
| `row` | Each week table row |
| `cell` | Each day table cell |
| `day` | Each day button; its state adds `day-N` (0 = Sunday), `selected`, `today`, `outside` (another month), `disabled` (before `min` / after `max`), `disallowed` (refused by `isDateDisabled`), `range-start`, `range-end`, `in-range`, and the names `getDayParts` returns |
| `today-button` | The optional "Today" footer button |
| `footer` | The footer container |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-page-change` | Detail `{ start, end }`, the first and last day shown after the months on show changed (Cally `pagechange`) |
| `ui-multi-pick` | Detail `{ date, values }`, in multi mode when a day is toggled |
| `change` | Detail `{ value, endValue, values }`, native-like change event on a pick (with `range`, once both ends are picked) |
|  |  |
| `ui-pick` | Detail `{ date }`, when a day is activated |
| `ui-focus-change` | Detail `{ date }`, when keyboard or navigation moves the focused date |
| `ui-range-start` | Detail `{ date }`, with `range`: the first end was picked (Cally `rangestart`) |
| `ui-range-end` | Detail `{ date }`, with `range`: the second end was picked (Cally `rangeend`) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-calendar-day-duration` | `(ตามบริบท)` |
| `--ui-calendar-day-focus` | `(ตามบริบท)` |
| `--ui-calendar-day-focus-background` | `(ตามบริบท)` |
| `--ui-calendar-day-radius` | `(ตามบริบท)` |
| `--ui-calendar-selected-focus` | `(ตามบริบท)` |
| `--ui-calendar-selected-focus-layer` | `(ตามบริบท)` |
| `--ui-calendar-selected-focus-offset` | `(ตามบริบท)` |
| `--ui-calendar-selected-focus-width` | `(ตามบริบท)` |
| `--ui-calendar-today-dot-radius` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-radius` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-highlight` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-helper` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-2` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-sm` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-calendar-select-month>`

The month select of `<ui-calendar>`'s heading (Cally `calendar-select-month`): the months of the year shown, those wholly outside `min` / `max` off. `<ui-calendar>` shows one by default; put your own in its `heading` slot.

นำเข้า: `import '@purpurabog/ui/calendar';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `format-month` | `'long' \| 'short'` | `'long'` | Month names `long` (October) or `short` (Oct), as Cally's `format-month`. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `view` | `CalendarHeadingView \| undefined` | Set by the enclosing `<ui-calendar>` (its own heading, or the elements slotted into its `heading` slot). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Replaces the label (default: the calendar's "Month") |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The visually hidden label |
| `select` | The native select |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-focus-day` | Detail `{ date }`, a month was chosen: the enclosing calendar moves its focus there |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-sm` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-calendar-select-year>`

The year select of `<ui-calendar>`'s heading (Cally `calendar-select-year`): `max-years` years around the year shown, cut to those `min` / `max` allow, in the calendar's era (พ.ศ. in Thai). `<ui-calendar>` shows one by default; put your own in its `heading` slot.

นำเข้า: `import '@purpurabog/ui/calendar';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `max-years` | `number` | `20` | How many years to offer, around the year shown (Cally's `max-years`, default 20). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `view` | `CalendarHeadingView \| undefined` | Set by the enclosing `<ui-calendar>` (its own heading, or the elements slotted into its `heading` slot). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Replaces the label (default: the calendar's "Year") |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The visually hidden label |
| `select` | The native select |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-focus-day` | Detail `{ date }`, a year was chosen: the enclosing calendar moves its focus there |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-sm` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-card>`

Carbon `Card` (preview in Carbon, `cds-card`): a `$layer` box — no border, no shadow, square — built from parts: `<ui-card-media>`, `<ui-card-header>` (with `<ui-card-header-media>`, `<ui-card-title-media>`, `<ui-card-title>`, `<ui-card-actions>`), `<ui-card-body>` and `<ui-card-footer>` (with `<ui-card-action>`s). It follows the `<ui-layer>` it sits on.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `''` | Makes the whole card one link. |
| `target` | `'_self' \| '_blank'` | `'_self'` |  |
| `clickable` | `boolean` | `false` | Makes the whole card one button (listen for `click`). |
| `selected` | `boolean \| undefined` |  | A clickable card shown chosen, as a checked selectable tile, with `aria-pressed` (beyond Carbon; the app toggles it). |
| `hide-footer-icon` | `boolean` | `false` | Removes the clickable card's arrow footer (beyond Carbon). |
| `disabled` | `boolean` | `false` |  |
| `label` | `string` | `''` | The accessible name of a linked or clickable card (Carbon asks for one). |
| `density` | `CardDensity` | `'productive'` |  |
| `horizontal` | `boolean` | `false` |  |
| `media-position` | `'start' \| 'end'` | `'start'` | Where a horizontal card's media goes. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The parts |
| `media` | (filled for you) the media of a horizontal card |
| `footer-icon` | Replaces the clickable card's arrow |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The card (`<div>`, or `<a>` with `href`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of a linked card; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-border-tile-1` | `(ตามบริบท)` |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-border` | `(ตามบริบท)` |
| `--ui-card-clickable-border` | `(ตามบริบท)` |
| `--ui-card-overflow` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-font-subhead` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-highlight` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-interactive` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tile-selected-background` | `(ตามบริบท)` |
| `--ui-tile-selected-border` | `(ตามบริบท)` |
| `--ui-tile-selected-hover` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-card-action>`

One action (Carbon `CardAction`): in the footer a `<ui-button>` stretches to share the row and a `<ui-icon-button>` keeps its size at the end; in `<ui-card-actions>` it is one of the header's buttons.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Its name in the header's overflow menu (else the button's label or text). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | A `<ui-button>` or `<ui-icon-button>` |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-card-actions>`

The header's actions (Carbon `CardActions`): small buttons in the top-end corner, 4px apart, in at most half the header; those that don't fit move to an overflow menu (choosing an item clicks that action's button).

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `overflow-menu-label` | `string` | `''` | The overflow menu's name (default: the translation's "More actions"). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-card-action>`s, each with a small `<ui-icon-button>` (or `<ui-button size="sm">`) |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |

## `<ui-card-body>`

The card's body (Carbon `CardBody`): body-compact-01 with 16px padding, or none with `is-flush`.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `is-flush` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-card-footer>`

The card's footer (Carbon `CardFooter`): content with 16px padding, or a row of `<ui-card-action>`s across the card under a `border-subtle` line (buttons stretch, icon buttons sit at the end). Not in a linked or clickable card.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Content or `<ui-card-action>`s |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-card-actions-gap` | `(ตามบริบท)` |
| `--ui-card-actions-padding` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |

## `<ui-card-header>`

The card's header (Carbon `CardHeader`): media, title media, the title and its actions on a grid.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-card-header-media>`, `<ui-card-title-media>`, `<ui-card-title>`, `<ui-card-actions>` |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-card-header-media>`

Media across the top of the header (Carbon `CardHeaderMedia`), e.g. a pictogram; 16px in, at most 64px tall.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The media |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-space-md` | `(ตามบริบท)` |

## `<ui-card-media>`

The card's media (Carbon `CardMedia`): an image or video filling the card's width at `ratio`; beside the content in a horizontal card, `media-width` wide.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `ratio` | `CardMediaRatio \| ''` | `''` |  |
| `media-width` | `string` | `'33.33%'` | A horizontal card's media width (Carbon's default 33.33%). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | An `<img>`, `<video>`, … |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-card-title>`

The card's title (Carbon `CardTitle`): an optional label above, the title (heading-compact-02, or heading-03 in an expressive card) and an optional description below, each of them truncatable.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `description` | `string` | `''` |  |
| `title-truncate` | `string \| null` | `null` |  |
| `label-truncate` | `string \| null` | `null` |  |
| `description-truncate` | `string \| null` | `null` |  |
| `max-width` | `string` | `'100%'` | A truncated title's widest. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The title text |
| `label` | Replaces `label` |
| `description` | Replaces `description` |
| `title-start` | An icon before the title |
| `title-end` | An icon after the title |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-card-title-media>`

Media before the title (Carbon `CardTitleMedia`), e.g. a 48–64px logo.

นำเข้า: `import '@purpurabog/ui/card';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The media |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-space-md` | `(ตามบริบท)` |

## `<ui-checkbox>`

Carbon-style checkbox. Wraps a native checkbox (kept in the accessibility tree, visually replaced by a 16px square) inside a `<label>`, so the whole row is clickable.

นำเข้า: `import '@purpurabog/ui/checkbox';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `checked` | `boolean` | `false` |  |
| `indeterminate` | `boolean` | `false` | Mixed state, e.g. a "select all" box with some children checked. Cleared on user toggle. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `hide-label` | `boolean` | `false` | Keep the label text for screen readers but don't show it. |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `value` | `string` | `'on'` |  |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `groupDisabled` | `boolean` | Set by ui-checkbox-group; kept apart from the author's own disabled / readonly. |
| `groupReadonly` | `boolean` |  |
| `groupMessage` | `string` | Error text of the owning ui-checkbox-group while the group is invalid. The group shows it once below the boxes; each box repeats it as its own accessible description and reports aria-invalid, so a screen reader landing on the first box hears why (an IDREF cannot cross the group's shadow root). |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Label text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The clickable row (label element) |
| `control` | The native checkbox input |
| `box` | The drawn 16px box |
| `label` | The text beside the box |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When the user toggles the box |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-checkbox-group>`

A labelled group of `<ui-checkbox>` or `<ui-selectable-tile>` (Carbon checkbox group), exposed as role="group" with the label as its name and the helper / warning / error text as its description.

นำเข้า: `import '@purpurabog/ui/checkbox';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the group label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `required-text` | `string` | `''` | Error for an empty required group. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-checkbox>` or `<ui-selectable-tile>` elements |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The group box holding the checkboxes |
| `label` | The group label |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-checkbox-skeleton>`

Carbon `CheckboxSkeleton` (`cds-checkbox-skeleton`): an empty 16px box and a 100×16 label bar. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/checkbox';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `box` | The empty box |
| `label` | The label bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-code-snippet>`

Carbon `CodeSnippet`. `type="single"`: one 40px line that scrolls sideways, read-only textbox, copy button at the end. `type="multi"`: a block collapsed to at most `max-collapsed-rows` (15 × 16px) with a "Show more" / "Show less" button when longer, copy button top-right, optional `wrap-text`. `type="inline"`: a `<code>` chip that is itself the copy button (or plain with `hide-copy-button`). The copied text is `text`, else the slotted content.

นำเข้า: `import '@purpurabog/ui/code-snippet';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `type` | `CodeSnippetType` | `'single'` |  |
| `text` | `string` | `''` | Text to copy instead of the slotted content. |
| `label` | `string` | `''` | Accessible name of the read-only textbox (single / multi); inline: the copy button's tooltip and description (the button is named by its code, WCAG 2.5.3). |
| `copy-label` | `string` | `''` | Tooltip of the copy button (single / multi). |
| `feedback` | `string` | `''` |  |
| `feedback-timeout` | `number` | `2000` |  |
| `placement` | `TooltipPlacement` | `'bottom'` |  |
| `hide-copy-button` | `boolean` | `false` |  |
| `wrap-text` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` |  |
| `expanded` | `boolean` | `false` |  |
| `show-more-text` | `string` | `''` |  |
| `show-less-text` | `string` | `''` |  |
| `max-collapsed-rows` | `number` | `15` | Rows (16px) visible while collapsed; 0 = no limit. |
| `max-expanded-rows` | `number` | `0` | Rows visible while expanded; 0 = no limit. |
| `min-collapsed-rows` | `number` | `3` |  |
| `min-expanded-rows` | `number` | `16` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `copyText` |  | What gets copied: `text`, else the slotted code. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The code |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `container` | Scrolling container (single) / `<pre>` wrapper (multi) |
| `code` | The `<code>` element |
| `copy-button` | The `<ui-copy-button>` (single / multi) |
| `expand-button` | The "Show more / less" button (multi) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded } when "Show more / less" is used |
| `ui-copy` | detail: { text }; cancelable |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-code-background` | `(ตามบริบท)` |
| `--ui-code-radius` | `(ตามบริบท)` |
| `--ui-copy-button-background` | `(ตามบริบท)` |
| `--ui-copy-button-radius` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-code` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-tracking-code` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-code-snippet-skeleton>`

Carbon `CodeSnippetSkeleton` (`cds-code-snippet-skeleton`): a layer box, 56px tall with one 16px bar (`single`), or 98px with three lines at 100 / 85 / 95% (`multi`). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/code-snippet';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `type` | `'single' \| 'multi'` | `'single'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The box |
| `line` | Each bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |

## `<ui-column>`

Carbon `Column` (`cds-column`): a grid item, `sm` `md` `lg` `xlg` `max` setting its span from that breakpoint up — a number (`lg="4"`, 0 hides it), a percent of the grid (`"25%"` … `"100%"`), empty for auto, or tokens `"span:4 start:3"`, `"span:2 end:9"`, `"offset:2 span:4"`; `span` for every breakpoint. Placement settles as in Carbon's stylesheet (core/css-grid). A `<ui-grid>` inside becomes a subgrid of its span.

นำเข้า: `import '@purpurabog/ui/grid';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `sm` | `string \| undefined` |  |  |
| `md` | `string \| undefined` |  |  |
| `lg` | `string \| undefined` |  |  |
| `xlg` | `string \| undefined` |  |  |
| `max` | `string \| undefined` |  |  |
| `span` | `string \| undefined` |  | The span at every breakpoint (Carbon `span`). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The column's content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-grid-gutter-end` | `(ตามบริบท)` |
| `--ui-grid-gutter-start` | `(ตามบริบท)` |

## `<ui-column-hang>`

Carbon `ColumnHang` (`cds-column-hang`): content inside a narrow or condensed column that lines up with the text of wide columns (pushed in by the hang: 16px narrow, 15.5px condensed, none wide).

นำเข้า: `import '@purpurabog/ui/grid';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-grid-column-hang` | `(ตามบริบท)` |

## `<ui-combo-button>`

Carbon `ComboButton`: a primary action button next to a chevron that opens a `<ui-menu>` of secondary actions. The primary button fires `ui-click` (Carbon `onClick`; a plain `click` on the element also bubbles from the chevron and the menu items); menu items fire `ui-select`. Sizes sm / md / lg; `placement` bottom (menu as wide as the whole control) or top / -start / -end.

นำเข้า: `import '@purpurabog/ui/combo-button';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `label` | `string` | `''` | Primary action text. |
| `size` | `Exclude<ButtonSize, 'xl' \| '2xl'>` | `'lg'` | sm 32 / md 40 / lg 48px (Carbon has no xl / 2xl here). |
| `placement` | `MenuPlacement` | `'bottom'` |  |
| `tooltip-placement` | `TooltipPlacement` | `'bottom'` |  |
| `trigger-label` | `string` | `''` | Name of the chevron button; defaults to the translation ("Additional actions"). |
| `disabled` | `boolean` | `false` |  |
| `open` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-menu-item>` elements (secondary actions) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `primary` | The primary `<ui-button>` |
| `trigger` | The chevron `<ui-icon-button>` |
| `menu` | The `<ui-menu>` |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-click` | the primary button was activated (not the chevron or a menu item) |
| `ui-select` | bubbles from the activated item |
| `ui-toggle` | detail: { open } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-blue-60` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-button-align` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-button-gap` | `(ตามบริบท)` |
| `--ui-button-ghost-justify` | `(ตามบริบท)` |
| `--ui-button-ghost-padding-end` | `(ตามบริบท)` |
| `--ui-button-height-2xl` | `(ตามบริบท)` |
| `--ui-button-height-lg` | `(ตามบริบท)` |
| `--ui-button-height-xl` | `(ตามบริบท)` |
| `--ui-button-justify` | `(ตามบริบท)` |
| `--ui-button-padding-2xl` | `(ตามบริบท)` |
| `--ui-button-padding-end` | `(ตามบริบท)` |
| `--ui-button-padding-start` | `(ตามบริบท)` |
| `--ui-button-padding-top` | `(ตามบริบท)` |
| `--ui-button-padding-xl` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-secondary` | `(ตามบริบท)` |
| `--ui-button-secondary-active` | `(ตามบริบท)` |
| `--ui-button-secondary-border` | `(ตามบริบท)` |
| `--ui-button-secondary-hover` | `(ตามบริบท)` |
| `--ui-button-tall-align` | `(ตามบริบท)` |
| `--ui-button-tall-icon-offset` | `(ตามบริบท)` |
| `--ui-button-tall-padding-top` | `(ตามบริบท)` |
| `--ui-button-tertiary-active` | `(ตามบริบท)` |
| `--ui-button-tertiary-active-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border-width` | `(ตามบริบท)` |
| `--ui-button-tertiary-focus` | `(ตามบริบท)` |
| `--ui-button-tertiary-hover` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-button-tertiary-state-ink` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-active` | `(ตามบริบท)` |
| `--ui-error-hover` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-max-width` | `(ตามบริบท)` |
| `--ui-menu-min-width` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-on-button-secondary` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-secondary` | `(ตามบริบท)` |
| `--ui-secondary-active` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-combobox>`

Carbon-style combo box: a text box with a filterable list (Carbon `ComboBox`, built on downshift's useCombobox). The counterpart of ui-dropdown for long lists, searching and server-side lookups.

นำเข้า: `import '@purpurabog/ui/combobox';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `placeholder` | `string` | `''` |  |
| `value` | `string` | `''` | Committed value: the chosen option's value, or free text with `allow-custom-value`. |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `direction` | `'bottom' \| 'top'` | `'bottom'` | Preferred side for the list; it flips when there is no room. |
| `filter` | `ComboboxFilter` | `'none'` |  |
| `allow-custom-value` | `boolean` | `false` | Keep text that matches no option as the value instead of snapping back. |
| `hide-clear` | `boolean` | `false` | No × button (Carbon always shows one while there is text); Escape on a closed list still clears. |
| `loading` | `boolean` | `false` | Shows a "Searching…" row while a server lookup is running. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidComboBox`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `inputValue` |  | What the user currently sees in the text box. |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `option-description` | Second line of an option (`<option data-description>`) |
| `base` | The field box |
| `label` | The label |
| `input` | The text box (role=combobox) |
| `clear-button` | The × button |
| `toggle` | The chevron button |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |
| `menu` | The floating list |
| `option` | Each row |
| `group-label` | An `<optgroup>` heading |
| `empty` | The "searching" / "no results" row |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(open)` | While its list or calendar is open (also `[data-open]`) |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |
| `:state(has-value)` | While it holds a value (also `[data-has-value]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } after the list opens or closes |
| `input` | Whenever `value` changes, as ui-dropdown and ui-multi-select; also native and composed as the user types, where `value` is unchanged (kept for compatibility: listen to `ui-input` for the typing) |
| `change` | When the committed value changes |
| `ui-input` | detail: { value } the typed text (`inputValue`), as the user types |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-helper` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-divider` | `(ตามบริบท)` |
| `--ui-menu-item-active-background` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-pressed` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-menu-item-selected` | `(ตามบริบท)` |
| `--ui-menu-item-selected-hover` | `(ตามบริบท)` |
| `--ui-menu-max-rows` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-row-divider` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-surface-2` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-contained-list>`

Carbon `ContainedList`: a titled list of rows separated by 1px rules, for settings panels, side panels and tiles. `kind="on-page"` (default) has a 48px heading-compact header on the page background; `kind="disclosed"` a 32px label-01 header on the layer. `size` sets the row height (sm 32 / md 40 / lg 48 / xl 64), `inset` shortens the rules to the padding. Put a `<ui-search>` or `<ui-icon-button>` in slot `action` for a header control. Beyond Carbon: `current` marks the whole list (the selected board among several): the side nav's start bar on the header and `aria-current="true"` on the `role=list` the label names.

นำเข้า: `import '@purpurabog/ui/contained-list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `kind` | `ContainedListKind` | `'on-page'` |  |
| `size` | `ContainedListSize` | `'lg'` |  |
| `inset` | `boolean` | `false` | Rules stop at the row padding instead of running edge to edge (Carbon `isInset`). |
| `current` | `boolean` | `false` | Beyond Carbon: the list the user is on, among several (`aria-current="true"` on the list, the side nav's fill and bar on the header). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-contained-list-item>` elements |
| `label` | Rich label |
| `action` | Header action (search, icon button) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `header` | The sticky header row |
| `label` | The label |
| `action` | The header action wrapper |
| `list` | The `role=list` container |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-radius` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-contained-list-item>`

One row of a `<ui-contained-list>` (Carbon `ContainedListItem`). Set `clickable` to make the row a button (fires `ui-click`; `disabled` greys it out); slot `icon` adds a 16px leading icon and slot `action` a trailing control (e.g. `<ui-icon-button>`) that stays interactive on its own. Beyond Carbon (which has no selected row): `current` marks the row the user is on, with the side nav's current-page look and `aria-current="true"` (on the button when `clickable`, else on the row).

นำเข้า: `import '@purpurabog/ui/contained-list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `clickable` | `boolean` | `false` | Render the row as a button. |
| `disabled` | `boolean` | `false` |  |
| `current` | `boolean` | `false` | Beyond Carbon: the row the user is on (`aria-current="true"`, the side nav's current-page look). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Row content |
| `icon` | 16px icon |
| `action` | Trailing action |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `content` | The row body (a button when `clickable`) |
| `action` | The action wrapper |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-click` | Clickable rows, when activated |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-radius` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-content>`

Carbon `Content`: the `<main id="main-content">` area, offset by the 48px header (and by a `fixed` or `rail` side nav). 32px padding.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Page content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing-exit` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-overlay` | `(ตามบริบท)` |

## `<ui-content-switcher>`

Carbon `ContentSwitcher`: a `tablist` of `<ui-content-switcher-item>`s where exactly one is selected. Click, or Left/Right (wrapping, skipping disabled items) select immediately; `selection-mode="manual"` moves focus only and Enter / Space selects. Home / End jump to the first / last item (APG). Sizes sm 32 / md 40 / lg 48px, full width with items shared evenly; `icon-only` (every item is `icon-only`) shrinks to fit. `low-contrast` renders the grey variant. Set `aria-label` on the host to name the group.

นำเข้า: `import '@purpurabog/ui/content-switcher';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `selected-index` | `number` | `0` |  |
| `size` | `ContentSwitcherSize` | `'md'` |  |
| `selection-mode` | `ContentSwitcherSelectionMode` | `'automatic'` |  |
| `low-contrast` | `boolean` | `false` |  |
| `icon-only` | `boolean` | `false` | Reflected by the switcher itself when every item is `icon-only`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-content-switcher-item>` elements |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-change` | detail: { index, name } after the user selects a different item |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-border-inverse` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-content-switcher-background` | `(ตามบริบท)` |
| `--ui-content-switcher-background-hover` | `(ตามบริบท)` |
| `--ui-content-switcher-border` | `(ตามบริบท)` |
| `--ui-content-switcher-divider` | `(ตามบริบท)` |
| `--ui-content-switcher-item-grow` | `(ตามบริบท)` |
| `--ui-content-switcher-item-radius` | `(ตามบริบท)` |
| `--ui-content-switcher-item-size` | `(ตามบริบท)` |
| `--ui-content-switcher-outline` | `(ตามบริบท)` |
| `--ui-content-switcher-padding` | `(ตามบริบท)` |
| `--ui-content-switcher-radius` | `(ตามบริบท)` |
| `--ui-content-switcher-selected` | `(ตามบริบท)` |
| `--ui-content-switcher-selected-fill` | `(ตามบริบท)` |
| `--ui-content-switcher-selected-ink` | `(ตามบริบท)` |
| `--ui-content-switcher-selected-shadow` | `(ตามบริบท)` |
| `--ui-content-switcher-track` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-content-switcher-item>`

One option of a `<ui-content-switcher>` (Carbon `Switch` / `IconSwitch`). The host is the `tab`: role, `aria-selected`, roving `tabindex` and the selection fill all live on it, so the switcher's `tablist` has real tabs as children.

นำเข้า: `import '@purpurabog/ui/content-switcher';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | `''` | Identifies the item in `ui-change` (Carbon `name`). |
| `label` | `string` | `''` | Accessible name — required with `icon-only`. |
| `selected` | `boolean` | `false` | Set by the switcher from its `selected-index` (it overwrites any value you set): read it or style on `[selected]`; select an item with the switcher's `selected-index`. |
| `disabled` | `boolean` | `false` |  |
| `icon-only` | `boolean` | `false` |  |
| `tooltip-placement` | `TooltipPlacement` | `'top'` | Where the `icon-only` tooltip shows (Carbon `align`, default top). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `focusable` | `boolean` | Set by the switcher: which item is the single tab stop (the selected one, or the first enabled one). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Label text |
| `icon` | A 16px icon (20px in `size="lg"`) before the text, or alone with `icon-only` + `label` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label wrapper |
| `tooltip` | The `<ui-tooltip>` of an `icon-only` item |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-border-inverse` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-content-switcher-background` | `(ตามบริบท)` |
| `--ui-content-switcher-background-hover` | `(ตามบริบท)` |
| `--ui-content-switcher-border` | `(ตามบริบท)` |
| `--ui-content-switcher-divider` | `(ตามบริบท)` |
| `--ui-content-switcher-item-grow` | `(ตามบริบท)` |
| `--ui-content-switcher-item-radius` | `(ตามบริบท)` |
| `--ui-content-switcher-item-size` | `(ตามบริบท)` |
| `--ui-content-switcher-selected` | `(ตามบริบท)` |
| `--ui-content-switcher-selected-fill` | `(ตามบริบท)` |
| `--ui-content-switcher-selected-ink` | `(ตามบริบท)` |
| `--ui-content-switcher-selected-shadow` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-copy-button>`

Carbon `CopyButton`: a 40px (`size="sm"`: 32px) layer-coloured icon button, named by an icon tooltip, that copies `text` and shows `feedback` ("Copied!") in that tooltip for `feedback-timeout` ms. Fires `ui-copy` (cancelable: `preventDefault()` to copy yourself).

นำเข้า: `import '@purpurabog/ui/copy-button';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `text` | `string` | `''` | What gets copied. |
| `label` | `string` | `''` | Accessible name / tooltip at rest. |
| `feedback` | `string` | `''` | Tooltip text after copying. |
| `feedback-timeout` | `number` | `2000` |  |
| `placement` | `TooltipPlacement` | `'bottom'` |  |
| `size` | `'sm' \| 'md'` | `'md'` |  |
| `disabled` | `boolean` | `false` |  |
| `data-copied` | `boolean` | `false` | True while the feedback is showing. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `button` | The native button |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-copy` | detail: { text }; cancelable |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-copy-button-background` | `(ตามบริบท)` |
| `--ui-copy-button-radius` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-date-field>`

One text box of ui-date-picker: label, text input, hidden OS date input, status icon, optional clear button, calendar icon and message. The icon is decorative as in Carbon (`cds--date-picker__icon`, pointer-events none): a click on it is a click on the text box, and it is not a Tab stop. Purely presentational — the picker owns the text, the value and every rule; this element just renders what it is given and reports clicks.

นำเข้า: `import '@purpurabog/ui/date-picker';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `input-id` | `string` | `''` | Id of the text input (the picker keeps ids unique across its fields). |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` |  |
| `label-slotted` | `boolean` | `false` | The owner forwards a `label` slot with content, so the label row renders even when `label` is empty. |
| `text` | `string` | `''` | What the text box shows. |
| `value` | `string` | `''` | Committed ISO value, for the hidden OS date input. |
| `pattern` | `string` | `''` | Placeholder, e.g. วว/ดด/ปปปป. |
| `hint` | `string` | `''` | Format hint for screen readers when the helper line shows the author's text instead. |
| `show-error` | `boolean` | `false` |  |
| `show-clear` | `boolean` | `false` |  |
| `expanded` | `boolean` | `false` | The calendar is open for this field. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. Reflected: the label and helper grey out (see date-field.styles.ts). |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `min` | `string` | `''` |  |
| `max` | `string` | `''` |  |
| `clear-label` | `string` | `''` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `outsideName` | `string` | The date picker's name from outside (`aria-label`, a `<label for>`) while it has no `label`: an unseen label. |
| `message` | `FieldMessage \| null` |  |
| `controls` | `Element \| null` | The calendar dialog the box opens (`aria-controls`; an element, since it lives in the picker's shadow root). |
| `input` | `HTMLInputElement` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box |
| `label` | The label |
| `input` | The text box |
| `clear-button` | The × button |
| `toggle` | The calendar icon (decorative) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `name` |  |
| `ui-focus` | detail `{ from }`: the text box gained focus from `from` (may be null) |
| `ui-blur` | detail `{ next }`: the text box lost focus to `next` (may be null) |
| `ui-clear` | The clear (×) button was pressed |
| `ui-native-change` | detail `{ iso }`, the OS date picker chose a day |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-date-picker>`

Carbon-style date picker following the WAI-ARIA APG "Date Picker Dialog" pattern. Each text box is a `<ui-date-field>` (date-field.ts) and the month grid a `<ui-calendar>` (calendar.ts); this element owns the state, the popover, typed-input rules, range rules and validation.

นำเข้า: `import '@purpurabog/ui/date-picker';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `value` | `string` | `''` | ISO yyyy-mm-dd (the start date in `range` mode). |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `range` | `boolean` | `false` | Two fields sharing one calendar (Carbon `datePickerType="range"`). |
| `end-value` | `string` | `''` | Range mode: the end date, ISO yyyy-mm-dd. |
| `end-name` | `string` | `''` | Range mode: form entry name of the end date. Without it the range submits as one `name` entry `start/end`. |
| `end-label` | `string` | `''` | Range mode: label of the end field. |
| `min` | `string` | `''` | Earliest selectable date, ISO yyyy-mm-dd. |
| `max` | `string` | `''` | Latest selectable date, ISO yyyy-mm-dd. |
| `format` | `DateFormat` | `'dd/mm/yyyy'` |  |
| `locale` | `string` | `''` | Locale for names, labels and messages. Defaults to the nearest `lang`: the element's own, an ancestor's, then `<html>`'s, else the browser language. |
| `era` | `Era \| ''` | `''` | Year era shown and typed: `be` (พ.ศ.) or `ce` (ค.ศ.). Defaults to `be` for Thai locales. |
| `first-day` | `number` | `0` | 0 = Sunday … 6 = Saturday. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidDatePicker`: each date box is a 64px box with its label inside. `<ui-fluid-form>` sets it for every field inside. |
| `picker` | `'auto' \| 'custom' \| 'sheet' \| 'native'` | `'auto'` | Which picker opens: `auto` (default) = our calendar, in a bottom sheet on a phone; `custom` = our calendar as a popover on every device; `sheet` = in a bottom sheet on every device; `native` = the OS date picker. |
| `clearable` | `boolean` | `false` | Shows a clear button inside the field while it has text. |
| `show-today` | `boolean` | `false` | Adds a "Today" button under the calendar. |
| `months` | `number` | `1` | Months to show side by side in the calendar, 1 to 12 (default 1, e.g. 2 for range picking). |
| `page-by` | `'months' \| 'single'` | `'months'` | With more than one month, ‹ › turn a whole page (`months`) or one month (`single`): the calendar's `page-by`. |
| `show-outside-days` | `boolean` | `false` | Show the days of the months before and after (by default they are blank): the calendar's `show-outside-days`. |
| `show-week-numbers` | `boolean` | `false` | A column of ISO week numbers in the calendar: its `show-week-numbers`. |
| `weekday-format` | `'narrow' \| 'short' \| ''` | `''` | Weekday headings `narrow` or `short`: the calendar's `weekday-format`. |
| `today` | `string` | `''` | The day the calendar marks as today, ISO (default the real today). |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field height, same scale as ui-text-input. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `getDayParts` | `(date: Date) => string \| undefined` | Extra `part` names for a calendar day, e.g. `holiday`: the calendar's `getDayParts`; the picker exports each name it returns, so `ui-date-picker::part(holiday)` styles those days. |
| `isDateDisabled` | `(date: Date) => boolean \| string \| undefined` | Property only. Return `true` for days that can't be chosen (weekends, holidays…), or a string to show that reason instead of the generic message. |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |
| `end-label` | Label of the end field in range mode; overrides `end-label` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box (range: also `start-base` / `end-base`; same for every field part) |
| `label` | The label |
| `input` | The text box |
| `clear-button` | The × button |
| `toggle` | The calendar icon (decorative, as Carbon) |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |
| `calendar` | The popover shell (in the bottom sheet: the sheet's panel) |
| `sheet` | The bottom sheet `<dialog>` on a phone (`picker="auto"` / `sheet`; style its scrim with `::part(sheet)::backdrop`) |
| `sheet-grip` | The sheet's top bar, which a swipe down closes |
| `sheet-close` | The sheet's × button |
| `header` | Calendar month / year row |
| `nav` | Previous / next month buttons |
| `heading` | The month and year selects' row |
| `month-select` | The month select (`<ui-calendar-select-month>`'s select) |
| `year-select` | The year select (`<ui-calendar-select-year>`'s select) |
| `month-title` | A month's name over its grid when several show |
| `grid` | The table of days |
| `day` | Each day button (its state also: `selected`, `today`, `outside`, `disabled`, `disallowed`, `range-start`, `range-end`, `in-range`, and the names `getDayParts` returns) |
| `weeknumber` | A week-number cell (`show-week-numbers`) |
| `today-button` | The optional "Today" button |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(open)` | While its list or calendar is open (also `[data-open]`) |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When a committed value (start or end) changes: blur, Enter, a calendar pick or clear. |
| `ui-range-start` | Detail `{ date }`, `range`: a calendar pick began a range (its start), as Cally's `rangestart`; `change` waits for the end |
| `ui-range-end` | Detail `{ date }`, `range`: a calendar pick finished a range (its end), as Cally's `rangeend` A typed date outside min/max is still committed, with the field reporting the range error. |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-calendar-border` | `(ตามบริบท)` |
| `--ui-calendar-padding` | `(ตามบริบท)` |
| `--ui-calendar-radius` | `(ตามบริบท)` |
| `--ui-calendar-shadow` | `(ตามบริบท)` |
| `--ui-calendar-width` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-duration-moderate-02` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-modal-scrim` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-sheet-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-date-picker-skeleton>`

Carbon `DatePickerSkeleton` (`cds-date-picker-input-skeleton`): the shape of a `<ui-date-picker>` while its data loads — a 75×14 label bar, 8px, a 143.5px field bar; `range` draws two, 1px apart (Carbon React). Hidden from assistive tech. `fluid` (Carbon `FluidDatePickerSkeleton`): a 64px box with the two bars and the calendar icon 16px from the end and bottom; `range` splits it in halves with a 1px line between.

นำเข้า: `import '@purpurabog/ui/date-picker';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `range` | `boolean` | `false` | Start and end inputs. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The field's height: sm 32px, md 40px, lg 48px. |
| `hide-label` | `boolean` | `false` | No label bar (the field had `hide-label`). |
| `fluid` | `boolean` | `false` | The fluid field's skeleton (Carbon `Fluid*Skeleton`): a 64px box with two bars; `<ui-fluid-form>` sets it. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Each label bar |
| `field` | Each field bar (fluid: the box) |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-definition-tooltip>`

Carbon `DefinitionTooltip`: a term with a dotted underline that explains itself in a high-contrast popover. Click, Enter or Space toggle it; keyboard focus opens it (the term has `tabindex="0"`, so Safari's Tab reaches it too — Carbon's leaves it out); blur, the pointer leaving and Escape close it. The definition is also the trigger's description, so screen readers get it without opening.

นำเข้า: `import '@purpurabog/ui/definition-tooltip';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `definition` | `string` | `''` | The explanation (plain text); use the `definition` slot for markup. |
| `placement` | `Placement` | `'bottom'` |  |
| `open` | `boolean` | `false` |  |
| `open-on-hover` | `boolean` | `false` | Also open on pointer hover (Carbon `openOnHover`). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The term (inline text) |
| `definition` | Rich definition (overrides the `definition` attribute) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The term button |
| `bubble` | The popover |
| `caret` | The arrow |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-dropdown>`

Carbon-style dropdown: a custom list box, the counterpart of ui-select (native `<select>`) — Carbon ships both as `Select` and `Dropdown`. Use this when options need a consistent look across platforms or per-option styling; use ui-select for plain forms.

นำเข้า: `import '@purpurabog/ui/dropdown';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `placeholder` | `string` | `''` | Text shown in the field while nothing is selected (Carbon's `label`). |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `direction` | `'bottom' \| 'top'` | `'bottom'` | Preferred side for the list; it flips when there is no room. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `loading` | `boolean` | `false` | The options are on their way: the list shows "Loading…" and the keys pick nothing (no Carbon counterpart). |
| `fluid` | `boolean` | `false` | Carbon `FluidDropdown`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |
| `inline` | `boolean` | `false` | Label beside a compact, borderless field. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `option-description` | Second line of an option (`<option data-description>`) |
| `base` | The field box |
| `label` | The label |
| `input` | The field button (role=combobox) |
| `chevron` | The arrow icon |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |
| `menu` | The floating list |
| `option` | Each row |
| `group-label` | An `<optgroup>` heading |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(open)` | While its list or calendar is open (also `[data-open]`) |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |
| `:state(placeholder)` | While the placeholder is the shown choice (also `[data-placeholder]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } after the list opens or closes (Carbon `cds-dropdown-toggled`) |
| `input` | Whenever `value` changes, just before `change` (as ui-combobox and ui-multi-select) |
| `change` | When the user picks a different option |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-inline-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-open-background` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-helper` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-divider` | `(ตามบริบท)` |
| `--ui-menu-item-active-background` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-pressed` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-menu-item-selected` | `(ตามบริบท)` |
| `--ui-menu-item-selected-hover` | `(ตามบริบท)` |
| `--ui-menu-max-rows` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-row-divider` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-surface-2` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-dropdown-skeleton>`

Carbon `DropdownSkeleton` (`cds-dropdown-skeleton`): the shape of a `<ui-dropdown>` while its data loads — a 75×14 label bar, 8px, then the field's bar at its `size` (sm 32 / md 40 / lg 48px). Hidden from assistive tech. Also for ComboBox and MultiSelect, as in Carbon.

นำเข้า: `import '@purpurabog/ui/dropdown';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The field's height: sm 32px, md 40px, lg 48px. |
| `hide-label` | `boolean` | `false` | No label bar (the field had `hide-label`). |
| `fluid` | `boolean` | `false` | The fluid field's skeleton (Carbon `Fluid*Skeleton`): a 64px box with two bars; `<ui-fluid-form>` sets it. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `field` | The field bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-edit-in-place>`

Carbon for IBM Products `EditInPlace`: a value shown as plain text that is edited right where it is. Hovered, it gets the field fill and an "Edit" button; focused (a click, Tab), it is a field with "Cancel" and "Save" buttons (enabled once the value changed; a valid change can be saved). Enter saves and keeps editing (with nothing to save it stops editing, the focus staying); Escape puts the value back; leaving it saves a valid change and otherwise puts the value back. `invalid` draws the error border, a warning icon and `invalid-text` (described by the field); `readonly` shows "Edit off", whose high-contrast popover says why. Sizes sm 40 / md 48 / lg 64.

นำเข้า: `import '@purpurabog/ui/edit-in-place';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `string` | `''` | The value (as `<input>.value`). |
| `label` | `string` | `''` | The field's accessible name (Carbon `labelText`; there is no visible label). |
| `placeholder` | `string` | `''` |  |
| `size` | `EditInPlaceSize` | `'sm'` |  |
| `invalid` | `boolean` | `false` |  |
| `invalid-text` | `string` | `''` |  |
| `readonly` | `boolean` | `false` |  |
| `edit-always-visible` | `boolean` | `false` | Show "Edit" without hovering. |
| `inherit-typography` | `boolean` | `false` | The field takes the surrounding type (a heading made editable). |
| `tooltip-placement` | `Placement` | `'top'` | Where the buttons' tooltips go (Carbon `tooltipAlignment`). |
| `note-placement` | `Placement` | `'bottom'` | Where the read-only note goes (Carbon `toggleTipAlignment`). |
| `edit-label` | `string` | `''` | The buttons' names and the read-only note (defaults: the translation's "Edit", "Save", "Cancel", "Edit off", …). |
| `save-label` | `string` | `''` |  |
| `cancel-label` | `string` | `''` |  |
| `readonly-label` | `string` | `''` |  |
| `readonly-text` | `string` | `''` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box |
| `input` | The `<input>` |
| `actions` | The buttons' box |
| `invalid-text` | The error message |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(editing)` | While it is a field (editing) (also `[data-editing]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `type` |  |
| `input` | On every keystroke (`value` already updated) |
| `ui-save` | detail: { value } a change was saved (Save, Enter, leaving it) |
| `ui-cancel` | detail: { value } the value was put back (Cancel, Escape, leaving it without a valid change) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-1` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-expandable-tile>`

Tile that reveals more content (Carbon `ExpandableTile`: a layer tile, chevron in the bottom-end corner), built on the WAI-ARIA disclosure pattern: the always-visible summary is a real `<button>` with `aria-expanded` / `aria-controls`, so Enter/Space toggle and screen readers announce the state.

นำเข้า: `import '@purpurabog/ui/tile';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `expanded` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `summary` | Always visible (text only) |
| `(default)` | Revealed content |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `summary` | The always-visible button row |
| `chevron` | The arrow icon |
| `content` | The expandable body |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded } |
| `ui-before-toggle` | Cancelable; detail: { expanded } — the state about to be applied |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-border` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-expressive-card>`

Carbon for IBM Products `ExpressiveCard`: a `$layer` card for content — optional media on top or at the start (`media-position="left"`), a pictogram, a heading-03 title with its label and description, the body, and a footer with the secondary and primary buttons (md; `primary-button-kind` primary | ghost, `secondary-button-kind` secondary | ghost) and small ghost icon buttons (`slot="actions"`). It follows the `<ui-layer>` it sits on. IBM Products' current, prop-driven (legacy-style) card: use it where a screen must match IBM product UIs; for new work prefer `ui-card` (Carbon's parts-based card, the direction of both Carbon and IBM Products' unreleased Card next).

นำเข้า: `import '@purpurabog/ui/product-card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `media-position` | `ProductCardMediaPosition` | `'top'` | Where the media goes: across the top, or at the start with the content beside it. |
| `primary-button-kind` | `ProductCardPrimaryKind` | `'primary'` |  |
| `secondary-button-kind` | `ProductCardSecondaryKind` | `'secondary'` |  |
| `heading` | `string` | `''` | The title (Carbon `title`; named `heading` because `title` is every element's native tooltip). |
| `heading-level` | `string` | `'h2'` | The title's element (h1 … h6; Carbon `Heading` in its `Section`, an `<h2>` at the top of a page). |
| `label` | `string` | `''` | Text above the title (label-01). |
| `description` | `string` | `''` | Text below the title (label-01). |
| `clickable` | `boolean` | `false` | Makes the card's click zone one button (Carbon: an `onClick`); listen for `ui-click`. |
| `disabled` | `boolean` | `false` | Announced as disabled (`aria-disabled`, as Carbon); a clickable zone then fires no `ui-click`. No other change, as Carbon. |
| `primary-button-text` | `string` | `''` |  |
| `primary-button-href` | `string` | `''` | Makes the primary button a link (in the footer; Carbon's button at the top takes no `href`). |
| `primary-button-disabled` | `boolean` | `false` |  |
| `secondary-button-text` | `string` | `''` |  |
| `secondary-button-href` | `string` | `''` | Makes the secondary button a link. |
| `secondary-button-disabled` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The body (body-compact-01) |
| `label` | Replaces `label` |
| `title` | Replaces `heading` |
| `description` | Replaces `description` |
| `media` | An image or video across the top (or at the start), shown at its own size up to the card's width |
| `pictogram` | A pictogram above the title, 16px in |
| `actions` | Icon buttons (`<ui-icon-button label="…">`, ghost); the card makes them sm |
| `primary-button-icon` | A 16px icon after the primary button's text (Carbon `primaryButtonIcon`) |
| `secondary-button-icon` | A 16px icon after the secondary button's text |
| `decorator` | E.g. an AI label, 16px from the top-end corner |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The card |
| `click-zone` | The card's button (`clickable` only), covering the card |
| `media` | The media's box |
| `pictogram` | The pictogram's box |
| `content` | The header, body and footer |
| `header` | The header |
| `label` | The label |
| `title` | The title (`<h2>` by default) |
| `description` | The description |
| `actions` | The action icons' box |
| `body` | The body |
| `footer` | The footer |
| `primary-button` | The primary `<ui-button>` |
| `secondary-button` | The secondary `<ui-button>` |
| `decorator` | The decorator's box |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(has-footer)` | While the footer shows (also `[data-has-footer]`) |
| `:state(has-media)` | With media (also `[data-has-media]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-click` | The card was activated (a click, Enter or Space); not while `disabled` |
| `ui-primary-button-click` | The primary button was activated |
| `ui-secondary-button-click` | The secondary button was activated |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-tile` | `(ตามบริบท)` |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-overflow` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tile-border-color` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-file-uploader>`

Carbon `FileUploader` / `FileUploaderDropContainer`: a title, a description and either an "Add file" button (default) or a dashed drop zone (`drop`) that opens the file dialog; the chosen files are listed as `<ui-file-uploader-item>`s. `accept` (extensions or MIME types) and `max-file-size` mark rejected files invalid with `invalid-type-text` / `too-large-text`. Items start in `status` (edit / uploading / complete); update `files` yourself as uploads progress. Form-associated: every valid file is submitted under `name`.

นำเข้า: `import '@purpurabog/ui/file-uploader';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label-title` | `string` | `''` |  |
| `label-description` | `string` | `''` |  |
| `button-label` | `string` | `''` | Button text; replaced by the file name / "N files" after a pick unless `keep-label`. |
| `button-kind` | `ButtonKind` | `'primary'` |  |
| `size` | `FileUploaderSize` | `'md'` | Button and item sizes. |
| `drop` | `boolean` | `false` | Render the dashed drop zone instead of the button (Carbon `FileUploaderDropContainer`). |
| `drop-label` | `string` | `''` |  |
| `accept` | `string` | `''` | Comma-separated extensions / MIME types, e.g. ".pdf,.jpg,image/png". |
| `multiple` | `boolean` | `false` |  |
| `max-file-size` | `number` | `0` | Bytes; larger files are added as invalid. |
| `max-files` | `number` | `0` | Most valid files in the list; the ones past it are added as invalid (0 = no limit). |
| `max-total-size` | `number` | `0` | Bytes the valid files may add up to; a file that would go over is added as invalid (0 = no limit). |
| `show-size` | `boolean` | `false` | Show each file's size in its row ("1.2 MB", in the page language). |
| `name` | `string` | `''` |  |
| `disabled` | `boolean` | `false` |  |
| `status` | `FileStatus` | `'edit'` | Status new items start in (Carbon `filenameStatus`). |
| `icon-label` | `string` | `''` |  |
| `keep-label` | `boolean` | `false` |  |
| `required` | `boolean` | `false` | At least one valid file must be chosen before the form submits. |
| `required-text` | `string` | `''` | Validation message for `required`; defaults to the translation. |
| `invalid-type-text` | `string` | `''` |  |
| `too-large-text` | `string` | `''` |  |
| `too-many-text` | `string` | `''` |  |
| `total-too-large-text` | `string` | `''` |  |
| `invalid-body-text` | `string` | `''` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `files` | `FileItem[]` | The current list; replace it (new array) to update statuses or errors. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Extra `<ui-file-uploader-item>`s (e.g. files already on the server) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `title` | Label title |
| `description` | Label description |
| `trigger` | The button or drop zone |
| `drop-icon` | The drop zone's upload icon (hidden unless a design shows it) |
| `items` | The file list |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(drag-over)` | While files are dragged over the drop zone (also `[data-drag-over]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-add` | detail: { addedFiles } right after the user picks files (invalid ones included) |
| `ui-delete` | detail: { deletedFile, remainingFiles } |
| `ui-change` | detail: { addedFiles, removedFiles, currentFiles, action } |
| `change` | Native-style, alongside `ui-change` |
| `ui-retry` | detail: { retriedFile } when the user retries a failed upload |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-blue-60` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-button-align` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-button-gap` | `(ตามบริบท)` |
| `--ui-button-ghost-justify` | `(ตามบริบท)` |
| `--ui-button-ghost-padding-end` | `(ตามบริบท)` |
| `--ui-button-height-2xl` | `(ตามบริบท)` |
| `--ui-button-height-lg` | `(ตามบริบท)` |
| `--ui-button-height-xl` | `(ตามบริบท)` |
| `--ui-button-justify` | `(ตามบริบท)` |
| `--ui-button-padding-2xl` | `(ตามบริบท)` |
| `--ui-button-padding-end` | `(ตามบริบท)` |
| `--ui-button-padding-start` | `(ตามบริบท)` |
| `--ui-button-padding-top` | `(ตามบริบท)` |
| `--ui-button-padding-xl` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-secondary` | `(ตามบริบท)` |
| `--ui-button-secondary-active` | `(ตามบริบท)` |
| `--ui-button-secondary-border` | `(ตามบริบท)` |
| `--ui-button-secondary-hover` | `(ตามบริบท)` |
| `--ui-button-tall-align` | `(ตามบริบท)` |
| `--ui-button-tall-icon-offset` | `(ตามบริบท)` |
| `--ui-button-tall-padding-top` | `(ตามบริบท)` |
| `--ui-button-tertiary-active` | `(ตามบริบท)` |
| `--ui-button-tertiary-active-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border-width` | `(ตามบริบท)` |
| `--ui-button-tertiary-focus` | `(ตามบริบท)` |
| `--ui-button-tertiary-hover` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-button-tertiary-state-ink` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-active` | `(ตามบริบท)` |
| `--ui-error-hover` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-file-drop-align` | `(ตามบริบท)` |
| `--ui-file-drop-background` | `(ตามบริบท)` |
| `--ui-file-drop-direction` | `(ตามบริบท)` |
| `--ui-file-drop-gap` | `(ตามบริบท)` |
| `--ui-file-drop-height` | `(ตามบริบท)` |
| `--ui-file-drop-hover-background` | `(ตามบริบท)` |
| `--ui-file-drop-hover-border-color` | `(ตามบริบท)` |
| `--ui-file-drop-hover-decoration` | `(ตามบริบท)` |
| `--ui-file-drop-hover-outline` | `(ตามบริบท)` |
| `--ui-file-drop-icon-background` | `(ตามบริบท)` |
| `--ui-file-drop-icon-color` | `(ตามบริบท)` |
| `--ui-file-drop-icon-display` | `(ตามบริบท)` |
| `--ui-file-drop-justify` | `(ตามบริบท)` |
| `--ui-file-drop-min-height` | `(ตามบริบท)` |
| `--ui-file-drop-padding` | `(ตามบริบท)` |
| `--ui-file-drop-radius` | `(ตามบริบท)` |
| `--ui-file-drop-text-align` | `(ตามบริบท)` |
| `--ui-file-item-edge` | `(ตามบริบท)` |
| `--ui-file-item-radius` | `(ตามบริบท)` |
| `--ui-file-uploader-max-width` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-on-button-secondary` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-secondary` | `(ตามบริบท)` |
| `--ui-secondary-active` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-file-uploader-item>`

Carbon `FileUploaderItem`: one selected file. `status="edit"` shows a remove button (click, Enter or Space fire `ui-delete`), `"uploading"` a spinner, `"complete"` a check mark. `invalid` outlines the row in red and shows `error-subject` / `error-body` as an alert. Used by `<ui-file-uploader>` and on its own for server-side lists.

นำเข้า: `import '@purpurabog/ui/file-uploader';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | `''` |  |
| `uuid` | `string` | `''` | Identifies the file in `ui-delete`; defaults to `name`. |
| `status` | `FileStatus` | `'edit'` |  |
| `invalid` | `boolean` | `false` |  |
| `error-subject` | `string` | `''` |  |
| `error-body` | `string` | `''` |  |
| `size` | `FileUploaderSize` | `'md'` |  |
| `disabled` | `boolean` | `false` |  |
| `icon-label` | `string` | `''` | Describes the state icon / remove button: "Remove file", "Uploading", "Uploaded" (Carbon `iconDescription`); with `progress`, the bar. |
| `progress` | `number \| undefined` |  | Upload progress 0–100, shown while `status` is uploading (percentage, bar, cancel button) instead of the spinner. |
| `retryable` | `boolean` | `false` | On an invalid row: a retry button (`ui-retry`) for a failed upload. |
| `file-size` | `number \| undefined` |  | Bytes; shows the size in the row ("1.2 MB"). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `removable` |  | The row has a remove button (edit, or uploading with `progress`) and isn't disabled. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The row |
| `name` | File name |
| `size` | The file size (`file-size`) |
| `percent` | The upload percentage (`progress`) |
| `progress` | The `<ui-progress-bar>` under the row (`progress`) |
| `retry-button` | The retry button (`retryable` invalid row) |
| `delete-button` | The × button (edit status, or uploading with `progress`) |
| `error` | The error block (invalid) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-delete` | detail: { uuid, name } when the user removes the file |
| `ui-retry` | detail: { uuid, name } when the user retries a failed upload |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-file-item-edge` | `(ตามบริบท)` |
| `--ui-file-item-radius` | `(ตามบริบท)` |
| `--ui-file-uploader-max-width` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-file-uploader-skeleton>`

Carbon `FileUploaderSkeleton` (`cds-file-uploader-skeleton`): a 100×24 title bar, a 225×16 description bar and a 150×48 button bar, 8px apart. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/file-uploader';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `title` | The title bar |
| `description` | The description bar |
| `button` | The button bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-fluid-form>`

Carbon `FluidForm`: the fields inside it render fluid, as if each had `fluid` — the label sits inside a 64px box and an error / warning shows inside the box below a divider (Carbon's fluid fields have no helper line). Supported: `ui-text-input` (incl. password), `ui-text-area`, `ui-number-input`, `ui-select`, `ui-search`, `ui-dropdown`, `ui-combobox`, `ui-multi-select`, `ui-date-picker` (single and range) and `ui-time-picker` (with its selects as equal columns). Open list menus keep their normal row height (Carbon's fluid menus use 64px rows with the text at the top, which looks unintended).

นำเข้า: `import '@purpurabog/ui/fluid-form';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Fields and any other content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-form-group>`

Carbon `FormGroup`: a `<fieldset>` with a Carbon label as its legend, for grouping related fields (an address, a date range). `disabled` disables every form control inside through the native fieldset; `message` shows helper text under the group, red when `invalid`.

นำเข้า: `import '@purpurabog/ui/form-group';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `legend` | `string` | `''` |  |
| `disabled` | `boolean` | `false` |  |
| `invalid` | `boolean` | `false` |  |
| `message` | `string` | `''` | Helper / error text under the group. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The fields |
| `legend` | Rich legend (overrides `legend`) |
| `message` | Rich message |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The fieldset |
| `legend` | The legend |
| `message` | The message |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-grid>`

Carbon 2x Grid (`Grid` / `cds-grid`, CSS Grid mode): 4 / 8 / 16 columns at sm / md (672px) / lg (1056px) and up, 32px gutters (each column 16px in on both sides), the grid 16px in from its edges (0 on small screens, 24px from 1584px), at most 1584px wide and centred. `narrow` hangs the columns' text on the gutter (no start gutter), `condensed` 1px gutters; `full-width` drops the max width; `align="start" | "end"` pins it to a side; `with-row-gap` spaces rows like columns. A grid inside a `<ui-column>` is a subgrid of that column's span.

นำเข้า: `import '@purpurabog/ui/grid';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `narrow` | `boolean` | `false` | No start gutter: text hangs on the gutter (Carbon narrow). |
| `condensed` | `boolean` | `false` | 1px gutters (Carbon condensed). |
| `full-width` | `boolean` | `false` | No max width. |
| `align` | `'start' \| 'center' \| 'end' \| undefined` |  | Pin a max-width grid to a side (centred by default). |
| `with-row-gap` | `boolean` | `false` | Rows spaced like columns. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-column>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `grid` | The grid |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-grid-columns` | `(ตามบริบท)` |
| `--ui-grid-gutter` | `(ตามบริบท)` |
| `--ui-grid-margin` | `(ตามบริบท)` |
| `--ui-grid-mode-end` | `(ตามบริบท)` |
| `--ui-grid-mode-start` | `(ตามบริบท)` |

## `<ui-header>`

Carbon `Header`: the fixed 48px top bar (`role=banner`). Slot in order: `<ui-skip-to-content>`, `<ui-header-menu-button>`, `<ui-header-name>`, `<ui-header-nav>`, `<ui-header-global-bar>`.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Accessible name of the banner, e.g. the product name. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Header content |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The `<header>` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |

## `<ui-header-global-action>`

Carbon `HeaderGlobalAction`: a 48px icon button in the header, named by `label` through an icon tooltip. `active` shows the pressed state used while its `<ui-header-panel>` is open.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `active` | `boolean` | `false` |  |
| `tooltip-placement` | `'bottom' \| 'bottom-start' \| 'bottom-end'` | `'bottom'` |  |
| `panel` | `string` | `''` | Id of the `<ui-header-panel>` this action opens. Clicking toggles the panel, `active` follows it, and the button reports `aria-expanded` (a disclosure) instead of `aria-pressed` (a toggle). The button has an explicit tabindex, as Carbon's (cds-button): Safari then focuses it on click and Tab reaches it. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | 20px icon |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The button |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-header-action-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |

## `<ui-header-global-bar>`

Carbon `HeaderGlobalBar`: right-aligned area for `<ui-header-global-action>`s.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Global actions |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-header-mega-group>`

A column of a `<ui-header-mega-menu>` panel: a small `heading` (Vercel's "Learn", "Build", "Explore") over a list of `<ui-header-mega-item>`s, the list named by the heading.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `heading` | `string` | `''` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-header-mega-item>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `heading` | The heading |
| `list` | The list of links |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-mega-heading-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-header-mega-item>`

One link of a `<ui-header-mega-group>`: a title (the default slot), and optionally an icon (`icon` slot) and a one-line `description` under the title (Vercel's Products menu). `current` marks the page (`aria-current="page"`). Following it closes the mega menu.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'#'` |  |
| `description` | `string` | `''` | A line under the title. |
| `current` | `boolean` | `false` |  |
| `target` | `string` | `''` | Where the link opens (`_blank` for a new tab), as on `<a>`. |
| `rel` | `string` | `''` | The link's relation (`noopener`, `external` …), as on `<a>`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The title |
| `icon` | An icon before the title (20px) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link |
| `description` | The line under the title |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-mega-item-font` | `(ตามบริบท)` |
| `--ui-mega-item-hover-background` | `(ตามบริบท)` |
| `--ui-mega-item-ink` | `(ตามบริบท)` |
| `--ui-mega-item-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-header-mega-menu>`

A header menu-bar entry that opens a full-width panel of `<ui-header-mega-group>` columns under the header (a mega menu, as Vercel's): put it in `<ui-header-nav>` next to `<ui-header-menu-item>`s and `<ui-header-menu>`s.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `open` | `boolean` | `false` |  |
| `current` | `boolean` | `false` | Mark the menu as the current section even while open. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-header-mega-group>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The menu-bar entry |
| `panel` | The panel under the header |
| `content` | The grid of groups inside the panel |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-mega-column-width` | `(ตามบริบท)` |
| `--ui-mega-gap` | `(ตามบริบท)` |
| `--ui-mega-padding` | `(ตามบริบท)` |
| `--ui-mega-panel-background` | `(ตามบริบท)` |
| `--ui-mega-panel-border` | `(ตามบริบท)` |
| `--ui-mega-panel-shadow` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-header-menu>`

Carbon `HeaderMenu`: a menu-bar entry that opens a 200px dropdown of `<ui-header-menu-item>`s. Click / Enter / Space toggle; Escape and clicking outside close and return focus. Following one of its links closes it too (Carbon toggles on any click in the menu), so a client-side route change doesn't leave it open; focus goes back to the title rather than staying on a hidden link. A disclosure (APG disclosure navigation): the links stay links, so the button has no `aria-haspopup`. While closed it shows the current-page bar when one of its items is `current` (Carbon `hasActiveDescendant`); `current` shows it always (Carbon `isActive`).

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `open` | `boolean` | `false` |  |
| `current` | `boolean` | `false` | Mark the menu as the current section even while open (Carbon `isActive`). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-header-menu-item>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The title button |
| `menu` | The dropdown list |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-layer-selected-1` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-header-menu-button>`

Carbon `HeaderMenuButton`: the hamburger that opens / closes a `<ui-side-nav>` below the `lg` breakpoint (hidden above it unless `collapsible`). As Carbon web components, the side nav in the same document (or shadow root) follows it by itself and keeps `active` in step; call `preventDefault()` on `ui-toggle` to handle it yourself.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `active` | `boolean` | `false` |  |
| `collapsible` | `boolean` | `false` | Keep the button at every width (a collapsible, non-fixed side nav). |
| `open-label` | `string` | `''` |  |
| `close-label` | `string` | `''` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The button |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | cancelable; detail: { active } the state the user asked for |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |

## `<ui-header-menu-item>`

Carbon `HeaderMenuItem`: one link of the header menu bar (or of a `<ui-header-menu>` dropdown). `current` marks the page (`aria-current="page"`, 3px bar).

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'#'` |  |
| `current` | `boolean` | `false` |  |
| `target` | `string` | `''` | Where the link opens (`_blank` for a new tab), as on `<a>`. |
| `rel` | `string` | `''` | The link's relation (`noopener`, `external` …), as on `<a>`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Link text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-layer-selected-1` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |

## `<ui-header-name>`

Carbon `HeaderName`: the product link at the start of the header (`prefix` in regular weight, then the name in 600). Carbon's default prefix is "IBM"; here it is empty.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'/'` |  |
| `prefix` | `string` | `''` |  |
| `target` | `string` | `''` | Where the link opens (`_blank` for a new tab), as on `<a>`. |
| `rel` | `string` | `''` | The link's relation (`noopener`, `external` …), as on `<a>`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Product name |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |

## `<ui-header-nav>`

Carbon `HeaderNavigation`: the main menu bar (`<nav>` + list), shown from the `lg` breakpoint. Children: `<ui-header-menu-item>`, `<ui-header-menu>` and `<ui-header-mega-menu>`.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `collapse` | `boolean` | `false` | Below `lg`, a menu button and a full-screen sheet instead of hiding (a header with no side nav). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Menu items |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The `<nav>` |
| `list` | The menu bar list |
| `menu-button` | With `collapse`, below `lg`: the button that opens the sheet |
| `sheet` | With `collapse`, below `lg`: the sheet under the header |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-mega-panel-background` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-header-panel>`

Carbon `HeaderPanel`: a 256px panel that slides in under the header on the end side (app switcher, notifications). Escape, focus leaving and a click outside it (not on the action that opens it) close it (`ui-toggle`; Carbon `HeaderPanel`); set `expanded`.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `expanded` | `boolean` | `false` |  |
| `label` | `string` | `''` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Panel content (e.g. `<ui-switcher>`) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The panel |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-header-action-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-heading>`

Carbon `Heading` (`cds-heading`): an `<h1>`…`<h6>` at the level of the `<ui-section>` it sits in (`<h1>` outside any), in Carbon's productive type for that level — h1 heading-06 (42px light) down to h6 heading-01 (14px semibold), no margins.

นำเข้า: `import '@purpurabog/ui/heading';`

### Attributes
_ไม่มี_

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `level` | `HeadingLevel` | The level from the `<ui-section>` around it (1 outside any). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The heading text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `heading` | The `<h1>`…`<h6>` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-heading-01` | `(ตามบริบท)` |
| `--ui-font-heading-02` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-04` | `(ตามบริบท)` |
| `--ui-font-heading-05` | `(ตามบริบท)` |
| `--ui-font-heading-06` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-icon-button>`

Carbon `IconButton`: a square `<ui-button icon-only>` named by an icon tooltip (`label`), so the name is visible on hover / focus and read by screen readers. Kinds primary / secondary / tertiary / ghost (default ghost), sizes sm 32 / md 40 / lg 48. `pressed` makes it a toggle. `tooltip-placement` takes every Carbon `align` value: top, bottom, left, right, each with `-start` / `-end` (Carbon's deprecated `top-left` … names are not taken); `align` works too, Carbon's name for it.

นำเข้า: `import '@purpurabog/ui/icon-button';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon IconButton's name for `tooltip-placement` (same values) |
| `label` | `string` | `''` | Required: the accessible name and tooltip text. |
| `kind` | `IconButtonKind` | `'ghost'` |  |
| `size` | `IconButtonSize` | `'lg'` |  |
| `tooltip-placement` | `TooltipPlacement` | `'bottom'` | Where the tooltip goes: top, bottom, left, right, each with `-start` / `-end` (Carbon `align`). |
| `disabled` | `boolean` | `false` |  |
| `disabled-focusable` | `boolean` | `false` | Disabled but focusable, so its tooltip can still be read (and say why, e.g. "Delete — needs approver rights"). |
| `loading` | `boolean` | `false` | Busy: the icon gives way to a centred spinner, as `<ui-button loading>` (MUI IconButton `loading`). |
| `loading-label` | `string` | `''` | What `loading` announces (default: the translation's "Loading"). |
| `pressed` | `boolean \| undefined` |  | Toggle state (`aria-pressed`); leave unset for a plain button. |
| `href` | `string` | `''` |  |
| `haspopup` | `string` | `''` | The button opens a popup (`aria-haspopup`); pair with `expanded`. |
| `expanded` | `boolean` | `false` |  |
| `badge-count` | `number \| undefined` |  | A badge in the corner: 0 a dot, a number a count (Carbon `badgeCount`). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `align` | `TooltipPlacement` | Carbon IconButton's name for `tooltipPlacement` (same values); an `align` attribute works too. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The 16px icon |
| `badge-indicator` | A `<ui-badge-indicator>` (it takes this slot itself) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `button` | The inner `<ui-button>` |
| `tooltip` | The `<ui-tooltip>` |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `click` | Native |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-blue-60` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-button-align` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-button-gap` | `(ตามบริบท)` |
| `--ui-button-ghost-justify` | `(ตามบริบท)` |
| `--ui-button-ghost-padding-end` | `(ตามบริบท)` |
| `--ui-button-height-2xl` | `(ตามบริบท)` |
| `--ui-button-height-lg` | `(ตามบริบท)` |
| `--ui-button-height-xl` | `(ตามบริบท)` |
| `--ui-button-justify` | `(ตามบริบท)` |
| `--ui-button-padding-2xl` | `(ตามบริบท)` |
| `--ui-button-padding-end` | `(ตามบริบท)` |
| `--ui-button-padding-start` | `(ตามบริบท)` |
| `--ui-button-padding-top` | `(ตามบริบท)` |
| `--ui-button-padding-xl` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-secondary` | `(ตามบริบท)` |
| `--ui-button-secondary-active` | `(ตามบริบท)` |
| `--ui-button-secondary-border` | `(ตามบริบท)` |
| `--ui-button-secondary-hover` | `(ตามบริบท)` |
| `--ui-button-tall-align` | `(ตามบริบท)` |
| `--ui-button-tall-icon-offset` | `(ตามบริบท)` |
| `--ui-button-tall-padding-top` | `(ตามบริบท)` |
| `--ui-button-tertiary-active` | `(ตามบริบท)` |
| `--ui-button-tertiary-active-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border-width` | `(ตามบริบท)` |
| `--ui-button-tertiary-focus` | `(ตามบริบท)` |
| `--ui-button-tertiary-hover` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-button-tertiary-state-ink` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-active` | `(ตามบริบท)` |
| `--ui-error-hover` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-on-button-secondary` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-secondary` | `(ตามบริบท)` |
| `--ui-secondary-active` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-icon-indicator>`

Carbon `IconIndicator` (preview, `cds-icon-indicator`): a status shown by Carbon's icon for `kind`, in its status colour, followed by `label` — 16px icon with body-compact-01, or `size="20"` with body-compact-02. `compact` shows only the icon, with the label in a tooltip on hover / focus (`icon-description` is read instead, if set).

นำเข้า: `import '@purpurabog/ui/status-indicator';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `kind` | `IconIndicatorKind \| undefined` |  |  |
| `label` | `string` | `''` |  |
| `size` | `16 \| 20` | `16` | 16 (body-compact-01) or 20 (body-compact-02). |
| `compact` | `boolean` | `false` | Only the icon; the label in a tooltip. |
| `icon-description` | `string \| undefined` |  | Read by screen readers in compact mode instead of the label. |
| `placement` | `Placement` | `'right'` | Where the compact tooltip opens. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `icon` | The icon |
| `label` | The label (not compact) |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-inline-loading>`

Carbon `InlineLoading`: a 16px spinner with a text beside it for in-place progress (saving, submitting). `status` moves through `active` → `finished` (check mark, then `ui-success` after `success-delay`) or `error` (error icon); `inactive` stops the spinner as Carbon web components do (it turns out and its rings run out over 1.4s; at once with reduced motion). The text is a polite live region so screen readers hear the change.

นำเข้า: `import '@purpurabog/ui/inline-loading';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `status` | `InlineLoadingStatus` | `'active'` |  |
| `success-delay` | `number` | `1500` | Milliseconds after `finished` before `ui-success` fires (Carbon `successDelay`). |
| `icon-label` | `string` | `''` | Accessible name of the icon; defaults to the status. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The status text (Carbon `description`) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The row |
| `icon` | The spinner / check / error icon |
| `text` | The description |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-success` | `success-delay` ms after `status` became `finished` |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-success` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-layer>`

Carbon `Layer` (`cds-layer`): a zone at one level of the layering model. Fields, menus, borders and hover/selected fills inside it use that level's layer set of the current theme (white: level 0 #f4f4f4, the page's own; level 1 #ffffff; level 2 #f4f4f4), so a field on a tile stays distinguishable from the tile: on a tile, use level 1.

นำเข้า: `import '@purpurabog/ui/layer';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `level` |  |  | 0, 1 or 2. Computed from the nearest ancestor layer when not set. |
| `with-background` | `boolean` | `false` | Paint the layer with Carbon's `layer-background` (`withBackground`): the colour its content sits on (white theme, level 1: #f4f4f4 under #ffffff fields). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Content |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The wrapper |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-border-strong-2` | `(ตามบริบท)` |
| `--ui-border-strong-3` | `(ตามบริบท)` |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-border-subtle-3` | `(ตามบริบท)` |
| `--ui-border-subtle-selected-1` | `(ตามบริบท)` |
| `--ui-border-subtle-selected-2` | `(ตามบริบท)` |
| `--ui-border-subtle-selected-3` | `(ตามบริบท)` |
| `--ui-border-tile-1` | `(ตามบริบท)` |
| `--ui-border-tile-2` | `(ตามบริบท)` |
| `--ui-border-tile-3` | `(ตามบริบท)` |
| `--ui-card-background-1` | `(ตามบริบท)` |
| `--ui-card-background-2` | `(ตามบริบท)` |
| `--ui-card-background-3` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-layer-2` | `(ตามบริบท)` |
| `--ui-layer-3` | `(ตามบริบท)` |
| `--ui-layer-accent-1` | `(ตามบริบท)` |
| `--ui-layer-accent-2` | `(ตามบริบท)` |
| `--ui-layer-accent-3` | `(ตามบริบท)` |
| `--ui-layer-accent-active-1` | `(ตามบริบท)` |
| `--ui-layer-accent-active-2` | `(ตามบริบท)` |
| `--ui-layer-accent-active-3` | `(ตามบริบท)` |
| `--ui-layer-accent-hover-1` | `(ตามบริบท)` |
| `--ui-layer-accent-hover-2` | `(ตามบริบท)` |
| `--ui-layer-accent-hover-3` | `(ตามบริบท)` |
| `--ui-layer-active-1` | `(ตามบริบท)` |
| `--ui-layer-active-2` | `(ตามบริบท)` |
| `--ui-layer-active-3` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-layer-background-1` | `(ตามบริบท)` |
| `--ui-layer-background-2` | `(ตามบริบท)` |
| `--ui-layer-background-3` | `(ตามบริบท)` |
| `--ui-layer-border` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-layer-hover-2` | `(ตามบริบท)` |
| `--ui-layer-hover-3` | `(ตามบริบท)` |
| `--ui-layer-radius` | `(ตามบริบท)` |
| `--ui-layer-selected-1` | `(ตามบริบท)` |
| `--ui-layer-selected-2` | `(ตามบริบท)` |
| `--ui-layer-selected-3` | `(ตามบริบท)` |
| `--ui-layer-selected-hover-1` | `(ตามบริบท)` |
| `--ui-layer-selected-hover-2` | `(ตามบริบท)` |
| `--ui-layer-selected-hover-3` | `(ตามบริบท)` |
| `--ui-row-divider-1` | `(ตามบริบท)` |
| `--ui-row-divider-2` | `(ตามบริบท)` |
| `--ui-row-divider-3` | `(ตามบริบท)` |

## `<ui-link>`

Carbon-style link (`Link`): `--ui-link` text, underline on hover, Carbon focus ring, sizes sm (helper-text-01) / md (body-compact-01) / lg (body-compact-02), `inline` (always underlined, for links inside running text), `visited` styling opt-in and a `disabled` state that renders plain text with `aria-disabled`.

นำเข้า: `import '@purpurabog/ui/link';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `''` |  |
| `target` | `string` | `''` |  |
| `rel` | `string` | `''` |  |
| `download` | `string` | `''` |  |
| `size` | `LinkSize` | `'md'` |  |
| `inline` | `boolean` | `false` | Underlined at rest, for links inside a sentence. |
| `visited` | `boolean` | `false` | Opt into Carbon's visited colour (browser `:visited`). |
| `disabled` | `boolean` | `false` | Renders as inert text with `aria-disabled`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Link text |
| `icon` | A 16px (lg: 20px) icon after the text (Carbon `renderIcon`; not shown when `inline`) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The anchor |
| `icon` | The icon wrapper |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-link-hover` | `(ตามบริบท)` |
| `--ui-link-visited` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-list-item>`

Carbon `ListItem` (`cds-list-item`): one item of a `<ui-unordered-list>` / `<ui-ordered-list>` (text-primary); put a list inside it to nest.

นำเข้า: `import '@purpurabog/ui/list';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The item's content, and a nested list |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-ink` | `(ตามบริบท)` |

## `<ui-loading>`

Carbon `Loading`: the 88px spinner (`small`: 16px with a grey track). With `overlay` it covers the page (fixed, Carbon `overlay` colour), traps focus while `active` and gives focus back afterwards — use it while a whole view is unavailable; prefer `<ui-inline-loading>` next to a button. Set `active` to false to stop and hide it (the element stays in the DOM).

นำเข้า: `import '@purpurabog/ui/loading';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `active` | `boolean` | `true` | On by default; `active="false"` stops it. |
| `small` | `boolean` | `false` |  |
| `overlay` | `boolean` | `false` | Cover the page and trap focus while active. |
| `description` | `string` | `''` | Accessible description; defaults to the translation ("Loading"). |
| `contained` | `boolean` | `false` | Cover just this element's content (the slot) instead of the page; the content is inert while active (no Carbon counterpart). |
| `delay` | `number` | `0` | Milliseconds `active` must last before the spinner shows (default 0, as Carbon). |
| `min-duration` | `number` | `0` | Once shown, the least milliseconds it stays (default 0). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The area `contained` covers |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The spinner wrapper (`aria-live`) |
| `overlay` | The page overlay (`overlay`), or the area's (`contained`) |
| `area` | The covered content (`contained`) |
| `spinner` | The `<svg>` |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(shown)` | While the spinner actually shows (after `delay`, held for `min-duration`) (also `[data-shown]`) |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-overlay` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-menu>`

Carbon `Menu`: the floating `role=menu` list behind `<ui-overflow-menu>` and `<ui-menu-button>`, usable on its own with `show(anchor)`. Lives in the top layer (`popover="manual"`) at document coordinates next to `anchor` (flips when it doesn't fit). On open, focus moves to the first enabled item; Up/Down wrap, Home/End jump; Escape or Tab close and return focus; so does activating an item, clicking outside or focus leaving.

นำเข้า: `import '@purpurabog/ui/menu';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `open` | `boolean` | `false` |  |
| `label` | `string` | `''` | Accessible name of the menu (the trigger's label). |
| `size` | `MenuSize` | `'sm'` |  |
| `placement` | `MenuPlacement` | `'bottom-start'` |  |
| `match-width` | `boolean` | `false` | Make the menu as wide as the anchor (Carbon menu button with `bottom` / `top`). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `anchor` | `Element \| null` | What the menu is positioned against; `show(anchor)` sets it. |
| `hide` |  |  |
| `items` |  |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-menu-item>`, `<ui-menu-divider>`, `<ui-menu-group>` |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } after it opens or closes |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-item-active-background` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-height` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-pointer-outline` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-menu-max-width` | `(ตามบริบท)` |
| `--ui-menu-min-width` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-menu-button>`

Carbon `MenuButton`: a labelled button with a chevron that opens a `<ui-menu>` of the slotted items. Kinds primary / tertiary / ghost (`kind`, Carbon's name; `variant` still works), sizes sm / md / lg (menu rows follow the size). With `placement="bottom"` / `"top"` the menu is as wide as the button; `-start` / `-end` align an edge instead. Non-ghost buttons are at least 192px wide.

นำเข้า: `import '@purpurabog/ui/menu-button';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `variant` |  |  | Same as `kind`, kept for teams used to `variant` (shadcn, MUI); `kind` is Carbon's name and the one in the docs |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `label` | `string` | `''` |  |
| `kind` | `MenuButtonKind` | `'primary'` | Carbon `kind`: primary, tertiary or ghost. |
| `size` | `Exclude<ButtonSize, 'xl' \| '2xl'>` | `'lg'` | sm 32 / md 40 / lg 48px (Carbon has no xl / 2xl here). |
| `placement` | `MenuPlacement` | `'bottom'` |  |
| `disabled` | `boolean` | `false` |  |
| `open` | `boolean` | `false` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `variant` | `MenuButtonKind` | Same as `kind` (permanent alias for teams used to `variant`); a `variant` attribute works too. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-menu-item>`, `<ui-menu-divider>`, `<ui-menu-group>` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The `<ui-button>` |
| `menu` | The `<ui-menu>` |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-select` | bubbles from the activated item: detail { value, label, checked } |
| `ui-toggle` | detail: { open } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-blue-60` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-button-align` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-button-gap` | `(ตามบริบท)` |
| `--ui-button-ghost-justify` | `(ตามบริบท)` |
| `--ui-button-ghost-padding-end` | `(ตามบริบท)` |
| `--ui-button-height-2xl` | `(ตามบริบท)` |
| `--ui-button-height-lg` | `(ตามบริบท)` |
| `--ui-button-height-xl` | `(ตามบริบท)` |
| `--ui-button-justify` | `(ตามบริบท)` |
| `--ui-button-padding-2xl` | `(ตามบริบท)` |
| `--ui-button-padding-end` | `(ตามบริบท)` |
| `--ui-button-padding-start` | `(ตามบริบท)` |
| `--ui-button-padding-top` | `(ตามบริบท)` |
| `--ui-button-padding-xl` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-secondary` | `(ตามบริบท)` |
| `--ui-button-secondary-active` | `(ตามบริบท)` |
| `--ui-button-secondary-border` | `(ตามบริบท)` |
| `--ui-button-secondary-hover` | `(ตามบริบท)` |
| `--ui-button-tall-align` | `(ตามบริบท)` |
| `--ui-button-tall-icon-offset` | `(ตามบริบท)` |
| `--ui-button-tall-padding-top` | `(ตามบริบท)` |
| `--ui-button-tertiary-active` | `(ตามบริบท)` |
| `--ui-button-tertiary-active-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-border-width` | `(ตามบริบท)` |
| `--ui-button-tertiary-focus` | `(ตามบริบท)` |
| `--ui-button-tertiary-hover` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-button-tertiary-state-ink` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-active` | `(ตามบริบท)` |
| `--ui-error-hover` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inset` | `(ตามบริบท)` |
| `--ui-focus-inset-width` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-max-width` | `(ตามบริบท)` |
| `--ui-menu-min-width` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-on-button-secondary` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-secondary` | `(ตามบริบท)` |
| `--ui-secondary-active` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-menu-divider>`

Carbon `MenuItemDivider`: a 1px separator with 4px above and below.

นำเข้า: `import '@purpurabog/ui/menu';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |

## `<ui-menu-group>`

Carbon `MenuItemGroup` (`role=group` named by `label`) and `MenuItemRadioGroup` (`selection="single"`: its items become `menuitemradio`, exactly one is `checked`).

นำเข้า: `import '@purpurabog/ui/menu';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `selection` | `'none' \| 'single'` | `'none'` |  |
| `value` | `string` | `''` | The checked item's value in `selection="single"`. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `items` | `UiMenuItem[]` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-menu-item>` elements |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-change` | detail: { value } when the checked radio item changes |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-item-active-background` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-height` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-pointer-outline` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-menu-item>`

Carbon `MenuItem` / `MenuItemSelectable` (`selectable`) / radio item (inside a `<ui-menu-group selection="single">`). Activating it (click, Enter, Space) fires `ui-select` and closes the menu. `kind="danger"` turns red on hover/focus; `danger-description` is read after the label. `shortcut` is a hint only (nothing is registered).

นำเข้า: `import '@purpurabog/ui/menu';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `value` | `string` | `''` | Reported in `ui-select`; defaults to `label`. |
| `shortcut` | `string` | `''` |  |
| `kind` | `MenuItemKind` | `'default'` |  |
| `disabled` | `boolean` | `false` |  |
| `selectable` | `boolean` | `false` | Carbon `MenuItemSelectable`: a `menuitemcheckbox` that toggles `checked`. |
| `checked` | `boolean` | `false` |  |
| `danger-description` | `string` | `''` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `radio` | `boolean` | Set by `<ui-menu-group selection="single">`: this item is a `menuitemradio`. |
| `selectValue` |  |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Extra label content after `label`; `<ui-menu-item>` children move to the submenu |
| `submenu` | The submenu's items (children that are menu items get this slot automatically) |
| `icon` | 16px icon (shown when any item in the menu has one — Carbon `renderIcon`) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `icon` | Icon cell |
| `label` | Label cell |
| `shortcut` | Shortcut hint |
| `submenu` | The nested `<ui-menu>` |
| `submenu-icon` | The chevron of an item with a submenu |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-select` | detail: { value, label, checked } when activated (not when disabled) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-button-danger` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-item-active-background` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-height` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-pointer-outline` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-menu-max-width` | `(ตามบริบท)` |
| `--ui-menu-min-width` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-modal>`

Carbon-style modal built on the native `<dialog>` + showModal(), which gives us the top layer, an inert page behind, a focus trap, Esc handling and focus return for free.

นำเข้า: `import '@purpurabog/ui/modal';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `open` | `boolean` | `false` |  |
| `heading` | `string` | `''` |  |
| `label` | `string` | `''` | Accessible name when there is no heading (Carbon `aria-label`); the `label` slot is used before it. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Dialog width (Carbon modal sizes): sm 480px, md 672px, lg 1056px — never wider than the viewport minus 16px a side. |
| `persistent` | `boolean` | `false` | A passive modal (no footer) ignores outside clicks too; one with footer buttons always does (Carbon). |
| `close-label` | `string` | `''` | Accessible name for the close button. |
| `alert` | `boolean` | `false` | Interrupting confirmation: role="alertdialog", focus starts on the safest action. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Body content |
| `label` | Small label above the heading (the row renders only when slotted) |
| `footer` | Action buttons (laid out full-bleed, Carbon style) |
| `header-actions` | Controls at the top end of the header, beside the close button (one 48px button fits) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `dialog` | The native `<dialog>` panel |
| `header` | Header row |
| `header-actions` | Wrapper of the `header-actions` slot |
| `label` | The small label above the heading |
| `heading` | The heading |
| `close-button` | The × button |
| `body` | Scrollable body |
| `footer` | Footer holding the action buttons |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-close` | After the modal has closed |
| `ui-request-close` | Cancelable; detail: { reason }. preventDefault() keeps it open. |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-close-inset` | `(ตามบริบท)` |
| `--ui-close-size` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-duration-moderate-02` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-font-subhead` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-modal-body-focus-radius` | `(ตามบริบท)` |
| `--ui-modal-button-align` | `(ตามบริบท)` |
| `--ui-modal-button-flex` | `(ตามบริบท)` |
| `--ui-modal-button-height` | `(ตามบริบท)` |
| `--ui-modal-button-padding-top` | `(ตามบริบท)` |
| `--ui-modal-footer-border` | `(ตามบริบท)` |
| `--ui-modal-footer-gap` | `(ตามบริบท)` |
| `--ui-modal-footer-height` | `(ตามบริบท)` |
| `--ui-modal-footer-padding` | `(ตามบริบท)` |
| `--ui-modal-radius` | `(ตามบริบท)` |
| `--ui-modal-scrim` | `(ตามบริบท)` |
| `--ui-modal-shadow` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-overlay-border` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-multi-select>`

Carbon-style multi select (Carbon `MultiSelect`, downshift useSelect + useMultipleSelection): a field that always shows its placeholder text, a count tag with a clear button once something is chosen, and a list of checkbox rows that stays open while choosing.

นำเข้า: `import '@purpurabog/ui/multi-select';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `placeholder` | `string` | `''` | Text always shown in the field (Carbon's `label`), e.g. "Choose options". |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `direction` | `'bottom' \| 'top'` | `'bottom'` | Preferred side for the list; it flips when there is no room. |
| `selection-feedback` | `SelectionFeedback` | `'top-after-reopen'` |  |
| `select-all` | `boolean` | `false` | Adds a "Select all" row. |
| `filterable` | `boolean` | `false` | The field is a text box that narrows the list (Carbon `FilterableMultiSelect` / `filterable`). |
| `filter` | `MultiSelectFilter` | `'contains'` | With `filterable`: `contains` (Carbon), `starts-with`, or `none` to leave the list to a server search. |
| `loading` | `boolean` | `false` | The options are on their way: "Searching…" with `filterable` (a server search), else "Loading…"; the keys pick nothing. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidMultiSelect`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `value` | `string[]` | Chosen option values. Initial choices can also come from `<option selected>`. |
| `inputValue` |  | With `filterable`, what the user typed; set it to search for something. |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `option-description` | Second line of an option (`<option data-description>`) |
| `base` | The field box |
| `label` | The label |
| `input` | The field button, or the text box with `filterable` (role=combobox) |
| `toggle` | The chevron button (`filterable`) |
| `clear-filter-button` | The × that clears the text (`filterable`) |
| `empty` | The "searching" / "no results" row (`filterable`) |
| `tag` | The selected-count pill |
| `clear-button` | The × inside the pill |
| `chevron` | The arrow icon |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |
| `menu` | The floating list |
| `option` | Each row |
| `select-all` | The "Select all" row |
| `checkbox` | The box drawn in each row |
| `group-label` | An `<optgroup>` heading |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(open)` | While its list or calendar is open (also `[data-open]`) |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |
| `:state(has-value)` | While it holds a value (also `[data-has-value]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } after the list opens or closes (Carbon React `onMenuChange`) |
| `input` | Whenever the set of chosen values changes, as ui-dropdown and ui-combobox; with `filterable`, also native and composed as the user types, where `value` is unchanged (kept for compatibility: listen to `ui-input` for the typing) |
| `ui-input` | detail: { value } the typed text (`inputValue`) with `filterable`, as the user types or when the text is emptied |
| `change` | Whenever the set of chosen values changes |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-count-tag-background` | `(ตามบริบท)` |
| `--ui-count-tag-hover` | `(ตามบริบท)` |
| `--ui-count-tag-ink` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-open-background` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-helper` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-divider` | `(ตามบริบท)` |
| `--ui-menu-item-active-background` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-pressed` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-menu-item-selected` | `(ตามบริบท)` |
| `--ui-menu-item-selected-hover` | `(ตามบริบท)` |
| `--ui-menu-max-rows` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-option-box-align` | `(ตามบริบท)` |
| `--ui-option-box-offset` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-radius-pill` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-row-divider` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-surface-2` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-notification>`

Carbon notification in one element: `InlineNotification` (default), `ToastNotification` (`variant="toast"`), `ActionableNotification` (any variant with `action-label`) and `Callout` (`variant="callout"`: static inline box with no role, no close button and no autofocus — for persistent on-page guidance; its action button is described by the title).

นำเข้า: `import '@purpurabog/ui/notification';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `title` |  |  |  |
| `role` |  |  |  |
| `variant` | `NotificationVariant` | `'inline'` | Inline (default) or toast. |
| `kind` | `NotificationKind` | `'error'` | Status kind; sets the colour and the icon. |
| `low-contrast` | `boolean` | `false` | Tinted surface with primary text instead of the inverse surface. |
| `heading` | `string` | `''` | Bold title; the `title` slot replaces it when markup is needed. (Before 0.5: the `title` attribute, still accepted.) |
| `subtitle` | `string` | `''` | Body text; the `subtitle` slot replaces it when markup is needed. |
| `caption` | `string` | `''` | Toast only: small text under the subtitle, e.g. the time. |
| `action-label` | `string` | `''` | Label of the action button; set it to get Carbon's actionable notification. |
| `timeout` | `number` | `0` | Milliseconds after which the notification closes itself (toast); 0 = never. Paused on hover / focus; ignored with `action-label`. |
| `hide-close-button` | `boolean` | `false` |  |
| `close-on-escape` | `boolean` | `true` | Esc closes an actionable notification while focus is inside it (Carbon `closeOnEscape`). |
| `no-autofocus` | `boolean` | `false` | Keep focus where it is instead of moving it to the action button (Carbon `hasFocus={false}`). |
| `full-width` | `boolean` | `false` | Fills its container instead of Carbon's 288–832px cap (inline / callout; a toast stays 288px). |
| `close-label` | `string` | `''` | Accessible name of the close button. |
| `icon-label` | `string` | `''` | Accessible description of the status icon; defaults to "`kind` icon" (e.g. "error icon") like Carbon. |
| `open` | `boolean` | `true` | False once closed (reflects `open="false"`); set back to true to show it again. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `titleText` |  |  |
| `role` | `NotificationRole \| null` | ARIA role of the notification box; defaults to `status`, or `alertdialog` when there is an action button. A `role` attribute is read and moved inside. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Extra content after the subtitle (links, details) |
| `title` | Title with markup; the `heading` attribute is the plain-text fallback |
| `subtitle` | Subtitle with markup; the `subtitle` attribute is the plain-text fallback |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The notification box |
| `icon` | The status icon |
| `title` | The title |
| `subtitle` | The subtitle |
| `caption` | The toast caption |
| `action-button` | The action button |
| `close-button` | The close button |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-close` | After it closed |
| `ui-action` | The action button was pressed |
| `ui-request-close` | Cancelable; detail: { reason: 'close-button' \| 'escape' \| 'timeout' } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-close-inset` | `(ตามบริบท)` |
| `--ui-close-size` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-info` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-canvas` | `(ตามบริบท)` |
| `--ui-inverse-hover` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-link-inverse` | `(ตามบริบท)` |
| `--ui-notification-action-hover` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse-active` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse-hover` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse-text` | `(ตามบริบท)` |
| `--ui-notification-background` | `(ตามบริบท)` |
| `--ui-notification-background-error` | `(ตามบริบท)` |
| `--ui-notification-background-info` | `(ตามบริบท)` |
| `--ui-notification-background-success` | `(ตามบริบท)` |
| `--ui-notification-background-warning` | `(ตามบริบท)` |
| `--ui-notification-bar-width` | `(ตามบริบท)` |
| `--ui-notification-edge` | `(ตามบริบท)` |
| `--ui-notification-focus` | `(ตามบริบท)` |
| `--ui-notification-frame-start` | `(ตามบริบท)` |
| `--ui-notification-hover` | `(ตามบริบท)` |
| `--ui-notification-ink` | `(ตามบริบท)` |
| `--ui-notification-link` | `(ตามบริบท)` |
| `--ui-notification-radius` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-success` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-toast-shadow` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-number-input>`

Carbon-style number input (`NumberInput`): a native `type="number"` field with the browser spinner replaced by Carbon's two 40px stepper buttons (− then +, divided by hairlines) at the end of the field. ↑ / ↓ step as well. The value is kept as text so the field can be empty.

นำเข้า: `import '@purpurabog/ui/number-input';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `value` | `string` | `''` | The field text; `valueAsNumber` gives the parsed number (NaN while empty or invalid). |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `placeholder` | `string` | `''` |  |
| `prefix-text` | `string` | `''` | Text inside the field before the value, e.g. a currency (`฿`); not part of `value`. Part of the field's description for screen readers. |
| `suffix-text` | `string` | `''` | Text inside the field after the value, e.g. a unit (`kg`); not part of `value`. Part of the field's description for screen readers. |
| `min` | `number \| undefined` |  |  |
| `max` | `number \| undefined` |  |  |
| `step` | `number` | `1` | Step of the ± buttons and ↑ / ↓; with `type="number"` also the allowed precision. |
| `step-start-value` | `number` | `0` | Where the steppers start from an empty field (Carbon `stepStartValue`); 0 = Carbon's rule: ±1, or `min` when only a minimum is set. |
| `type` | `NumberInputType` | `'number'` | `number`: a native number field. `text`: a text field formatted for `locale` with `format-options` (Carbon `type="text"`). |
| `locale` | `string` | `''` | BCP 47 locale of the formatting with `type="text"`; empty = the page language (`lang` on the element, an ancestor or `<html>`), as `ui-date-picker`. |
| `format-options` | `Intl.NumberFormatOptions` | `{}` | `Intl.NumberFormat` options with `type="text"`, e.g. `{"style":"currency","currency":"THB"}` or `{"maximumFractionDigits":2}`. |
| `allow-empty` | `boolean` | `false` | An empty field is valid (Carbon `allowEmpty`); otherwise empty counts as missing. |
| `hide-steppers` | `boolean` | `false` | Remove the − / + buttons (keyboard stepping still works). |
| `disable-wheel` | `boolean` | `false` | Ignore mouse-wheel changes while focused (Carbon `disableWheel`). |
| `size` | `NumberInputSize` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidNumberInput`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `decrement-label` | `string` | `''` | Accessible name of the − button. |
| `increment-label` | `string` | `''` | Accessible name of the + button. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `valueAsNumber` |  | The parsed value, NaN while empty or not a number. |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box |
| `label` | The label |
| `input` | The native input |
| `prefix` | The text before the value |
| `suffix` | The text after the value |
| `controls` | The stepper group |
| `decrement-button` | The − button |
| `increment-button` | The + button |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | After a committed change (blur / Enter / stepper; with `type="text"`, on blur when the number changed) |
| `input` | On every keystroke or stepper click |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-number-input-skeleton>`

Carbon `NumberInputSkeleton` (`cds-number-input-skeleton`): the shape of a `<ui-number-input>` while its data loads — a 75×14 label bar, 8px, then the field's bar at its `size` (sm 32 / md 40 / lg 48px). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/number-input';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The field's height: sm 32px, md 40px, lg 48px. |
| `hide-label` | `boolean` | `false` | No label bar (the field had `hide-label`). |
| `fluid` | `boolean` | `false` | The fluid field's skeleton (Carbon `Fluid*Skeleton`): a 64px box with two bars; `<ui-fluid-form>` sets it. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `field` | The field bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-ordered-list>`

Carbon `OrderedList` (`cds-ordered-list`): `<ui-list-item>`s numbered "1." 24px before the text (outside the list's box, as Carbon); a nested list uses the browser's lower-latin markers (a. b. c.), 32px in. `native` uses the browser's decimal markers at the top level too.

นำเข้า: `import '@purpurabog/ui/list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `nested` | `boolean` | `false` | Nested in another list's item (set for you when it sits in a `<ui-list-item>`). |
| `native` | `boolean` | `false` | The browser's own markers (`decimal`) instead of Carbon's counter. |
| `is-expressive` | `boolean` | `false` | Body-02 type (16px) for expressive pages. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-list-item>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `list` | The `<ol>` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-body` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-overflow-menu>`

Carbon `OverflowMenu` (v12): a ghost icon button ("⋮", named by `label` through an icon tooltip) that opens a `<ui-menu>` of the slotted items. Sizes sm 32 / md 40 / lg 48px. Listen for `ui-select` on this element; `event.target` is the activated `<ui-menu-item>`.

นำเข้า: `import '@purpurabog/ui/overflow-menu';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `label` | `string` | `''` | Accessible name of the trigger and the menu. |
| `size` | `OverflowMenuSize` | `'md'` |  |
| `placement` | `MenuPlacement` | `'bottom-start'` |  |
| `tooltip-placement` | `TooltipPlacement` | `'bottom'` |  |
| `disabled` | `boolean` | `false` |  |
| `open` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-menu-item>`, `<ui-menu-divider>`, `<ui-menu-group>` |
| `icon` | Replaces the "⋮" icon |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The icon button |
| `menu` | The `<ui-menu>` |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-select` | bubbles from the activated item: detail { value, label, checked } |
| `ui-toggle` | detail: { open } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-available-height` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-max-width` | `(ตามบริบท)` |
| `--ui-menu-min-width` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-overflow-open-background` | `(ตามบริบท)` |
| `--ui-overflow-open-shadow` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-page-header>`

Carbon `PageHeader` (Carbon for IBM Products `c4p-page-header`): the top of a page — a 40px breadcrumb bar (`<ui-page-header-breadcrumb>`), the content (`<ui-page-header-content>`: heading-04 title, icon, contextual and page actions, `<ui-page-header-content-text>`), and a tab bar (`<ui-page-header-tabs>`), on layer-01 with a line below. It sticks as the page scrolls: the content slides under the breadcrumb bar, which stays (as do the tabs); once the title has gone its `<ui-page-header-title-breadcrumb>` appears in the trail, and the content's page actions give way to the bar's `slot="content-actions"`. `<ui-page-header-scroller>` collapses / expands it.

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `full-width-grid` | `boolean` | `false` | No 1584px cap on the grid. |
| `narrow-grid` | `boolean` | `false` | Hang the text on the grid margin. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `state` | `PageHeaderState` | The shared state; its parts read it. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The parts |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-page-header-state` | The state changed (`state`: fullyCollapsed, titleClipped, contentActionsClipped …); not bubbling |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-page-header-top` | `(ตามบริบท)` |

## `<ui-page-header-actions>`

Carbon for IBM Products `PageHeaderActionsSet`: the page's buttons side by side; those that don't fit — from the end — go into a "⋮" overflow menu (48px kept for it, as Carbon), choosing one clicks its button. Put it in `<ui-page-header-breadcrumb>`'s or `<ui-page-header-content>`'s `page-actions` slot.

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `overflow-label` | `string` | `''` | The overflow menu's name (default: the translation's "More actions"). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The buttons (`<ui-icon-button>`s, `<ui-button>`s), in order; each one's `label` (else its text) names it in the menu |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `overflow` | The overflow menu |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-page-header-breadcrumb>`

The page header's 40px breadcrumb bar: `slot="icon"` (16px), the trail (a `<ui-breadcrumb>`), and at the end a toolbar with `slot="content-actions"` (shown once the content's page actions have scrolled away) and `slot="page-actions"` (always). It sticks while the content scrolls under it. `border` (default) draws its line.

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `border` | `boolean` | `true` | The line under the bar. |
| `page-actions-flush` | `boolean` | `false` | The page actions reach the screen's edge. |
| `content-actions-flush` | `boolean` | `false` | No 12px gap after the content actions. |
| `actions-aria-label` | `string` | `''` | The toolbar's name (default "Page header actions", translated). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The breadcrumb trail |
| `icon` | A 16px icon before the trail |
| `content-actions` | The content's page actions again, for when they have scrolled away |
| `page-actions` | Actions for the whole page (e.g. ghost icon buttons) |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-page-header-bar-top` | `(ตามบริบท)` |
| `--ui-page-header-top` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-page-header-content>`

The page header's content, 48px under the bar: `slot="icon"` (32px), the title (heading-04, at most 640px and two lines — one beside contextual actions — the whole title in a tooltip when cut), `slot="contextual-actions"` (e.g. a tag) after it, `slot="page-actions"` at the end (fading out once they have scrolled under the bar), then the default slot (a `<ui-page-header-content-text>`).

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `heading` | `string` | `''` | The page's title (Carbon `title`, which would also be the element's native tooltip). |
| `heading-level` | `string` | `'h1'` | The title's element (h1 … h6). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `titleElement` | `HTMLElement \| undefined` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | What follows the title (a `<ui-page-header-content-text>`) |
| `icon` | An icon before the title |
| `title` | Rich title instead of `heading` |
| `contextual-actions` | Next to the title |
| `page-actions` | At the end of the title row |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `title` | The title heading |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-duration-moderate-02` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-font-heading-04` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-page-header-top` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |

## `<ui-page-header-content-text>`

The page header's text under the title: an optional `subtitle` (heading-03, 8px above the text), then body-01 text at most 640px wide, 24px above the header's end.

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `subtitle` | `string` | `''` |  |
| `subtitle-level` | `string` | `'h2'` | The subtitle's element (h1 … h6). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `subtitle` | The subtitle heading |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-body-01` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-page-header-hero-image>`

A hero image beside the page header's content: 3:2, 2:1 from lg; the slotted `<img>` covers it (`object-fit`).

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `object-fit` | `'cover' \| 'contain'` | `'cover'` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The `<img>` (or `<picture>`) |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-page-header-scroller>`

The page header's collapse / expand button (Carbon `PageHeaderScrollButton`): a ghost 40px icon button with a chevron; it scrolls the page so the content is just under the breadcrumb bar, or back to the top. Its name and tooltip say which ("Collapse" / "Expand", translated).

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `collapse-text` | `string` | `''` |  |
| `expand-text` | `string` | `''` |  |

### Slots
_ไม่มี_

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-page-header-top` | `(ตามบริบท)` |

## `<ui-page-header-tabs>`

The page header's tab bar: a `<ui-tabs>` on the grid, `slot="tags"` at its end (40%), `slot="scroller"` (a `<ui-page-header-scroller>`). It sticks under the breadcrumb bar; `disable-sticky-tab-bar` lets the header scroll away and fixes the breadcrumb bar instead.

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `disable-sticky-tab-bar` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The tabs |
| `tags` | Tags at the end |
| `scroller` | The collapse / expand button |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-page-header-bar-top` | `(ตามบริบท)` |
| `--ui-page-header-top` | `(ตามบริบท)` |

## `<ui-page-header-tags>`

Carbon for IBM Products `PageHeaderTagsSet`: the page's tags on one line, at the end; those that don't fit — from the end — make a "+N" operational tag that opens them in a high-contrast popover (ten at most: past ten, "View all tags" opens a small modal of them all, with a search). Dismissible tags can be dismissed from any of the three. "N more tags" is announced. Put it in `<ui-page-header-tabs>`'s `tags` slot (or the content's `contextual-actions`).

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `tags` | `PageHeaderTag[]` | `[]` | The tags, in order (Carbon `tags-data`; JSON as an attribute). |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `more` | The "+N" tag |
| `popover` | The popover of hidden tags |
| `modal` | The "All tags" modal |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-tag-dismiss` | detail: { tag, index } after a dismissible tag was dismissed (it is already gone from `tags`) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-inverse` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inverse` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-canvas` | `(ตามบริบท)` |
| `--ui-inverse-hover` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-link-inverse` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tag-background-blue` | `(ตามบริบท)` |
| `--ui-tag-background-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-background-cyan` | `(ตามบริบท)` |
| `--ui-tag-background-gray` | `(ตามบริบท)` |
| `--ui-tag-background-green` | `(ตามบริบท)` |
| `--ui-tag-background-magenta` | `(ตามบริบท)` |
| `--ui-tag-background-purple` | `(ตามบริบท)` |
| `--ui-tag-background-red` | `(ตามบริบท)` |
| `--ui-tag-background-teal` | `(ตามบริบท)` |
| `--ui-tag-background-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-border-blue` | `(ตามบริบท)` |
| `--ui-tag-border-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-border-cyan` | `(ตามบริบท)` |
| `--ui-tag-border-gray` | `(ตามบริบท)` |
| `--ui-tag-border-green` | `(ตามบริบท)` |
| `--ui-tag-border-magenta` | `(ตามบริบท)` |
| `--ui-tag-border-purple` | `(ตามบริบท)` |
| `--ui-tag-border-red` | `(ตามบริบท)` |
| `--ui-tag-border-teal` | `(ตามบริบท)` |
| `--ui-tag-border-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-color-blue` | `(ตามบริบท)` |
| `--ui-tag-color-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-color-cyan` | `(ตามบริบท)` |
| `--ui-tag-color-gray` | `(ตามบริบท)` |
| `--ui-tag-color-green` | `(ตามบริบท)` |
| `--ui-tag-color-magenta` | `(ตามบริบท)` |
| `--ui-tag-color-purple` | `(ตามบริบท)` |
| `--ui-tag-color-red` | `(ตามบริบท)` |
| `--ui-tag-color-teal` | `(ตามบริบท)` |
| `--ui-tag-color-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-font` | `(ตามบริบท)` |
| `--ui-tag-high-contrast` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-border` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-edge` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-focus` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-hover` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-ink` | `(ตามบริบท)` |
| `--ui-tag-hover-blue` | `(ตามบริบท)` |
| `--ui-tag-hover-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-hover-cyan` | `(ตามบริบท)` |
| `--ui-tag-hover-gray` | `(ตามบริบท)` |
| `--ui-tag-hover-green` | `(ตามบริบท)` |
| `--ui-tag-hover-magenta` | `(ตามบริบท)` |
| `--ui-tag-hover-purple` | `(ตามบริบท)` |
| `--ui-tag-hover-red` | `(ตามบริบท)` |
| `--ui-tag-hover-teal` | `(ตามบริบท)` |
| `--ui-tag-hover-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-radius` | `(ตามบริบท)` |
| `--ui-tag-selectable-border` | `(ตามบริบท)` |
| `--ui-tag-selected` | `(ตามบริบท)` |
| `--ui-tag-selected-ink` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-page-header-title-breadcrumb>`

The page header's title as the last crumb (Carbon `PageHeaderTitleBreadcrumb`): hidden — and out of the tab order — until the title has scrolled under the breadcrumb bar, then it rises in (150ms; a fade with reduced motion). Without a `<ui-page-header-content>` it always shows. Put it last in the `<ui-breadcrumb>`.

นำเข้า: `import '@purpurabog/ui/page-header';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `''` |  |
| `current` | `boolean` | `false` | The page the user is on: plain text with `aria-current="page"`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The item text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link or the current-page text |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-breadcrumb-wrap` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-link-hover` | `(ตามบริบท)` |
| `--ui-page-header-top` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-pagination>`

Carbon `Pagination`: a bar with "Items per page" (a borderless select), the item range, the page select ("page N"), "of N pages" and previous / next buttons. Heights sm 32 / md 40 (default) / lg 48, layer surface with a 1px top border, controls separated by hairlines, as in Carbon.

นำเข้า: `import '@purpurabog/ui/pagination';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `page` | `number` | `1` | 1-based current page. |
| `page-size` | `number` | `10` |  |
| `page-sizes` | `string` | `'10,25,50'` | Choices for the page-size select, e.g. "10,25,50". Empty hides the select. |
| `total-items` | `number` | `0` |  |
| `pages-unknown` | `boolean` | `false` | Total unknown: no page select, next never disabled (Carbon `pagesUnknown`). |
| `is-last-page` | `boolean` | `false` | With `pages-unknown`: this is the last page, so Next is disabled (Carbon `isLastPage`; cursor-based APIs). |
| `size` | `PaginationSize` | `'md'` |  |
| `disabled` | `boolean` | `false` |  |
| `items-per-page-text` | `string \| undefined` |  |  |
| `item-range-text` | `string \| undefined` |  |  |
| `item-text` | `string \| undefined` |  | Range text while the total is unknown. |
| `page-range-text` | `string \| undefined` |  |  |
| `page-text` | `string \| undefined` |  | Label of each page option and the page text while unknown. |
| `page-select-label` | `string \| undefined` |  |  |
| `previous-label` | `string \| undefined` |  |  |
| `next-label` | `string \| undefined` |  |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `totalPages` |  |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The bar |
| `page-size-select` | The items-per-page select |
| `range` | The item range text |
| `page-select` | The page select |
| `pages` | The "of N pages" text |
| `previous-button` | Previous page |
| `next-button` | Next page |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-change` | detail: { page, pageSize } after the user changed either |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pagination-background` | `(ตามบริบท)` |
| `--ui-pagination-border` | `(ตามบริบท)` |
| `--ui-pagination-button-radius` | `(ตามบริบท)` |
| `--ui-pagination-divider` | `(ตามบริบท)` |
| `--ui-pagination-gap` | `(ตามบริบท)` |
| `--ui-pagination-range-ink` | `(ตามบริบท)` |
| `--ui-pagination-select-border` | `(ตามบริบท)` |
| `--ui-pagination-select-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-pagination-nav>`

Carbon `PaginationNav` (`cds-pagination-nav`): numbered pages between Previous and Next, the pages that don't fit folded into "…" selects (core/pagination-nav). `page` is 0-based, as Carbon's; `items-shown` page items show (at least 4); `loop` wraps Previous / Next; `disable-overflow` turns the "…" selects off. Each page is a button (`aria-current="page"` on the current one, `tabindex="0"` so Safari focuses it on click and Tab reaches it) and the change is announced ("Page 3 of 25").

นำเข้า: `import '@purpurabog/ui/pagination-nav';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `page` | `number` | `0` | The current page, 0-based (Carbon). |
| `total-items` | `number` | `1` |  |
| `items-shown` | `number` | `10` | Page items in the row (at least 4). |
| `loop` | `boolean` | `false` | Previous on the first page goes to the last, Next on the last to the first. |
| `disable-overflow` | `boolean` | `false` | The "…" selects can't be opened. |
| `size` | `NavSize` | `'lg'` |  |
| `tooltip-placement` | `TooltipPlacement` | `'bottom'` | Where Previous / Next show their tooltip. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The `<nav>` |
| `page` | Each page button |
| `overflow` | Each "…" select |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-change` | detail: { page } (0-based) after the user chose a page |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-interactive` | `(ตามบริบท)` |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pagination-nav-mark-height` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-popover>`

Carbon `Popover`: the floating box primitive behind tooltips, toggletips and menus, for when you need your own content next to a trigger. Put the trigger in slot `trigger` and the content in the default slot; set `open` yourself (or use `auto-close` to let Escape and outside clicks close it). Variants: `caret` (default on, 12×6, 10px offset), `drop-shadow` (default on), `high-contrast` (inverse colours), `tab-tip` (square, flush under the trigger, no caret). Lives in the top layer at document coordinates and flips when it does not fit. Beyond Carbon, `open-on-hover` lets it open itself, as a hover preview: see `openOnHover`.

นำเข้า: `import '@purpurabog/ui/popover';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `open` | `boolean` | `false` |  |
| `placement` | `Placement` | `'bottom'` |  |
| `caret` | `boolean` | `true` | On by default; `caret="false"` hides it. |
| `drop-shadow` | `boolean` | `true` | On by default; `drop-shadow="false"` removes it. |
| `high-contrast` | `boolean` | `false` |  |
| `tab-tip` | `boolean` | `false` | Carbon `isTabTip`: square box flush against the trigger (toolbar settings panels). |
| `auto-close` | `boolean` | `false` | Close on Escape and on clicks outside the trigger and the box. |
| `label` | `string` | `''` | Accessible name of the box (`role=group`). |
| `open-on-hover` | `boolean` | `false` | Beyond Carbon (its Popover has no hover mode; the tooltip's timings): the popover opens and closes itself. A mouse resting on the trigger opens it after 100ms, and leaving the trigger and the box closes it after 300ms (the pointer can move onto the box, WCAG 1.4.13); keyboard focus on the trigger opens it at once, and focus leaving the trigger and the box closes it; a tap (touch, pen) on the trigger toggles it; Escape and a press outside close it. While focus is in the box, or on the trigger by keyboard, it stays open. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The element the box is positioned against |
| `(default)` | Box content |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `content` | The floating box |
| `caret` | The arrow |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open } after it opens or closes |
| `ui-request-close` | cancelable; `auto-close` fires it before closing on Escape / outside click |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-productive-card>`

Carbon for IBM Products `ProductiveCard`: a `$layer` card for dense product UI — a heading-compact-02 title (`title-size="large"`: heading-03), its label and description, the body, and actions: icon buttons (`slot="actions"`, ghost; the card sizes them sm at the top, md at the bottom) or an overflow menu instead (`<ui-menu-item slot="overflow">`s), at the top (default) or the bottom (`actions-placement`). Primary and secondary buttons are ghost buttons: at the bottom (md, in a footer under a `border-subtle-01` line) or, next to the top actions, at the top (sm). It follows the `<ui-layer>` it sits on. IBM Products' current, prop-driven (legacy-style) card: use it where a screen must match IBM product UIs; for new work prefer `ui-card` (Carbon's parts-based card, the direction of both Carbon and IBM Products' unreleased Card next).

นำเข้า: `import '@purpurabog/ui/product-card';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `click-zone` | `ProductCardClickZone` | `'one'` | Which zone `clickable` makes one button: one = the card, two = the header with the body, three = the body. |
| `actions-placement` | `ProductCardPlacement` | `'top'` | Where the action icons (or the overflow menu) go. |
| `title-size` | `ProductCardTitleSize` | `'default'` | default: heading-compact-02; large: heading-03. |
| `overflow-aria-label` | `string` | `''` | The overflow menu's name and tooltip (default: the translation's "Options", as Carbon's `iconDescription`). |
| `primary-button-placement` | `ProductCardPlacement` | `'bottom'` | At the top the primary button joins the top actions (a ghost sm button, without `href`). |
| `secondary-button-placement` | `ProductCardPlacement` | `'bottom'` | At the top the secondary button joins the top actions, only when there are other top actions (as Carbon). |
| `heading` | `string` | `''` | The title (Carbon `title`; named `heading` because `title` is every element's native tooltip). |
| `heading-level` | `string` | `'h2'` | The title's element (h1 … h6; Carbon `Heading` in its `Section`, an `<h2>` at the top of a page). |
| `label` | `string` | `''` | Text above the title (label-01). |
| `description` | `string` | `''` | Text below the title (label-01). |
| `clickable` | `boolean` | `false` | Makes the card's click zone one button (Carbon: an `onClick`); listen for `ui-click`. |
| `disabled` | `boolean` | `false` | Announced as disabled (`aria-disabled`, as Carbon); a clickable zone then fires no `ui-click`. No other change, as Carbon. |
| `primary-button-text` | `string` | `''` |  |
| `primary-button-href` | `string` | `''` | Makes the primary button a link (in the footer; Carbon's button at the top takes no `href`). |
| `primary-button-disabled` | `boolean` | `false` |  |
| `secondary-button-text` | `string` | `''` |  |
| `secondary-button-href` | `string` | `''` | Makes the secondary button a link. |
| `secondary-button-disabled` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The body (body-compact-01) |
| `label` | Replaces `label` |
| `title` | Replaces `heading` |
| `description` | Replaces `description` |
| `actions` | Icon buttons (`<ui-icon-button label="…">`); the card sets their `size` |
| `overflow` | `<ui-menu-item>`s of the overflow menu, shown instead of the action icons |
| `primary-button-icon` | A 16px icon after the primary button's text (Carbon `primaryButtonIcon`) |
| `secondary-button-icon` | A 16px icon after the secondary button's text |
| `decorator` | E.g. an AI label, 16px from the top-end corner |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The card |
| `click-zone` | The clickable zone's button (`clickable` only), covering the zone |
| `content` | The header, body and footer |
| `header` | The header |
| `label` | The label |
| `title` | The title (`<h2>` by default) |
| `description` | The description |
| `actions` | The action icons' (or overflow menu's) box, with the top buttons |
| `overflow` | The `<ui-overflow-menu>` |
| `body` | The body |
| `footer` | The footer |
| `primary-button` | The primary `<ui-button>` |
| `secondary-button` | The secondary `<ui-button>` |
| `decorator` | The decorator's box |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(has-footer)` | While the footer shows (also `[data-has-footer]`) |
| `:state(overflow)` | While the overflow menu replaces the action icons (also `[data-overflow]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-click` | The click zone was activated (a click, Enter or Space); not while `disabled` |
| `ui-primary-button-click` | The primary button was activated |
| `ui-secondary-button-click` | The secondary button was activated |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-tile` | `(ตามบริบท)` |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-overflow` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-compact-02` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-row-divider` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tile-border-color` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-progress-bar>`

Carbon `ProgressBar`: a labelled track that fills to `value / max`, or sweeps when `value` is unset (indeterminate). `status="finished"` fills it green with a check mark, `status="error"` empties it and turns label icon, bar and helper text red. `type="inline"` puts label and track on one line (helper text is read by screen readers only); `type="indented"` indents label and helper text by 16px to line up with indented content.

นำเข้า: `import '@purpurabog/ui/progress-bar';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Required. What is progressing; shown above (or beside) the track and read as the bar's name. |
| `hide-label` | `boolean` | `false` | Visually hides the label (it still names the bar). |
| `helper-text` | `string` | `''` |  |
| `value` | `number \| undefined` |  | Current progress; leave unset for an indeterminate bar. |
| `max` | `number` | `100` |  |
| `size` | `ProgressBarSize` | `'md'` |  |
| `status` | `ProgressBarStatus` | `'active'` |  |
| `type` | `ProgressBarType` | `'default'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The wrapper |
| `label` | Label row (text + status icon) |
| `track` | The `progressbar` element |
| `bar` | The filled portion |
| `helper-text` | Helper text below the track |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-progress-radius` | `(ตามบริบท)` |
| `--ui-progress-track` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-success` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-progress-indicator>`

Carbon `ProgressIndicator`: an ordered list of `<ui-progress-step>`s. Steps before `current-index` are complete, the one at it is current, the rest incomplete (a step's own `complete` wins). `vertical` stacks the steps; `space-equally` stretches them across the width. `interactive` makes the steps clickable and Tab stops (Carbon makes them clickable when `onChange` is given; a listener can't be seen here): a click on a step that is neither current nor disabled makes it current and fires `ui-change` with its index. Without `interactive` no step is a Tab stop.

นำเข้า: `import '@purpurabog/ui/progress-indicator';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `current-index` | `number` | `0` | Index of the current step (0-based). |
| `vertical` | `boolean` | `false` |  |
| `space-equally` | `boolean` | `false` | Stretch the steps to share the width (horizontal only). |
| `interactive` | `boolean` | `false` | Let the user jump between steps (fires `ui-change`). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-progress-step>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The list |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-change` | detail: { index } when the user picks another step |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-link-hover` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-progress-label-gap` | `(ตามบริบท)` |
| `--ui-progress-label-max-width` | `(ตามบริบท)` |
| `--ui-progress-label-overflow` | `(ตามบริบท)` |
| `--ui-progress-label-text-overflow` | `(ตามบริบท)` |
| `--ui-progress-label-white-space` | `(ตามบริบท)` |
| `--ui-progress-step-flex` | `(ตามบริบท)` |
| `--ui-progress-step-min-width` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-progress-indicator-skeleton>`

Carbon `ProgressIndicatorSkeleton` (`cds-progress-indicator-skeleton`): `steps` incomplete steps (128px wide in a row, or stacked with `vertical`): the subtle line, the empty-circle icon and a 40×14 label bar. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/progress-indicator';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `steps` | `number` | `4` |  |
| `vertical` | `boolean` | `false` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `step` | Each step |
| `label` | Each label bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-progress-step>`

Carbon `ProgressStep`: one step of a `<ui-progress-indicator>`. Its state (complete / current / incomplete) comes from the indicator's `current-index` unless `complete` is set; `invalid` shows a warning icon, `disabled` greys it out and makes it unclickable.

นำเข้า: `import '@purpurabog/ui/progress-indicator';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `secondary-label` | `string` | `''` | Smaller text under the label (Carbon `secondaryLabel`). |
| `complete` | `boolean` | `false` | Marks the step done regardless of `current-index`. |
| `invalid` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` |  |
| `data-state` | `ProgressStepState` | `'incomplete'` | Set by the indicator: the resolved state. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `clickable` | `boolean` | Set by the indicator: whether steps are clickable. |
| `index` | `number` | Set by the indicator: this step's position. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Nothing; use `label` and `secondary-label` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `button` | The clickable step |
| `icon` | The state icon |
| `label` | The label |
| `secondary-label` | The secondary label |
| `line` | The progress line |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-step-click` |  |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-link-hover` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-progress-label-gap` | `(ตามบริบท)` |
| `--ui-progress-label-max-width` | `(ตามบริบท)` |
| `--ui-progress-label-overflow` | `(ตามบริบท)` |
| `--ui-progress-label-text-overflow` | `(ตามบริบท)` |
| `--ui-progress-label-white-space` | `(ตามบริบท)` |
| `--ui-progress-step-flex` | `(ตามบริบท)` |
| `--ui-progress-step-min-width` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-radio>`

One option inside `<ui-radio-group>`. Native radios can't group across shadow roots, so this follows the WAI-ARIA radio-group pattern: role/aria-checked/roving tabindex live on the host, and the group handles keyboard and form value.

นำเข้า: `import '@purpurabog/ui/radio';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `string` | `''` |  |
| `checked` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `label-position` | `RadioLabelPosition \| undefined` |  | Carbon `labelPosition`: `left` puts the text before the circle; unset, the group's `label-position` applies. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Label text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `circle` | The drawn radio circle |
| `label` | The text beside it |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radio-border` | `(ตามบริบท)` |
| `--ui-radio-checked` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-radio-group>`

Carbon-style radio button group. Holds `<ui-radio>` or `<ui-radio-tile>` options.

นำเข้า: `import '@purpurabog/ui/radio';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Group label (rendered like a fieldset legend). |
| `hide-label` | `boolean` | `false` | Keep the group label for screen readers but don't show it. |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `value` | `string` | `''` |  |
| `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` |  |
| `label-position` | `RadioLabelPosition` | `'right'` | Carbon `labelPosition`: `left` puts each radio's text before its circle (default `right`, after it). |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `required-text` | `string` | `''` | Error text for an empty required group. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-radio>` options |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The group box holding the radios |
| `label` | The group label |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `input` |  |
| `change` | When the user picks an option |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radio-border` | `(ตามบริบท)` |
| `--ui-radio-checked` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-radio-skeleton>`

Carbon `RadioButtonSkeleton` (`cds-radio-button-skeleton`): a 100×18 label bar (Carbon draws no circle). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/radio';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-radio-tile>`

A radio option rendered as a tile (Carbon `RadioTile`). Put several in a `<ui-radio-group>`, which provides the radiogroup role, arrow-key navigation, form value, required / readonly / warn handling. As Carbon, the check mark shows only on the chosen tile.

นำเข้า: `import '@purpurabog/ui/tile';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `string` | `''` |  |
| `checked` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `label-position` | `RadioLabelPosition \| undefined` |  | Carbon `labelPosition`: `left` puts the text before the circle; unset, the group's `label-position` applies. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Tile content (title, description…) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `circle` | The drawn radio circle |
| `label` | The text beside it |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-highlight` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radio-border` | `(ตามบริบท)` |
| `--ui-radio-checked` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tile-border-color` | `(ตามบริบท)` |
| `--ui-tile-mark-space` | `(ตามบริบท)` |
| `--ui-tile-selected-background` | `(ตามบริบท)` |
| `--ui-tile-selected-border` | `(ตามบริบท)` |
| `--ui-tile-selected-hover` | `(ตามบริบท)` |
| `--ui-tile-selected-mark` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-search>`

Carbon-style search field (`Search`): a `role="search"` landmark holding a visually hidden label, a magnifier, an `<input type="search">` and a clear button that appears once there is text. Esc clears the text (and keeps focus), as in Carbon. The clear button is reachable with Tab.

นำเข้า: `import '@purpurabog/ui/search';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Accessible name of the field (visually hidden, as in Carbon). |
| `placeholder` | `string` | `''` |  |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `SearchSize` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `autocomplete` | `string` | `'off'` |  |
| `inputmode` | `string` | `''` | Passed to the text box: the virtual keyboard to show (`numeric`, `decimal`, `email`, `tel`, `url`, `search`…). |
| `enterkeyhint` | `string` | `''` | Passed to the text box: the label of the virtual keyboard's Enter key (`search`, `send`, `next`, `done`…). |
| `clear-label` | `string` | `''` | Accessible name of the clear button. |
| `required` | `boolean` | `false` | Constraint validation like `<input type="search">`: blocks submit and reports in the browser's bubble (Carbon Search has no error line). |
| `pattern` | `string` | `''` |  |
| `minlength` | `number \| undefined` |  |  |
| `maxlength` | `number \| undefined` |  |  |
| `readonly` | `boolean` | `false` | Value can be selected and submitted but not changed; no clear button. |
| `fluid` | `boolean` | `false` | Carbon `FluidSearch`: the label inside a 64px box. `<ui-fluid-form>` sets it for every field inside. |
| `expandable` | `boolean` | `false` | Carbon `ExpandableSearch`: collapsed to its magnifier until opened. |
| `expanded` | `boolean` | `false` | Whether an expandable search is open. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The role=search wrapper |
| `input` | The native search input |
| `label` | The label (visually hidden, as in Carbon; shown inside the box when `fluid`) |
| `magnifier` | The search icon |
| `clear-button` | The clear button |
| `magnifier-button` | The magnifier of an expandable search |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(has-value)` | While it holds a value (also `[data-has-value]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When the value is committed (blur / Enter) or cleared |
| `ui-toggle` | detail: { expanded } when an expandable search opens or collapses |
| `input` | On every keystroke |
| `ui-clear` | After the clear button or Esc emptied the field |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-search-skeleton>`

Carbon `SearchSkeleton` (`cds-search-skeleton`): the shape of a `<ui-search>` while its data loads — one bar at the field's height (sm 32 / md 40 / lg 48px); `fluid` (or inside `<ui-fluid-form>`) Carbon `FluidSearchSkeleton`: a 64px box with two bars. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/search';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |  |
| `fluid` | `boolean` | `false` | Carbon `FluidSearchSkeleton`. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `field` | The bar (fluid: the box) |
| `label` | Fluid: the 25% bar |
| `value` | Fluid: the 50% bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-section>`

Carbon `Section` (`cds-section`): each section one heading level deeper than the section it sits in (the page itself is level 1), so `<ui-heading>`s inside get the right `<h2>`…`<h6>` without counting. `level` sets it; a later change reaches the sections and headings inside (as Carbon React's context).

นำเข้า: `import '@purpurabog/ui/heading';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `level` | `number \| undefined` |  | The heading level inside, instead of one more than the section around it. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The section's content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-heading-01` | `(ตามบริบท)` |
| `--ui-font-heading-02` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-04` | `(ตามบริบท)` |
| `--ui-font-heading-05` | `(ตามบริบท)` |
| `--ui-font-heading-06` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-select>`

Carbon-style select. Wraps a native `<select>` — the most accessible option, and on touch devices it opens the OS picker.

นำเข้า: `import '@purpurabog/ui/select';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `placeholder` | `string` | `''` | Shown as an empty first choice; with `required` the user must pick something else. |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidSelect`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |
| `inline` | `boolean` | `false` | Label beside a compact, borderless select. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box |
| `label` | The label |
| `input` | The native select |
| `chevron` | The arrow icon |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |
| `:state(placeholder)` | While the placeholder is the shown choice (also `[data-placeholder]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When the user picks an option |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-inline-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-helper` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-item-active-outline` | `(ตามบริบท)` |
| `--ui-menu-item-ink` | `(ตามบริบท)` |
| `--ui-menu-item-radius` | `(ตามบริบท)` |
| `--ui-menu-item-selected` | `(ตามบริบท)` |
| `--ui-menu-max-rows` | `(ตามบริบท)` |
| `--ui-menu-padding` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-select-appearance` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-surface-2` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-select-skeleton>`

Carbon `SelectSkeleton` (`cds-select-skeleton`): the shape of a `<ui-select>` while its data loads — a 75×14 label bar, 8px, then the field's bar at its `size` (sm 32 / md 40 / lg 48px). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/select';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The field's height: sm 32px, md 40px, lg 48px. |
| `hide-label` | `boolean` | `false` | No label bar (the field had `hide-label`). |
| `fluid` | `boolean` | `false` | The fluid field's skeleton (Carbon `Fluid*Skeleton`): a 64px box with two bars; `<ui-fluid-form>` sets it. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `field` | The field bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-selectable-tile>`

A checkbox rendered as a tile (Carbon `SelectableTile`). Same API and form behaviour as `<ui-checkbox>` — a real checkbox inside, so Space toggles, the value is submitted, and `required` / `readonly` / `warn` / ui-checkbox-group all work. The mark is Carbon's checkbox icon.

นำเข้า: `import '@purpurabog/ui/tile';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `checked` | `boolean` | `false` |  |
| `indeterminate` | `boolean` | `false` | Mixed state, e.g. a "select all" box with some children checked. Cleared on user toggle. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `hide-label` | `boolean` | `false` | Keep the label text for screen readers but don't show it. |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `value` | `string` | `'on'` |  |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `groupDisabled` | `boolean` | Set by ui-checkbox-group; kept apart from the author's own disabled / readonly. |
| `groupReadonly` | `boolean` |  |
| `groupMessage` | `string` | Error text of the owning ui-checkbox-group while the group is invalid. The group shows it once below the boxes; each box repeats it as its own accessible description and reports aria-invalid, so a screen reader landing on the first box hears why (an IDREF cannot cross the group's shadow root). |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Tile content (title, description…) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The clickable row (label element) |
| `control` | The native checkbox input |
| `box` | The drawn 16px box |
| `label` | The text beside the box |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When the user toggles the box |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-highlight` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tile-border-color` | `(ตามบริบท)` |
| `--ui-tile-mark-space` | `(ตามบริบท)` |
| `--ui-tile-selected-background` | `(ตามบริบท)` |
| `--ui-tile-selected-border` | `(ตามบริบท)` |
| `--ui-tile-selected-hover` | `(ตามบริบท)` |
| `--ui-tile-selected-mark` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-shape-indicator>`

Carbon `ShapeIndicator` (preview, `cds-shape-indicator`): a status shown by a 16px shape for `kind` (severity or state), in its status colour, followed by `label` — helper-text-01 (12px), or `text-size="14"` body-compact-01. `compact` shows only the shape, with the label in a tooltip (`shape-description` is read instead, if set).

นำเข้า: `import '@purpurabog/ui/status-indicator';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `kind` | `ShapeIndicatorKind \| undefined` |  |  |
| `label` | `string` | `''` |  |
| `text-size` | `12 \| 14` | `12` | 12 (helper-text-01) or 14 (body-compact-01). |
| `compact` | `boolean` | `false` | Only the shape; the label in a tooltip. |
| `shape-description` | `string \| undefined` |  | Read by screen readers in compact mode instead of the label. |
| `placement` | `Placement` | `'right'` | Where the compact tooltip opens. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `icon` | The shape |
| `label` | The label (not compact) |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-side-nav>`

Carbon `SideNav`: the left navigation. Modes: default (slides over the page below `lg`, 256px from `lg` when `expanded`), `rail` (48px icons, expands on hover / focus) and `fixed` + `expanded` (always 256px, pushes `<ui-content>`; `fixed` alone slides the nav out of view while `<ui-content>` keeps its 256px offset). `collapsible` (Carbon `isPersistent={false}`) keeps it closed on large screens too until the hamburger opens it over the page. Escape collapses; below `lg` an overlay covers the page while expanded. The `<ui-header-menu-button>` in the same document (or shadow root) opens and closes it, and follows it (Carbon web components). Children: `<ui-side-nav-items>` holding links, menus and dividers.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `expanded` | `boolean` | `false` |  |
| `rail` | `boolean` | `false` | 48px icon rail that expands on hover / focus. |
| `fixed` | `boolean` | `false` | With `expanded`: always 256px wide, pushing `<ui-content>` aside (no overlay). Set both — without `expanded` the nav slides out of view while `<ui-content>` keeps its 256px offset. |
| `collapsible` | `boolean` | `false` | Closed on large screens too until the hamburger opens it over the page (Carbon `isPersistent={false}`); `<ui-content>` isn't pushed aside. |
| `label` | `string` | `''` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-side-nav-items>` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The `<nav>` |
| `overlay` | The page overlay (below `lg`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded } after a user action changed the state |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing-exit` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-overlay` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-side-nav-divider>`

Carbon `SideNavDivider`: a list item holding a 1px rule with 8px / 16px margins (Carbon renders `<li><hr></li>`).

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |

## `<ui-side-nav-items>`

Carbon `SideNavItems`: the scrolling list inside `<ui-side-nav>`.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-side-nav-link>`, `<ui-side-nav-menu>`, `<ui-side-nav-divider>` |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ไม่อ่าน token โดยตรง
_ไม่มี_

## `<ui-side-nav-link>`

Carbon `SideNavLink`: a navigation link with an optional 16px icon. `current` marks the page. In a collapsed (non-rail) side nav the link leaves the tab order, like Carbon.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'#'` |  |
| `current` | `boolean` | `false` |  |
| `target` | `string` | `''` | Where the link opens (`_blank` for a new tab), as on `<a>`. |
| `rel` | `string` | `''` | The link's relation (`noopener`, `external` …), as on `<a>`. |
| `large` | `boolean` | `false` | 48px row. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Link text |
| `icon` | 16px icon |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-side-nav-menu>`

Carbon `SideNavMenu`: a collapsible group of `<ui-side-nav-menu-item>`s with a title, optional icon and chevron. Shows as active (bar + bold) while collapsed if a child is `current`.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `expanded` | `boolean` | `false` |  |
| `large` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-side-nav-menu-item>` elements |
| `icon` | 16px icon |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The title button |
| `menu` | The list of items |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-side-nav-menu-item>`

Carbon `SideNavMenuItem`: a link inside a `<ui-side-nav-menu>` (32px, indented 32px, or 72px when the parent has an icon).

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'#'` |  |
| `current` | `boolean` | `false` |  |
| `target` | `string` | `''` | Where the link opens (`_blank` for a new tab), as on `<a>`. |
| `rel` | `string` | `''` | The link's relation (`noopener`, `external` …), as on `<a>`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Link text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The link |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-canvas-selected` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-nav-current-background` | `(ตามบริบท)` |
| `--ui-nav-current-mark` | `(ตามบริบท)` |
| `--ui-nav-current-mark-inset` | `(ตามบริบท)` |
| `--ui-nav-current-mark-radius` | `(ตามบริบท)` |
| `--ui-nav-current-mark-width` | `(ตามบริบท)` |
| `--ui-nav-item-inset` | `(ตามบริบท)` |
| `--ui-nav-item-radius` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |

## `<ui-side-panel>`

Carbon for IBM Products `SidePanel` (`c4p-side-panel`): a panel that slides in from the right (or `placement="left"`) under the 48px UI shell header — `size` xs 16rem, sm 20rem, md 30rem, lg 40rem, xl 65rem, 2xl 80rem (at most 75vw from md screens). Slide-over (default) covers the page and keeps Tab inside it; `include-overlay` dims the page and a click on it closes the panel; `slide-in` instead pushes the page aside (`selector-page-content`), takes no focus and no Esc. Header: `label-text` (label-01), `heading` (heading-03), `slot="subtitle"` (body-compact-01), the × button (tooltip left), `current-step` > 0 a back button, `slot="action-toolbar"` small buttons under it. As the content scrolls, the label and subtitle fade and the heading shrinks to heading-compact-02 (`animate-title`, Carbon's default; off with reduced motion). `slot="actions"`: up to four `<ui-button>`s, laid out as Carbon's ActionSet for the panel's size (64px; 48px `condensed-actions`). The content sits on layer 1 (fields are field-02). A slide-over panel is on the page's overlay stack: one Esc closes only the topmost layer (a modal opened from the panel closes first), and a panel opened from a modal opens over it, as a modal dialog of its own, so it can be used.

นำเข้า: `import '@purpurabog/ui/side-panel';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `open` | `boolean` | `false` |  |
| `placement` | `'right' \| 'left'` | `'right'` |  |
| `size` | `SidePanelSize` | `'md'` | xs 16rem, sm 20rem, md 30rem, lg 40rem, xl 65rem, 2xl 80rem. |
| `heading` | `string` | `''` | The heading (Carbon `title`); also the panel's accessible name. |
| `label-text` | `string` | `''` | A small label above the heading. |
| `slide-in` | `boolean` | `false` | Push the page aside (`selector-page-content`) instead of covering it; no focus trap, no Esc. |
| `include-overlay` | `boolean` | `false` | Dim the page; a click on it closes the panel (unless `prevent-close-on-click-outside`). |
| `prevent-close-on-click-outside` | `boolean` | `false` |  |
| `selector-initial-focus` | `string` | `''` | What takes focus on open (a selector in the content), else the first control. |
| `selector-page-content` | `string` | `''` | The page element a slide-in panel pushes aside. |
| `hide-close-button` | `boolean` | `false` |  |
| `close-icon-description` | `string` | `''` | The × button's name and tooltip (default "Close", translated). |
| `close-icon-tooltip-alignment` | `Placement` | `'left'` |  |
| `navigation-back-icon-description` | `string` | `''` | The back button's name and tooltip (default "Back", translated). |
| `current-step` | `number` | `0` | Above 0 shows the back button (a panel with steps). |
| `condensed-actions` | `boolean` | `false` | 48px action buttons instead of 64px. |
| `animate-title` | `boolean` | `true` | Shrink the heading as the content scrolls (Carbon's default). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The content |
| `subtitle` | Text under the heading |
| `above-title` | Content above the label and heading |
| `below-title` | Content under the subtitle |
| `action-toolbar` | Small buttons under the header (the first one with its label) |
| `actions` | The action buttons |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `panel` | The panel |
| `overlay` | The overlay of `include-overlay` |
| `header` | The header |
| `heading` | The heading |
| `body` | The content's box |
| `actions` | The row of action buttons |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-close` | After it closed |
| `ui-navigate-back` | The back button (`current-step` > 0) was pressed |
| `ui-request-close` | Cancelable; detail: { reason: 'escape' \| 'close-button' \| 'overlay' } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-actions-button-align` | `(ตามบริบท)` |
| `--ui-actions-button-flex` | `(ตามบริบท)` |
| `--ui-actions-button-padding-top` | `(ตามบริบท)` |
| `--ui-actions-gap` | `(ตามบริบท)` |
| `--ui-actions-padding` | `(ตามบริบท)` |
| `--ui-actions-stacked-direction` | `(ตามบริบท)` |
| `--ui-actions-stacked-width` | `(ตามบริบท)` |
| `--ui-actions-stacked-wrap` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-button-separator` | `(ตามบริบท)` |
| `--ui-button-set-separator` | `(ตามบริบท)` |
| `--ui-duration-moderate-02` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-compact-02` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-overlay` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-overlay-border` | `(ตามบริบท)` |
| `--ui-side-panel-radius` | `(ตามบริบท)` |
| `--ui-side-panel-top` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-skeleton>`

Loading placeholder in the shape of the content to come (Carbon skeleton states).

นำเข้า: `import '@purpurabog/ui/skeleton';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `shape` | `SkeletonShape` | `'text'` |  |
| `lines` | `number` | `3` | Number of lines for `shape="text"`. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `bone` | Each grey placeholder bar |
| `label` | The short label bar of `shape="field"` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-height` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-skeleton-width` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-skip-to-content>`

Carbon `SkipToContent`: a link that appears on first Tab and jumps to `href` (`#main-content`, the id `<ui-content>` sets). Put it first inside `<ui-header>`.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'#main-content'` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Link text (defaults to the translation) |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |

## `<ui-slider>`

Carbon `Slider` (single handle): a 2px track with a 14px round thumb (`role=slider`), min / max labels and a 64px number input that mirrors the value. Drag or click the track; Left / Down and Right / Up move by `step` (× `step-multiplier` with Shift), Home / End jump to the ends. Typing applies at once while the number is in range; on blur or Enter an out-of-range number is clamped (announced politely) and text that is not a number marks the field invalid. `hide-text-input` replaces the input with a value tooltip on the thumb.

นำเข้า: `import '@purpurabog/ui/slider';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `hide-label` | `boolean` | `false` |  |
| `value` | `number` | `0` |  |
| `value-upper` | `number \| null` | `null` | A second thumb: the slider picks the range `value`…`value-upper` (Carbon `unstable_valueUpper`). |
| `name-upper` | `string` | `''` | The name the upper value is submitted under (default: `name`, so the form gets both under one name). |
| `upper-input-label` | `string` | `''` | Accessible name of the upper number box (Carbon `unstable_ariaLabelInputUpper`; default "Upper bound"). |
| `min` | `number` | `0` |  |
| `max` | `number` | `100` |  |
| `step` | `number` | `1` |  |
| `step-multiplier` | `number` | `4` | Shift + arrow moves by `step × step-multiplier`. |
| `min-label` | `string` | `''` | Appended to the min / max numbers, e.g. "%" (Carbon `minLabel` / `maxLabel`). |
| `max-label` | `string` | `''` |  |
| `input-label` | `string` | `''` | Accessible name of the number input (Carbon `ariaLabelInput`). |
| `hide-text-input` | `boolean` | `false` |  |
| `name` | `string` | `''` |  |
| `disabled` | `boolean` | `false` |  |
| `readonly` | `boolean` | `false` |  |
| `required` | `boolean` | `false` |  |
| `invalid` | `boolean` | `false` |  |
| `invalid-text` | `string` | `''` |  |
| `warn` | `boolean` | `false` |  |
| `warn-text` | `string` | `''` |  |
| `corrected-text` | `string` | `''` | Announcement after an out-of-range number is clamped; `{value}` is the typed number (Carbon auto-correct message). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `formatLabel` | `SliderFormatLabel` | Formats min / max labels and the value tooltip (Carbon `formatLabel`). |
| `labels` |  | The `<label>`s that point at this field. |
| `isRange` |  | Two thumbs (`value-upper` set). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Rich label (overrides `label`) |
| `invalid-text` | Rich error text |
| `warn-text` | Rich warning text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label |
| `base` | Row with labels, track and input |
| `min-label` | Minimum label |
| `max-label` | Maximum label |
| `track` | The 2px track |
| `filled-track` | The filled part |
| `thumb` | The handle (`role=slider`) |
| `thumb-lower` | With `value-upper`: the lower handle (also `thumb`) |
| `thumb-upper` | With `value-upper`: the upper handle (also `thumb`) |
| `input` | The number input |
| `input-lower` | With `value-upper`: the lower bound's input (also `input`) |
| `input-upper` | With `value-upper`: the upper bound's input (also `input`) |
| `error-text` | Error text below |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |
| `warning-text` | Warning text below |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `input` |  |
| `change` |  |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-border-interactive` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-slider-fill` | `(ตามบริบท)` |
| `--ui-slider-handle-hover` | `(ตามบริบท)` |
| `--ui-slider-range-focus-ring` | `(ตามบริบท)` |
| `--ui-slider-range-gap` | `(ตามบริบท)` |
| `--ui-slider-range-handle-height` | `(ตามบริบท)` |
| `--ui-slider-range-handle-width` | `(ตามบริบท)` |
| `--ui-slider-range-icon-opacity` | `(ตามบริบท)` |
| `--ui-slider-range-lower-offset` | `(ตามบริบท)` |
| `--ui-slider-range-thumb` | `(ตามบริบท)` |
| `--ui-slider-range-thumb-hover` | `(ตามบริบท)` |
| `--ui-slider-range-thumb-inset` | `(ตามบริบท)` |
| `--ui-slider-range-thumb-radius` | `(ตามบริบท)` |
| `--ui-slider-range-upper-offset` | `(ตามบริบท)` |
| `--ui-slider-tick` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-slider-skeleton>`

Carbon `SliderSkeleton` (`cds-slider-skeleton`): a 75×14 label bar, 8px, then the slider's row — 20×12 min / max bars around the track with its centre tick, the filled track and a 14px thumb in the middle. `two-handles` (Carbon `twoHandles`): the track 4px in from each side, the lower handle just before its start and the upper one just after its end. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/slider';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `hide-label` | `boolean` | `false` |  |
| `two-handles` | `boolean` | `false` | The skeleton of a two-thumb slider (`<ui-slider value-upper>`). |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `range-label` | The min / max bars |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-slider-fill` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |

## `<ui-stack>`

Carbon `Stack`: lays its children out in one direction with one gap. `gap` is a Carbon spacing step (1–13, e.g. `gap="5"` = 16px) or any CSS length (`gap="1.5rem"`).

นำเข้า: `import '@purpurabog/ui/stack';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` |  |
| `gap` | `string` | `''` | Spacing step 1–13 or a CSS length. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The items |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-stack-gap` | `(ตามบริบท)` |

## `<ui-structured-list>`

Carbon `StructuredList`: a read-only table of rows and cells (`role=table`) with Carbon's row rules, header typography and cell paddings. `selection` turns the body rows into a single-select list (hidden radios with the radio icon in a leading cell): click, Space, or Up / Down / Left / Right arrows select; `value` holds the selected row's `value`. `condensed` halves the paddings; `flush` removes the leading padding (ignored with `selection`).

นำเข้า: `import '@purpurabog/ui/structured-list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `selection` | `boolean` | `false` |  |
| `condensed` | `boolean` | `false` |  |
| `flush` | `boolean` | `false` |  |
| `value` | `string` | `''` | Selected row's `value` (selection lists). |
| `label` | `string` | `''` |  |
| `selection-label` | `string` | `''` | Screen-reader name of the radio column (selection lists). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-structured-list-row>` elements (first one usually `head`) |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-change` | detail: { value } when the user selects another row |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-structured-list-selected` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-surface-2` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-structured-list-cell>`

One cell of a `<ui-structured-list-row>` (Carbon `StructuredListCell`): `role=cell`, or `columnheader` in a `head` row. `nowrap` keeps the content on one line.

นำเข้า: `import '@purpurabog/ui/structured-list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `head` | `boolean` | `false` | Set by the row: this cell is a column header. |
| `nowrap` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Cell content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-structured-list-row>`

A row of a `<ui-structured-list>` (Carbon `StructuredListRow`). `head` makes it the header row (its cells become column headers). In a `selection` list every body row carries a hidden radio in a leading cell with Carbon's radio icon; clicking the row or pressing Space / arrow keys selects it.

นำเข้า: `import '@purpurabog/ui/structured-list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `head` | `boolean` | `false` |  |
| `value` | `string` | `''` | Identifies the row in the list's `value` / `ui-change`. |
| `selected` | `boolean` | `false` | Set by the list. |
| `data-selection` | `boolean` | `false` | Set by the list: `selection` mode renders the radio cell. |
| `data-condensed` | `boolean` | `false` | Set by the list. |
| `data-flush` | `boolean` | `false` | Set by the list. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `focusable` | `boolean` | Set by the list: the hidden radio is the row's tab stop. |
| `selectionLabel` | `string` | Set by the list: screen-reader name of the radio column header. |
| `position` | `number` | Set by the list: position among the selectable rows and their count. Each radio sits in its own shadow root, so the browser would count "1 of 1". |
| `setSize` | `number` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-structured-list-cell>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `radio-cell` | The leading cell with the radio icon (selection lists) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-row-select` |  |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-structured-list-selected` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-surface-2` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-structured-list-skeleton>`

Carbon `StructuredListSkeleton`: a header row of three bars (16px, at 75% of their cells; columns 8 : 30 : 15) and `rows` empty rows between subtle lines. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/structured-list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `rows` | `number` | `5` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `header` | The header bars |
| `row` | Each empty row |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-switcher>`

Carbon `Switcher` + `SwitcherItem`: the app list inside a header panel. Put `<ui-switcher-item>`s (and `<hr>` dividers) in the default slot; `selected` marks the current app.

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-switcher-item>` and `<hr>` elements |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-subtle-1` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |

## `<ui-switcher-item>`

Carbon `SwitcherItem`: one link of a `<ui-switcher>`; `selected` marks the current app (`aria-current="page"`).

นำเข้า: `import '@purpurabog/ui/shell';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `'#'` |  |
| `selected` | `boolean` | `false` |  |
| `target` | `string` | `''` | Where the link opens (`_blank` for a new tab), as on `<a>`. |
| `rel` | `string` | `''` | The link's relation (`noopener`, `external` …), as on `<a>`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Link text |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-layer-active-1` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-layer-selected-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-tab>`

A tab in `<ui-tabs>`. `panel` must match the `name` of a `<ui-tab-panel>`. role / aria-selected / aria-controls are set on the host so the id references stay in the same (light) DOM tree as the panels.

นำเข้า: `import '@purpurabog/ui/tabs';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `hidden` |  |  |  |
| `panel` | `string` | `''` |  |
| `selected` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `secondary-label` | `string` | `''` | A second line under the label (Carbon `secondaryLabel`); contained tabs only. |
| `icon-only` | `boolean` | `false` | Only the `icon` slot shows (Carbon `IconTab`); `label` names the tab and is its tooltip. |
| `label` | `string` | `''` | Accessible name and tooltip of an `icon-only` tab — required with it. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Tab label |
| `icon` | A 16px icon (20px in icon-only tabs of `size="lg"`), coloured like the label |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `secondary-label` | The second line of a contained tab |
| `close-button` | The close button of a dismissable tab (no tab stop: Delete closes the focused tab) |
| `tooltip` | The `<ui-tooltip>` of an `icon-only` tab |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-request-close` | Dismissable tabs: its close button or Delete; cancelable; detail: { name } (its `panel`) |
| `ui-close` | Dismissable tabs: after it closed (now `hidden`); detail: { name } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-interactive` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-accent-active` | `(ตามบริบท)` |
| `--ui-layer-accent-hover` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tab-background` | `(ตามบริบท)` |
| `--ui-tab-contained-background` | `(ตามบริบท)` |
| `--ui-tab-contained-disabled` | `(ตามบริบท)` |
| `--ui-tab-contained-disabled-ink` | `(ตามบริบท)` |
| `--ui-tab-contained-divider` | `(ตามบริบท)` |
| `--ui-tab-contained-focus-offset` | `(ตามบริบท)` |
| `--ui-tab-contained-hover` | `(ตามบริบท)` |
| `--ui-tab-contained-radius` | `(ตามบริบท)` |
| `--ui-tab-contained-selected` | `(ตามบริบท)` |
| `--ui-tab-contained-selected-shadow` | `(ตามบริบท)` |
| `--ui-tab-disabled-line` | `(ตามบริบท)` |
| `--ui-tab-focus-offset` | `(ตามบริบท)` |
| `--ui-tab-focus-radius` | `(ตามบริบท)` |
| `--ui-tab-hover-line` | `(ตามบริบท)` |
| `--ui-tab-line` | `(ตามบริบท)` |
| `--ui-tab-selected-line` | `(ตามบริบท)` |
| `--ui-tab-vertical-background` | `(ตามบริบท)` |
| `--ui-tab-vertical-bar` | `(ตามบริบท)` |
| `--ui-tab-vertical-divider` | `(ตามบริบท)` |
| `--ui-tab-vertical-hover-bar` | `(ตามบริบท)` |
| `--ui-tab-vertical-inset` | `(ตามบริบท)` |
| `--ui-tab-vertical-mark` | `(ตามบริบท)` |
| `--ui-tab-vertical-radius` | `(ตามบริบท)` |
| `--ui-tab-vertical-selected` | `(ตามบริบท)` |
| `--ui-tabs-contained-flex` | `(ตามบริบท)` |
| `--ui-tabs-contained-gap` | `(ตามบริบท)` |
| `--ui-tabs-contained-height` | `(ตามบริบท)` |
| `--ui-tabs-contained-padding` | `(ตามบริบท)` |
| `--ui-tabs-contained-radius` | `(ตามบริบท)` |
| `--ui-tabs-contained-track` | `(ตามบริบท)` |
| `--ui-tabs-gap` | `(ตามบริบท)` |
| `--ui-tabs-track` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-tab-panel>`

Content for one tab. Hidden (and removed from the accessibility tree) unless active.

นำเข้า: `import '@purpurabog/ui/tabs';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | `''` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Panel content |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tab-focus-radius` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-table>`

Carbon `cds-table`: a table built from elements — `<ui-table-head>` with a `<ui-table-header-row>` of `<ui-table-header-cell>`s, and `<ui-table-body>` with `<ui-table-row>`s of `<ui-table-cell>`s. CSS table layout (the columns line up as in a `<table>`), `role=table` / `rowgroup` / `row` / `columnheader` / `cell`.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `TableSize` | `'lg'` |  |
| `is-sortable` | `boolean` | `false` | Every header sorts the rows (Carbon `is-sortable`). |
| `use-zebra-styles` | `boolean` | `false` | Stripe every second body row (Carbon `use-zebra-styles`). |
| `use-static-width` | `boolean` | `false` | As wide as its content instead of its container (Carbon `use-static-width`). |
| `locale` | `string` | `''` | The language text sorts in; empty: the page's `lang`. |
| `is-selectable` | `boolean` | `false` | A checkbox on every row and select-all in the header row (Carbon `is-selectable`). |
| `radio` | `boolean` | `false` | One row at a time, with radios (Carbon `radio`). |
| `expandable` | `boolean` | `false` | Rows followed by a `<ui-table-expanded-row>` open it with a chevron (Carbon `expandable`). |
| `batch-expansion` | `boolean` | `false` | An expand-all chevron in the header row (Carbon `batch-expansion`). |
| `with-header` | `boolean` | `false` | The title / description block shows (set from the `title` / `description` slots, as Carbon). |
| `resizable` | `boolean` | `false` | A resize handle on every header (or `resizable` on single headers). |
| `page-size` | `number` | `0` | Rows per page: above 0 a `<ui-pagination>` pages the rows the sort and search leave. |
| `page` | `number` | `1` | The page shown (from 1). |
| `page-sizes` | `string` | `'10,25,50'` | The page sizes the pagination offers (comma-separated). |
| `loading` | `boolean` | `false` | Skeleton rows instead of the body while the data loads (the table is `aria-busy`). |
| `loading-rows` | `number` | `0` | How many skeleton rows `loading` shows (default: the rows shown now, else the page size, else 5). |
| `sticky-header` | `boolean` | `false` | Keeps the header in view while the body scrolls inside a box (Carbon React `stickyHeader`; `--ui-table-max-height`, default 300px). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `filterRows` | `(rowText: string, searchString: string) => boolean` | Whether the search leaves a row out: true hides it (Carbon `filterRows`; default: its text doesn't contain the search). |
| `columns` | `UiTableHeaderCell[]` | The column headers, in order (the column settings list them). |
| `hiddenColumns` | `string[]` | The keys of the hidden columns. |
| `contentWidth` |  | Width of the horizontal scroll box (a resize stops a column there). |
| `selectedRows` | `UiTableRow[]` | The chosen rows. |
| `columnsChanged` |  | Columns were shown or hidden since the markup (Reset has something to do). |
| `columnWidths` | `Record<string, number>` | The widths given or resized, by column. |
| `csvFileName` |  | The file name a CSV download takes by default: the title's text. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-table-head>` and `<ui-table-body>` |
| `title` | A `<ui-table-header-title>` |
| `description` | A `<ui-table-header-description>` |
| `toolbar` | A `<ui-table-toolbar>` |
| `empty` | Shown when there are no rows (default: "No data") |
| `no-results` | Shown when the search leaves no rows (default: "No results found. Try a different search.") |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `header` | The title / description block |
| `content` | The horizontal scroll container |
| `table` | The box laid out as a table |
| `empty` | The message under the headers when there are no rows |
| `pagination` | The built-in `<ui-pagination>` (`page-size`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-columns-change` | detail: { hiddenColumns, column, hidden } after a column was shown or hidden (`column` is '' after Reset) |
| `ui-table-row-all-selected` | detail: { selectedRows } after select-all or Cancel |
| `ui-table-sorted` | detail: { sortedHeader } after the rows were sorted by a header click |
| `ui-table-row-selected` | detail: { selectedRow, selectedRows } after the user chose or released a row |
| `ui-table-filtered` | detail: { unfilteredRows } after the search changed which rows show |
| `ui-table-page-change` | detail: { page, pageSize } after the built-in pagination changed (`page-size`) |
| `ui-table-cell-edit` | from the cell, cancelable; detail: { row, cell, column, value, previous } before an edited value is written into the cell (`preventDefault()` to write it yourself) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-background-brand` | `(ตามบริบท)` |
| `--ui-batch-background` | `(ตามบริบท)` |
| `--ui-batch-button` | `(ตามบริบท)` |
| `--ui-batch-button-active` | `(ตามบริบท)` |
| `--ui-batch-button-hover` | `(ตามบริบท)` |
| `--ui-batch-button-ink` | `(ตามบริบท)` |
| `--ui-batch-divider` | `(ตามบริบท)` |
| `--ui-batch-focus` | `(ตามบริบท)` |
| `--ui-batch-ink` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-open-background` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-radius` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-pagination-background` | `(ตามบริบท)` |
| `--ui-pagination-border` | `(ตามบริบท)` |
| `--ui-pagination-button-radius` | `(ตามบริบท)` |
| `--ui-pagination-divider` | `(ตามบริบท)` |
| `--ui-pagination-gap` | `(ตามบริบท)` |
| `--ui-pagination-range-ink` | `(ตามบริบท)` |
| `--ui-pagination-select-border` | `(ตามบริบท)` |
| `--ui-pagination-select-radius` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-background` | `(ตามบริบท)` |
| `--ui-table-border` | `(ตามบริบท)` |
| `--ui-table-cell-ink` | `(ตามบริบท)` |
| `--ui-table-header-background` | `(ตามบริบท)` |
| `--ui-table-header-ink` | `(ตามบริบท)` |
| `--ui-table-header-rule` | `(ตามบริบท)` |
| `--ui-table-max-height` | `(ตามบริบท)` |
| `--ui-table-overflow` | `(ตามบริบท)` |
| `--ui-table-radius` | `(ตามบริบท)` |
| `--ui-table-row-height` | `(ตามบริบท)` |
| `--ui-table-row-selected` | `(ตามบริบท)` |
| `--ui-table-row-thread` | `(ตามบริบท)` |
| `--ui-table-sort-hover` | `(ตามบริบท)` |
| `--ui-table-sorted-background` | `(ตามบริบท)` |
| `--ui-table-sorted-icon` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-table-batch-actions>`

Carbon `cds-table-batch-actions`: the brand-coloured bar that slides over the toolbar while rows are chosen (`active`, the table sets it with `selected-rows-count`): "3 items selected", the `<ui-button>`s you put in it, and Cancel, which releases every row. With `total-rows-count` it offers "Select all (N)" for rows the table doesn't hold (server paging): it fires `ui-table-batch-actions-select-all-clicked`, choose them yourself.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `active` | `boolean` | `false` | Showing over the toolbar (rows are chosen). |
| `selected-rows-count` | `number` | `0` | How many rows are chosen (the table sets it; set it yourself for a selection kept across pages). |
| `total-rows-count` | `number` | `0` | Every row there is (server paging): above the count, "Select all (N)" shows. |
| `size` | `'xs' \| 'sm' \| 'lg'` | `'lg'` | The table's size, normalized to xs / sm / lg (the table sets it): sizes the action buttons. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `formatSelectedItemsCount` | `(options: { count: number }) => string \| undefined` | The count text (Carbon `formatSelectedItemsCount`); default: the translation. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The actions (`<ui-button>`s; the bar sizes them to the toolbar) |
| `cancel-button-content` | Cancel's text (default: the translation) |
| `select-all-button-content` | "Select all (N)"'s text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `batch-summary` | The selected-count text |
| `select-all-button` | "Select all (N)" |
| `cancel-button` | Cancel |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-batch-actions-cancel-clicked` | Cancel was clicked (the table releases every row) |
| `ui-table-batch-actions-select-all-clicked` | "Select all (N)" was clicked |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-background-brand` | `(ตามบริบท)` |
| `--ui-batch-background` | `(ตามบริบท)` |
| `--ui-batch-button` | `(ตามบริบท)` |
| `--ui-batch-button-active` | `(ตามบริบท)` |
| `--ui-batch-button-hover` | `(ตามบริบท)` |
| `--ui-batch-button-ink` | `(ตามบริบท)` |
| `--ui-batch-divider` | `(ตามบริบท)` |
| `--ui-batch-focus` | `(ตามบริบท)` |
| `--ui-batch-ink` | `(ตามบริบท)` |
| `--ui-blue-80` | `(ตามบริบท)` |
| `--ui-blue-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-focus-radius` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-body>`

Carbon `cds-table-body`: the body row group of a `<ui-table>` (`role=rowgroup`). With `use-zebra-styles` (the table sets it) it marks its rows `even` / `odd` whenever they change.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `use-zebra-styles` | `boolean` | `false` | Stripe every second row (the table passes its `use-zebra-styles`). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The `<ui-table-row>`s |

### CSS parts
_ไม่มี_

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-body-content-change` | its rows were added, removed or reordered (the table listens) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-background` | `(ตามบริบท)` |
| `--ui-table-row-selected` | `(ตามบริบท)` |
| `--ui-table-row-thread` | `(ตามบริบท)` |

## `<ui-table-cell>`

Carbon `cds-table-cell`: one cell of a `<ui-table-row>` (`role=cell`). Its padding follows the table's `size`; its rules and text colour follow the row (zebra stripe, hover).

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `column-hidden` | `boolean` | `false` | Its column is hidden (the table follows the header's `column-hidden`). |
| `pinned` | `'start' \| 'end' \| undefined` |  | Its column is pinned (the table follows the header's `pinned`). |
| `editable` | `TableCellEditor \| undefined` |  | Its column's editor (the table follows the header's `editable`). |
| `editing` | `boolean` | `false` | The editor is open (the table sets it). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `draft` | `string` | The editor's text while editing (the table sets where it starts). |
| `editorLabel` | `string` | The editor's name for screen readers: the column and the row (the table sets it). |
| `editorOptions` | `TableEditOption[]` | A select editor's choices (the header's `options`). |
| `editorError` | `string` | The header's `validate` message for the value in the editor. |
| `editorValue` |  | What the editor holds now. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The cell's content |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `content` | The box inside the cell that holds its padding |
| `edit-icon` | The pencil of an editable cell |
| `editor` | The input or select while editing |
| `error` | The `validate` message under the editor |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-cell-ink` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-table-column-settings>`

Column settings for a `<ui-table>` (no Carbon counterpart; Carbon keeps the toolbar for "table display settings"): a Column-icon toolbar action in `<ui-table-toolbar-content>` that opens a "Columns" checkbox list — unticking hides a column at once; the last column shown and a header with `hideable="false"` can't be hidden. Reset goes back to the columns hidden in the markup. The table fires `ui-table-columns-change`.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `button` | The toolbar action |
| `panel` | The "Columns" list |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-layer-2` | `(ตามบริบท)` |
| `--ui-menu-shadow` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-csv-export>`

An "Export CSV" toolbar action for a `<ui-table>` (no Carbon counterpart), in `<ui-table-toolbar-content>`: a Download-icon button that downloads the rows the search shows (every page) and the columns shown, for Excel (UTF-8 with a byte order mark, every cell quoted, formulas defused). A cell writes its `csv-value`, else its text. It fires a cancelable `ui-table-csv-export` first (`preventDefault()` to export another way). `file-name` names the file (default: the table's title, else "table"). The table's `toCsv()` / `downloadCsv()` export any rows.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `file-name` | `string` | `''` | The downloaded file's name (`.csv` is added); default: the table's title, else "table". |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `button` | The toolbar action |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-csv-export` | cancelable; detail: { csv, rows, fileName } before the download |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-expanded-row>`

Carbon `cds-table-expanded-row`: the full-width content under the `<ui-table-row>` right before it, shown while that row is `expanded`. The table sets `colspan` to the number of columns; hovering either row tints both.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `colspan` | `number` | `1` | How many columns it spans (the table sets it). |
| `expanded` | `boolean` | `false` | Shown (follows the row before it). |
| `filtered` | `boolean` | `false` | Left out by the table's search, with its row. |
| `paged-out` | `boolean` | `false` | On another page, with its row. |
| `highlighted` | `boolean` | `false` | Hovered with its row. |
| `selected` | `boolean` | `false` | Its row is chosen. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `grid` | `boolean` | The table is a grid (an editable column): a grid cell (the table sets it). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The content |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `cell` | The full-width cell |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-head>`

Carbon `cds-table-head`: the header row group of a `<ui-table>` (`role=rowgroup`).

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | A `<ui-table-header-row>` |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-table-header-background` | `(ตามบริบท)` |

## `<ui-table-header-cell>`

Carbon `cds-table-header-cell`: a column header (`role=columnheader`). Sortable (`is-sortable`, or the table's `is-sortable`), it is a button that steps through `sort-cycle` (default none → ascending → descending → none) and fires a cancelable `ui-table-header-cell-sort`; the table then sorts its rows. `aria-sort` follows `sort-direction` (Carbon React; Carbon web components set none).

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `is-sortable` | `boolean` | `false` | Sortable on its own (the table's `is-sortable` sets every header). |
| `sort-active` | `boolean` | `false` | The column the rows are sorted by (set with the direction). |
| `sort-cycle` | `TableSortCycle \| undefined` |  | The states each click steps through. |
| `sort-direction` | `TableSortDirection \| undefined` |  | Sorted ascending, descending or not; a sortable header without one starts at none. |
| `column` | `string` | `''` | The column's name in events and the column settings (default: its place, "0", "1" …). |
| `column-hidden` | `boolean` | `false` | Hidden with its cells (the column settings set it; set it in the markup to start hidden). |
| `hideable` | `boolean` | `true` | Can be hidden from the column settings (`hideable="false"` keeps it shown). |
| `pinned` | `'start' \| 'end' \| undefined` |  | Stays in view while the table scrolls sideways: `start` on the first header, `end` on the last. |
| `resizable` | `boolean` | `false` | A resize handle on its end edge (the table's `resizable` sets every header). |
| `width` | `number \| undefined` |  | The column's width in px (a resize sets it). |
| `min-width` | `number \| undefined` |  | The narrowest a resize makes it (default 50). |
| `max-width` | `number \| undefined` |  | The widest a resize makes it (default: the table's width). |
| `editable` | `TableCellEditor \| undefined` |  | Its cells can be edited in place, with this editor (no Carbon counterpart; the table becomes a grid). |
| `options` | `TableEditOption[]` | `[]` | A `select` column's choices: the value saved and the label shown (JSON in the attribute). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `validate` | `(value: string \| number, cell: HTMLElement) => string \| undefined` | Checks an edited value before it's saved: a message keeps the editor open and shows it. |
| `labelText` |  | The label as text (the button's title, the screen reader hint, the column settings). |
| `columnKey` |  | The column's key: `column`, else its place among the headers. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The header's label |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `content` | The box inside the header that holds its padding |
| `sort-button` | The button of a sortable header |
| `label-text` | The label |
| `sort-icon` | The sort arrow |
| `resizer` | The resize handle (an invisible range input over the end edge) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-header-cell-sort` | cancelable; detail: { oldSortDirection, sortDirection } before the column sorts (`preventDefault()` keeps the rows and this header as they are: sort the data yourself and set `sort-direction`) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-selected-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-secondary-hover` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-header-background` | `(ตามบริบท)` |
| `--ui-table-header-ink` | `(ตามบริบท)` |
| `--ui-table-sort-hover` | `(ตามบริบท)` |
| `--ui-table-sorted-background` | `(ตามบริบท)` |
| `--ui-table-sorted-icon` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-table-header-description>`

Carbon `cds-table-header-description`: a line under the title, in the table's `description` slot (body-compact-01).

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The description |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-header-row>`

Carbon `cds-table-header-row`: the row of `<ui-table-header-cell>`s inside `<ui-table-head>`. With selection its first cell is the select-all checkbox (checked while rows are chosen, partly while only some are); with `batch-expansion` its chevron opens and closes every row.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `selected` | `boolean` | `false` | Chosen (Carbon `selected`); the table keeps the header's select-all and the batch actions in step. |
| `disabled` | `boolean` | `false` | Can't be chosen. |
| `radio` | `boolean` | `false` | A single-choice radio instead of a checkbox (the table's `radio` sets it). |
| `hide-checkbox` | `boolean` | `false` | No checkbox in the selection cell (the header row of a radio table). |
| `selection-name` | `string` | `''` | Shows the selection cell: the checkbox's name (the table's `is-selectable` sets one). |
| `selection-value` | `string` | `''` | The checkbox's value. |
| `selection-label` | `string` | `''` | The checkbox's accessible name; default "Select row" with the row's first cell. |
| `expandable` | `boolean` | `false` | Has a `<ui-table-expanded-row>` after it (the table's `expandable` sets it). |
| `expanded` | `boolean` | `false` | Its expanded row is open. |
| `batch-expansion` | `boolean` | `false` | The header row's chevron opens and closes every row (the table's `batch-expansion` sets it). |
| `filtered` | `boolean` | `false` | Left out by the table's search. |
| `highlighted` | `boolean` | `false` | Hovered with its expanded row (the two tint together). |
| `paged-out` | `boolean` | `false` | On another page of the table's pagination (the table sets it). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `expandColumn` | `boolean` | The table has an expand column: every row gets the cell, expandable ones the chevron. |
| `indeterminate` | `boolean` | The header's select-all is partly checked (some rows chosen); the table sets it. |
| `tabStop` | `boolean` | The radio of a radio table that takes Tab (the chosen row, else the first); the table sets it. |
| `pinStart` | `boolean` | The first column is pinned: the chevron and checkbox cells stick too (the table sets it). |
| `filler` | `boolean` | A filler cell after the cells takes the rest of the row once the columns are resized (the table sets it). |
| `grid` | `boolean` | The table is a grid (an editable column): grid cells, the body's cells and controls out of the Tab order (the table sets it). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The `<ui-table-header-cell>`s |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `expand-cell` | The cell of the expand chevron |
| `expand-button` | The chevron button |
| `selection-cell` | The cell of the checkbox or radio |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-change-selection-all` | cancelable; detail: { selected } before every row is chosen or released |
| `ui-table-row-expando-beingtoggled` |  |
| `ui-table-row-expando-toggled` |  |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-background` | `(ตามบริบท)` |
| `--ui-table-header-background` | `(ตามบริบท)` |
| `--ui-table-row-selected` | `(ตามบริบท)` |
| `--ui-table-row-thread` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-header-title>`

Carbon `cds-table-header-title`: the table's title, in its `title` slot (heading-03). Give it a heading level with `role="heading" aria-level="2"` where the page needs one.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The title |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-subhead` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |

## `<ui-table-row>`

Carbon `cds-table-row`: a body row of `<ui-table-cell>`s. Hovering it tints the row and its rules. With `use-zebra-styles` on the table, its body marks every second row `even` (striped) and the others `odd`.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `even` | `boolean` | `false` | A striped row (set by the body with `use-zebra-styles`). |
| `odd` | `boolean` | `false` | An unstriped row of a zebra table (set by the body). |
| `selected` | `boolean` | `false` | Chosen (Carbon `selected`); the table keeps the header's select-all and the batch actions in step. |
| `disabled` | `boolean` | `false` | Can't be chosen. |
| `radio` | `boolean` | `false` | A single-choice radio instead of a checkbox (the table's `radio` sets it). |
| `hide-checkbox` | `boolean` | `false` | No checkbox in the selection cell (the header row of a radio table). |
| `selection-name` | `string` | `''` | Shows the selection cell: the checkbox's name (the table's `is-selectable` sets one). |
| `selection-value` | `string` | `''` | The checkbox's value. |
| `selection-label` | `string` | `''` | The checkbox's accessible name; default "Select row" with the row's first cell. |
| `expandable` | `boolean` | `false` | Has a `<ui-table-expanded-row>` after it (the table's `expandable` sets it). |
| `expanded` | `boolean` | `false` | Its expanded row is open. |
| `batch-expansion` | `boolean` | `false` | The header row's chevron opens and closes every row (the table's `batch-expansion` sets it). |
| `filtered` | `boolean` | `false` | Left out by the table's search. |
| `highlighted` | `boolean` | `false` | Hovered with its expanded row (the two tint together). |
| `paged-out` | `boolean` | `false` | On another page of the table's pagination (the table sets it). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `expandColumn` | `boolean` | The table has an expand column: every row gets the cell, expandable ones the chevron. |
| `indeterminate` | `boolean` | The header's select-all is partly checked (some rows chosen); the table sets it. |
| `tabStop` | `boolean` | The radio of a radio table that takes Tab (the chosen row, else the first); the table sets it. |
| `pinStart` | `boolean` | The first column is pinned: the chevron and checkbox cells stick too (the table sets it). |
| `filler` | `boolean` | A filler cell after the cells takes the rest of the row once the columns are resized (the table sets it). |
| `grid` | `boolean` | The table is a grid (an editable column): grid cells, the body's cells and controls out of the Tab order (the table sets it). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The row's `<ui-table-cell>`s |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `expand-cell` | The cell of the expand chevron |
| `expand-button` | The chevron button |
| `selection-cell` | The cell of the checkbox or radio |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-table-row-change-selection` | cancelable; detail: { selected } before the row is chosen or released |
| `ui-table-row-expando-beingtoggled` | cancelable; detail: { expanded } before the row opens or closes |
| `ui-table-row-expando-toggled` | detail: { expanded } after the row opened or closed |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-checkbox-border` | `(ตามบริบท)` |
| `--ui-checkbox-checked` | `(ตามบริบท)` |
| `--ui-checkbox-mark` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-layer-selected-hover` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-background` | `(ตามบริบท)` |
| `--ui-table-row-selected` | `(ตามบริบท)` |
| `--ui-table-row-thread` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-table-skeleton>`

Carbon `cds-table-skeleton`: a table-shaped placeholder while the data loads — a title and description bar (`show-header`), a toolbar (`show-toolbar`), header bars (or `headers` texts) and `row-count` × `column-count` cell bars (default 5 × 5), striped with `zebra`. Hidden from screen readers; say "Loading" elsewhere.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `column-count` | `number` | `5` |  |
| `row-count` | `number` | `5` |  |
| `show-header` | `boolean` | `true` | The title / description bars (Carbon `show-header`; `show-header="false"` hides them). |
| `show-toolbar` | `boolean` | `true` | The toolbar bar (Carbon `show-toolbar`; `show-toolbar="false"` hides it). |
| `zebra` | `boolean` | `false` | Stripe every second row. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `headers` | `string[]` | Header texts to show instead of bars (Carbon `headers`); their number sets the columns. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `table` | The `<table>` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-header-background` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-table-toolbar>`

Carbon `cds-table-toolbar`: the bar above the table, in its `toolbar` slot (`role=toolbar`): a `<ui-table-batch-actions>` and a `<ui-table-toolbar-content>`. As tall as the table's size (24px xs, 32px sm, 48px otherwise).

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
_ไม่มี_

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-table-batch-actions>` and `<ui-table-toolbar-content>` |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-table-background` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-table-toolbar-content>`

Carbon `cds-table-toolbar-content`: the toolbar's controls, at its end — a `<ui-table-toolbar-search>`, toolbar actions, a primary `<ui-button>`. While rows are chosen (`has-batch-actions`, the table sets it) it slides away under the batch actions and leaves the Tab order.

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `has-batch-actions` | `boolean` | `false` | The batch actions are showing (rows are chosen). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The controls |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |

## `<ui-table-toolbar-search>`

Carbon `cds-table-toolbar-search`: a `<ui-search>` for `<ui-table-toolbar-content>` that filters the table as you type (the table hides the rows whose text doesn't contain it). Collapsed to its magnifier (a square of the toolbar's height) until focused, then as wide as the toolbar; it collapses again when it loses focus empty. `persistent` keeps it open. Its name and placeholder default to "Filter table".

นำเข้า: `import '@purpurabog/ui/table';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `persistent` | `boolean` | `false` | Always open (Carbon `persistent`). |
| `label` | `string` | `''` | Accessible name of the field (visually hidden, as in Carbon). |
| `placeholder` | `string` | `''` |  |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `SearchSize` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `autocomplete` | `string` | `'off'` |  |
| `inputmode` | `string` | `''` | Passed to the text box: the virtual keyboard to show (`numeric`, `decimal`, `email`, `tel`, `url`, `search`…). |
| `enterkeyhint` | `string` | `''` | Passed to the text box: the label of the virtual keyboard's Enter key (`search`, `send`, `next`, `done`…). |
| `clear-label` | `string` | `''` | Accessible name of the clear button. |
| `required` | `boolean` | `false` | Constraint validation like `<input type="search">`: blocks submit and reports in the browser's bubble (Carbon Search has no error line). |
| `pattern` | `string` | `''` |  |
| `minlength` | `number \| undefined` |  |  |
| `maxlength` | `number \| undefined` |  |  |
| `readonly` | `boolean` | `false` | Value can be selected and submitted but not changed; no clear button. |
| `fluid` | `boolean` | `false` | Carbon `FluidSearch`: the label inside a 64px box. `<ui-fluid-form>` sets it for every field inside. |
| `expandable` | `boolean` | `false` | Carbon `ExpandableSearch`: collapsed to its magnifier until opened. |
| `expanded` | `boolean` | `false` | Whether an expandable search is open. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The role=search wrapper |
| `input` | The native search input |
| `label` | The label (visually hidden, as in Carbon; shown inside the box when `fluid`) |
| `magnifier` | The search icon |
| `clear-button` | The clear button |
| `magnifier-button` | The magnifier of an expandable search |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(has-value)` | While it holds a value (also `[data-has-value]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When the value is committed (blur / Enter) or cleared |
| `ui-toggle` | detail: { expanded } when an expandable search opens or collapses |
| `input` | On every keystroke |
| `ui-clear` | After the clear button or Esc emptied the field |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-open-background` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-active` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-tabs>`

Carbon tabs: `line` (default; Carbon's product tabs) or `type="contained"` — 48px tabs on layer-accent with dividers, the selected one on the layer with a blue top edge, and panels on the layer padded 16px; `full-width` splits the strip into equal columns.

นำเข้า: `import '@purpurabog/ui/tabs';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `string` | `''` | Name of the active panel. Defaults to the first enabled tab. |
| `label` | `string` | `''` | Accessible name for the tab strip, e.g. "Product details". |
| `activation` | `TabsActivation` | `'automatic'` | `automatic` (Carbon's name; `auto` is still accepted) or `manual`. |
| `type` | `TabsType` | `'line'` | `line` (default) or `contained` (Carbon cds-tabs `type="contained"`). |
| `size` | `TabsSize \| undefined` |  | Tab height (Carbon `size`): sm 32px, md 40px, lg 48px, xl 64px (contained only); unset = md for line, lg for contained. |
| `full-width` | `boolean` | `false` | With `type="contained"`: the tabs share the full width in equal columns (Carbon `full-width` / `fullWidth`). |
| `vertical` | `boolean` | `false` | Carbon `TabsVertical`: the tabs in a column beside the panels from md up (contained tabs in a row below). |
| `height` | `string` | `''` | A fixed height for vertical tabs (Carbon `height`), e.g. `"400px"`: the tab list and the panels then scroll. |
| `dismissable` | `boolean` | `false` | A close button on every tab, and Delete closes the focused tab (Carbon `dismissable`); not with `vertical`. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `nav` | `<ui-tab>` elements (assigned automatically) |
| `(default)` | `<ui-tab-panel>` elements |
| `end` | Content at the end of the strip, e.g. an action button |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The strip holding the tab list and scroll buttons |
| `tablist` | The role=tablist container (tabs themselves are light-DOM `<ui-tab>`s: style the element) |
| `scroll-button` | The overflow scroll buttons |
| `end` | Wrapper of the `end` slot |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-tab-change` | detail: { name } after the user selects a tab |
| `ui-tab-before-change` | Cancelable; detail: { name, previous }. preventDefault() keeps the current tab (e.g. unsaved changes). |
| `ui-request-close` | From a `<ui-tab>` of dismissable tabs (close button or Delete); cancelable; detail: { name }. preventDefault() keeps the tab. |
| `ui-close` | From a `<ui-tab>` after it closed (hidden); detail: { name } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-interactive` | `(ตามบริบท)` |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-canvas-active` | `(ตามบริบท)` |
| `--ui-canvas-hover` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-accent` | `(ตามบริบท)` |
| `--ui-layer-accent-active` | `(ตามบริบท)` |
| `--ui-layer-accent-hover` | `(ตามบริบท)` |
| `--ui-layer-background` | `(ตามบริบท)` |
| `--ui-layer-border` | `(ตามบริบท)` |
| `--ui-layer-radius` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tab-background` | `(ตามบริบท)` |
| `--ui-tab-contained-background` | `(ตามบริบท)` |
| `--ui-tab-contained-disabled` | `(ตามบริบท)` |
| `--ui-tab-contained-disabled-ink` | `(ตามบริบท)` |
| `--ui-tab-contained-divider` | `(ตามบริบท)` |
| `--ui-tab-contained-focus-offset` | `(ตามบริบท)` |
| `--ui-tab-contained-hover` | `(ตามบริบท)` |
| `--ui-tab-contained-radius` | `(ตามบริบท)` |
| `--ui-tab-contained-selected` | `(ตามบริบท)` |
| `--ui-tab-contained-selected-shadow` | `(ตามบริบท)` |
| `--ui-tab-disabled-line` | `(ตามบริบท)` |
| `--ui-tab-focus-offset` | `(ตามบริบท)` |
| `--ui-tab-focus-radius` | `(ตามบริบท)` |
| `--ui-tab-hover-line` | `(ตามบริบท)` |
| `--ui-tab-line` | `(ตามบริบท)` |
| `--ui-tab-selected-line` | `(ตามบริบท)` |
| `--ui-tab-vertical-background` | `(ตามบริบท)` |
| `--ui-tab-vertical-bar` | `(ตามบริบท)` |
| `--ui-tab-vertical-divider` | `(ตามบริบท)` |
| `--ui-tab-vertical-hover-bar` | `(ตามบริบท)` |
| `--ui-tab-vertical-inset` | `(ตามบริบท)` |
| `--ui-tab-vertical-mark` | `(ตามบริบท)` |
| `--ui-tab-vertical-radius` | `(ตามบริบท)` |
| `--ui-tab-vertical-selected` | `(ตามบริบท)` |
| `--ui-tabs-contained-flex` | `(ตามบริบท)` |
| `--ui-tabs-contained-gap` | `(ตามบริบท)` |
| `--ui-tabs-contained-height` | `(ตามบริบท)` |
| `--ui-tabs-contained-padding` | `(ตามบริบท)` |
| `--ui-tabs-contained-radius` | `(ตามบริบท)` |
| `--ui-tabs-contained-track` | `(ตามบริบท)` |
| `--ui-tabs-gap` | `(ตามบริบท)` |
| `--ui-tabs-track` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-tabs-skeleton>`

Carbon `TabsSkeleton`: `tabs` tabs of 160×40, 1px apart, each a 2px skeleton-coloured underline and a 14px bar. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/tabs';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `tabs` | `number` | `5` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `tab` | Each tab |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-tag>`

Carbon tag in its four forms: read-only `Tag` (default), `DismissibleTag` (`dismissible`), `SelectableTag` (`selectable`, a toggle with `aria-pressed`) and `OperationalTag` (`operational`, a bordered button that opens something). Twelve colour `type`s, sizes sm 18 / md 24 / lg 32.

นำเข้า: `import '@purpurabog/ui/tag';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `type` | `TagType` | `'gray'` | Colour (Carbon `type`). |
| `size` | `TagSize` | `'md'` | sm 18px · md 24px (default) · lg 32px |
| `dismissible` | `boolean` | `false` | Shows a close button that fires `ui-dismiss`. |
| `selectable` | `boolean` | `false` | A toggle button (`aria-pressed`); use `selected` for its state. |
| `selected` | `boolean` | `false` |  |
| `operational` | `boolean` | `false` | A bordered button for tags that open or trigger something. |
| `disabled` | `boolean` | `false` |  |
| `tag-title` | `string` | `''` | A dismissible tag's full text for the browser tooltip (defaults to the text); other tags have none (Carbon WC). |
| `dismiss-label` | `string` | `''` | Accessible name of the close button; `{text}` is replaced with the tag text. |
| `label` | `string` | `''` | An operational tag's accessible name, when its text alone doesn't say it (e.g. "+3": "3 more tags"). |
| `expanded` | `boolean \| undefined` |  | An operational tag that opens a popup: whether it is open (`aria-expanded`, with `aria-haspopup`). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The tag text |
| `icon` | A 16px icon before the text (Carbon `renderIcon`) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The tag box |
| `label` | The text |
| `dismiss-button` | The close button of a dismissible tag |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-dismiss` | The dismiss button was pressed (the tag stays until you remove it) |
| `change` | A selectable tag was toggled (`selected` already updated) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-inverse` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-inverse` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-inverse-canvas` | `(ตามบริบท)` |
| `--ui-inverse-hover` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-layer-selected-inverse` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tag-background-blue` | `(ตามบริบท)` |
| `--ui-tag-background-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-background-cyan` | `(ตามบริบท)` |
| `--ui-tag-background-gray` | `(ตามบริบท)` |
| `--ui-tag-background-green` | `(ตามบริบท)` |
| `--ui-tag-background-magenta` | `(ตามบริบท)` |
| `--ui-tag-background-purple` | `(ตามบริบท)` |
| `--ui-tag-background-red` | `(ตามบริบท)` |
| `--ui-tag-background-teal` | `(ตามบริบท)` |
| `--ui-tag-background-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-border-blue` | `(ตามบริบท)` |
| `--ui-tag-border-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-border-cyan` | `(ตามบริบท)` |
| `--ui-tag-border-gray` | `(ตามบริบท)` |
| `--ui-tag-border-green` | `(ตามบริบท)` |
| `--ui-tag-border-magenta` | `(ตามบริบท)` |
| `--ui-tag-border-purple` | `(ตามบริบท)` |
| `--ui-tag-border-red` | `(ตามบริบท)` |
| `--ui-tag-border-teal` | `(ตามบริบท)` |
| `--ui-tag-border-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-color-blue` | `(ตามบริบท)` |
| `--ui-tag-color-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-color-cyan` | `(ตามบริบท)` |
| `--ui-tag-color-gray` | `(ตามบริบท)` |
| `--ui-tag-color-green` | `(ตามบริบท)` |
| `--ui-tag-color-magenta` | `(ตามบริบท)` |
| `--ui-tag-color-purple` | `(ตามบริบท)` |
| `--ui-tag-color-red` | `(ตามบริบท)` |
| `--ui-tag-color-teal` | `(ตามบริบท)` |
| `--ui-tag-color-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-font` | `(ตามบริบท)` |
| `--ui-tag-high-contrast` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-border` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-edge` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-focus` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-hover` | `(ตามบริบท)` |
| `--ui-tag-high-contrast-ink` | `(ตามบริบท)` |
| `--ui-tag-hover-blue` | `(ตามบริบท)` |
| `--ui-tag-hover-cool-gray` | `(ตามบริบท)` |
| `--ui-tag-hover-cyan` | `(ตามบริบท)` |
| `--ui-tag-hover-gray` | `(ตามบริบท)` |
| `--ui-tag-hover-green` | `(ตามบริบท)` |
| `--ui-tag-hover-magenta` | `(ตามบริบท)` |
| `--ui-tag-hover-purple` | `(ตามบริบท)` |
| `--ui-tag-hover-red` | `(ตามบริบท)` |
| `--ui-tag-hover-teal` | `(ตามบริบท)` |
| `--ui-tag-hover-warm-gray` | `(ตามบริบท)` |
| `--ui-tag-radius` | `(ตามบริบท)` |
| `--ui-tag-selectable-border` | `(ตามบริบท)` |
| `--ui-tag-selected` | `(ตามบริบท)` |
| `--ui-tag-selected-ink` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-tag-skeleton>`

Carbon `TagSkeleton` (`cds-tag-skeleton`): a 60px pill at the tag's height (sm 18 / md 24 / lg 32px). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/tag';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |  |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `bone` | The pill |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-tag-radius` | `(ตามบริบท)` |

## `<ui-tearsheet>`

Carbon for IBM Products `Tearsheet` (`c4p-tearsheet`): a large modal that rises from the bottom of the screen (240ms) over the dimmed page — `width="narrow"` (Carbon's small modal: 60% / 42% / 36% of the screen from md / lg / xlg, 130px from the top) or `wide` (all but 64px each side, 90px from the top). Header: `label`, `heading` (heading-04 wide, heading-03 narrow), `description` (or `slot="description"`), and in a wide one `slot="header-actions"` and `slot="header-navigation"` (tabs); a wide one may have an `slot="influencer"` pane (`influencer-placement` left / right, `influencer-width` narrow 256px / wide 320px). Content on the background (wide, layer 0) or the layer (narrow, layer 1). `slot="actions"`: up to four `<ui-button>`s laid out as Carbon's ActionSet (64px; 80px wide). The × shows with `has-close-icon` or when there are no actions. Esc, × and a click outside (unless `prevent-close-on-click-outside`) ask to close; Tab stays inside. Opening another tearsheet over it scales this one back (95%, then 90%) and dims the page less, up to three deep.

นำเข้า: `import '@purpurabog/ui/tearsheet';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `open` | `boolean` | `false` |  |
| `width` | `'narrow' \| 'wide'` | `'narrow'` | narrow: Carbon's small modal; wide: the whole screen but 64px each side. |
| `vertical-position` | `'normal' \| 'lower' \| undefined` |  | How far from the top the sheet starts: normal 90px, lower 130px (default lower for a narrow one). |
| `heading` | `string` | `''` |  |
| `label` | `string` | `''` | A small label above the heading. |
| `description` | `string` | `''` |  |
| `influencer-placement` | `'left' \| 'right'` | `'right'` |  |
| `influencer-width` | `'narrow' \| 'wide'` | `'narrow'` |  |
| `has-close-icon` | `boolean` | `false` | Show the × even with actions (it always shows without them). |
| `close-icon-description` | `string` | `''` | The ×'s name (default "Close", translated). |
| `prevent-close-on-click-outside` | `boolean` | `false` |  |
| `selector-initial-focus` | `string` | `''` | What takes focus on open (a selector in the content), else × or the first control. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The content |
| `label` | Rich label (instead of `label`) |
| `description` | Rich description (instead of `description`), e.g. a `<ui-truncated-text>` |
| `header-actions` | Small buttons in the header (wide) |
| `header-navigation` | Tabs under the header text (wide) |
| `influencer` | A side pane beside the content (wide) |
| `actions` | Up to four action buttons |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `dialog` | The full-screen dialog |
| `container` | The sheet |
| `header` | The header |
| `heading` | The heading |
| `close-button` | The × |
| `influencer` | The side pane |
| `content` | The content's box |
| `actions` | The row of action buttons |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-close` | After it closed |
| `ui-request-close` | Cancelable; detail: { reason: 'escape' \| 'close-button' \| 'outside' } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-actions-button-align` | `(ตามบริบท)` |
| `--ui-actions-button-flex` | `(ตามบริบท)` |
| `--ui-actions-button-padding-top` | `(ตามบริบท)` |
| `--ui-actions-gap` | `(ตามบริบท)` |
| `--ui-actions-padding` | `(ตามบริบท)` |
| `--ui-actions-stacked-direction` | `(ตามบริบท)` |
| `--ui-actions-stacked-width` | `(ตามบริบท)` |
| `--ui-actions-stacked-wrap` | `(ตามบริบท)` |
| `--ui-border-subtle-2` | `(ตามบริบท)` |
| `--ui-button-separator` | `(ตามบริบท)` |
| `--ui-button-set-separator` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-close-inset` | `(ตามบริบท)` |
| `--ui-close-size` | `(ตามบริบท)` |
| `--ui-duration-moderate-02` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-04` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-overlay` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-overlay-border` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-lg` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tearsheet-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |

## `<ui-text-area>`

Carbon-style text area (`TextArea`): a multi-line field with the same label / helper / warning / error wiring as ui-text-input, an optional character counter (`max-count`) and vertical resize.

นำเข้า: `import '@purpurabog/ui/text-area';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Error text shown while `invalid` or while the field fails validation. |
| `invalid` | `boolean` | `false` | Forces the error state, e.g. after server-side validation. |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `placeholder` | `string` | `''` |  |
| `rows` | `number` | `4` | Initial number of text rows (Carbon default 4); the user can still resize. |
| `minlength` | `number \| undefined` |  |  |
| `maxlength` | `number \| undefined` |  |  |
| `autocomplete` | `string` | `''` | Passed to the textarea (`off`, or an autofill token). |
| `inputmode` | `string` | `''` | Passed to the text box: the virtual keyboard to show (`numeric`, `decimal`, `email`, `tel`, `url`, `search`…). |
| `enterkeyhint` | `string` | `''` | Passed to the text box: the label of the virtual keyboard's Enter key (`search`, `send`, `next`, `done`…). |
| `max-count` | `number \| undefined` |  | Soft limit with a visible counter (unlike maxlength, extra text isn't blocked). |
| `counter-mode` | `CounterMode` | `'character'` | What `max-count` counts: `character` (default) or `word` (Carbon `counterMode`). |
| `auto-grow` | `boolean` | `false` | Grows with the text from `rows` (no Carbon counterpart); `max-rows` caps it, then it scrolls. |
| `max-rows` | `number \| undefined` |  | The most lines `auto-grow` shows before scrolling (default: no cap). |
| `too-long-text` | `string` | `''` | Error when over `max-count`; `{max}` is replaced with the limit (default: the translation's, for characters or words). |
| `near-limit-text` | `string` | `''` | Announced once when what is left of the limit drops to 10% or less. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidTextArea`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box around the textarea |
| `label` | The label |
| `input` | The native textarea |
| `counter` | The character (or word) counter |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | Re-dispatched from the native textarea (native change is not composed) |
| `input` | Native input event (already composed, so it reaches the host) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-text-area-skeleton>`

Carbon `TextAreaSkeleton` (`cds-textarea-skeleton`): the shape of a `<ui-text-area>` while its data loads — a 75×14 label bar, 8px, then a 100px field bar. `fluid` (Carbon `FluidTextAreaSkeleton`): a box padded 16px in skeleton-background with a 1px line below — a 75×8 label bar, 12px, then an 80% × 64px bar. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/text-area';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The field's height: sm 32px, md 40px, lg 48px. |
| `hide-label` | `boolean` | `false` | No label bar (the field had `hide-label`). |
| `fluid` | `boolean` | `false` | The fluid field's skeleton (Carbon `Fluid*Skeleton`): a 64px box with two bars; `<ui-fluid-form>` sets it. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `field` | The field bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-text-input>`

Carbon-style text input (Carbon `TextInput`).

นำเข้า: `import '@purpurabog/ui/text-input';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Visible label text; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Keep the label for screen readers but don't show it. |
| `helper-text` | `string` | `''` | Helper text under the field, shown while there is no error or warning. |
| `invalid-text` | `string` | `''` | Message shown when invalid. Falls back to the browser's validation message. |
| `invalid` | `boolean` | `false` | Force the error state (e.g. a server-side error). |
| `warn` | `boolean` | `false` | Non-blocking warning; shown when there is no error. |
| `warn-text` | `string` | `''` | Text of the warning shown while `warn`. |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `type` | `TextInputType` | `'text'` |  |
| `size` | `TextInputSize` | `'md'` | Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). |
| `placeholder` | `string` | `''` |  |
| `autocomplete` | `string` | `''` |  |
| `inputmode` | `string` | `''` | Passed to the text box: the virtual keyboard to show (`numeric`, `decimal`, `email`, `tel`, `url`, `search`…). |
| `enterkeyhint` | `string` | `''` | Passed to the text box: the label of the virtual keyboard's Enter key (`search`, `send`, `next`, `done`…). |
| `pattern` | `string` | `''` |  |
| `prefix-text` | `string` | `''` | Text inside the field before the value, e.g. a currency (`฿`). Part of the field's description for screen readers. |
| `suffix-text` | `string` | `''` | Text inside the field after the value, e.g. a unit (`kg`). Part of the field's description for screen readers. |
| `mask` | `string` | `''` | Formats the value as the user types: `0` a digit, `a` a letter, `*` either; any other character is a separator added for the user (`\` makes a pattern character one). E.g. `0-0000-00000-00-0` (Thai citizen ID), `000-000-0000`. `value` and the form get the formatted text, `rawValue` what was typed. Put the format in the helper text too (Carbon). |
| `minlength` | `number \| undefined` |  |  |
| `maxlength` | `number \| undefined` |  |  |
| `max-count` | `number \| undefined` |  | Soft limit with a visible counter (unlike maxlength, extra text isn't blocked). |
| `too-long-text` | `string` | `''` | Error when over `max-count`; `{max}` is replaced with the limit. |
| `near-limit-text` | `string` | `''` | Announced once when the remaining characters drop to 10% or less. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `readonly` | `boolean` | `false` | Shows and submits the value but blocks changes. |
| `fluid` | `boolean` | `false` | Carbon `FluidTextInput`: the label inside a 64px box, an error / warning inside it. `<ui-fluid-form>` sets it for every field inside. |
| `required` | `boolean` | `false` | Blocks form submission while the field is empty. |
| `show-password-label` | `string` | `''` | The password toggle's name and tooltip while the password is hidden (Carbon `showPasswordLabel`; default: the translation's "Show password"). |
| `hide-password-label` | `string` | `''` | The password toggle's name and tooltip while the password shows (Carbon `hidePasswordLabel`; default: the translation's "Hide password"). |
| `inline` | `boolean` | `false` | Carbon `inline`: the label before the field, the helper / error text after it (ignored while fluid). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `rawValue` |  | The characters typed, without the mask's separators (`value` when there is no mask). |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |
| `helper-text` | Helper text with markup (links, bold); overrides `helper-text` |
| `warn-text` | Warning text shown while `warn`; overrides `warn-text` |
| `invalid-text` | Error text shown while invalid; overrides `invalid-text` |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The field box around the input |
| `label` | The label |
| `input` | The native input |
| `prefix` | The text before the value |
| `suffix` | The text after the value |
| `password-toggle` | The show / hide password button |
| `password-tooltip` | The `<ui-tooltip>` around it (its name) |
| `counter` | The character counter |
| `status-icon` | The error / warning icon |
| `helper-text` | The helper line |
| `warning-text` | The warning line |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |
| `error-text` | The error line |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |
| `:state(password-visible)` | While the password is shown as text (also `[data-password-visible]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | Re-dispatched from the native input (native change is not composed) |
| `ui-toggle` | detail: { visible } when the password toggle shows or hides the password (Carbon `onTogglePasswordVisibility`) |
| `input` | Native input event (already composed, so it reaches the host) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-strong-1` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-hover-border-color` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-text-input-skeleton>`

Carbon `TextInputSkeleton` (`cds-text-input-skeleton`): the shape of a `<ui-text-input>` while its data loads — a 75×14 label bar, 8px, then the field's bar at its `size` (sm 32 / md 40 / lg 48px). Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/text-input';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The field's height: sm 32px, md 40px, lg 48px. |
| `hide-label` | `boolean` | `false` | No label bar (the field had `hide-label`). |
| `fluid` | `boolean` | `false` | The fluid field's skeleton (Carbon `Fluid*Skeleton`): a 64px box with two bars; `<ui-fluid-form>` sets it. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label bar |
| `field` | The field bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-theme-switcher>`

Lets a person pick the light, dark or system theme (no Carbon counterpart; the user chose an icon content switcher, as the theme setting of IBM Cloud). The choice shows on `<html data-theme>` as `light-theme` / `dark-theme` (white / g100 by default; system follows the OS while it changes) and is remembered in `localStorage` under `storage-key` (`""` = not remembered). It starts on the remembered mode, else `value`, else what `<html data-theme>` shows. Picking one fires `ui-theme-change` { mode, theme }; every switcher on the page, and in other tabs, follows. Setting `value` applies and remembers it too (e.g. from a profile saved on the server). Put `themeScript()` from the core in `<head>` so a reload paints the remembered theme at once.

นำเข้า: `import '@purpurabog/ui/theme-switcher';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `value` | `ThemeMode \| undefined` |  | The mode shown: light, dark or system. |
| `light-theme` | `CarbonTheme` | `'white'` | The Carbon theme of "light" (white or g10). |
| `dark-theme` | `CarbonTheme` | `'g100'` | The Carbon theme of "dark" (g90 or g100). |
| `storage-key` |  | `THEME_STORAGE_KEY` | The `localStorage` key; empty = don't remember. |
| `size` | `ContentSwitcherSize` | `'md'` |  |
| `low-contrast` | `boolean` | `false` |  |
| `tooltip-placement` | `TooltipPlacement` | `'top'` | Where the icons' tooltips show (Carbon `IconSwitch` `align`). |
| `label` | `string` | `''` | Names the group; defaults to the translation of "Theme". |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `switcher` | The `<ui-content-switcher>` |
| `item` | Each `<ui-content-switcher-item>` |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-theme-change` | The person picked a mode: { mode, theme } |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-border-disabled` | `(ตามบริบท)` |
| `--ui-border-inverse` | `(ตามบริบท)` |
| `--ui-content-switcher-background` | `(ตามบริบท)` |
| `--ui-content-switcher-outline` | `(ตามบริบท)` |
| `--ui-content-switcher-padding` | `(ตามบริบท)` |
| `--ui-content-switcher-radius` | `(ตามบริบท)` |
| `--ui-content-switcher-track` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline-strong` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-tile>`

Carbon `Tile` / `ClickableTile` (`cds-tile`, `cds-clickable-tile`): a `$layer` box — 16px padding, no border, no shadow, at least 64 × 128px — so it follows the `<ui-layer>` it sits on.

นำเข้า: `import '@purpurabog/ui/tile';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `href` | `string` | `''` | Makes the whole tile a link. |
| `target` | `'_self' \| '_blank'` | `'_self'` |  |
| `disabled` | `boolean` | `false` | A linked tile that can't be followed right now (Carbon `ClickableTile disabled`): plain text, no link. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Tile content |
| `icon` | A linked tile's icon (e.g. an arrow), 20px, 12px from the bottom-end corner |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The container (`<div>` or `<a>`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-card-background` | `(ตามบริบท)` |
| `--ui-card-border` | `(ตามบริบท)` |
| `--ui-card-radius` | `(ตามบริบท)` |
| `--ui-duration-moderate-01` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-interactive` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-time-picker>`

Carbon `TimePicker`: a short "hh:mm" text field in the code font (code-02) with optional `<ui-time-picker-select>` children beside it (AM / PM, time zone). The text is validated against `pattern` (default: 12-hour `h:mm` or `hh:mm`, so typing what the placeholder shows works) after blur or a submit attempt; set `invalid` / `warn` yourself for server-side messages. Sizes sm 32 / md 40 / lg 48px (default md, as in Carbon).

นำเข้า: `import '@purpurabog/ui/time-picker';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `max-length` |  |  | Deprecated: use `maxlength` |
| `label` | `string` | `''` |  |
| `hide-label` | `boolean` | `false` |  |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` |  |
| `placeholder` | `string` | `'hh:mm'` |  |
| `pattern` |  | `String.raw(1[012]\|0?[1-9]):[0-5][0-9](\s)?` | 12-hour time with an optional trailing space. Carbon's default rejects a leading zero, so "09:30" typed as the `hh:mm` placeholder shows would fail; this one accepts "9:30" and "09:30". |
| `maxlength` | `number` | `5` | Like `<input maxlength>` (Carbon `maxLength`); the `max-length` attribute of 0.8 and earlier is still read. |
| `size` | `TimePickerSize` | `'md'` |  |
| `disabled` | `boolean` | `false` |  |
| `readonly` | `boolean` | `false` |  |
| `fluid` | `boolean` | `false` | Carbon `FluidTimePicker`: equal 64px columns with labels inside, an error / warning inside the box. `<ui-fluid-form>` sets it for every field inside. |
| `required` | `boolean` | `false` |  |
| `invalid` | `boolean` | `false` |  |
| `invalid-text` | `string` | `''` |  |
| `warn` | `boolean` | `false` |  |
| `warn-text` | `string` | `''` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-time-picker-select>` elements |
| `label` | Rich label |
| `invalid-text` | Rich error text |
| `warn-text` | Rich warning text |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The label |
| `base` | Row with the input and the selects |
| `input` | The text input |
| `error-text` | Error text |
| `invalid-text` | Same line as `error-text` (named after the `invalid-text` attribute / slot) |
| `warning-text` | Warning text |
| `warn-text` | Same line as `warning-text` (named after the `warn-text` attribute / slot) |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(show-error)` | While its error message shows (also `[data-show-error]`) |
| `:state(show-warn)` | While its warning message shows (also `[data-show-warn]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` |  |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-invalid-halo` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-code-lg` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-placeholder` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-tracking-code` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-time-picker-select>`

Carbon `TimePickerSelect`: the compact native select beside a `<ui-time-picker>` input (AM / PM, time zone). Author `<option>` children; the picker passes down `size`, `readonly` and its `disabled`. Form-associated (`name` / `value`); fires `change`.

นำเข้า: `import '@purpurabog/ui/time-picker';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Accessible name of the select (Carbon default "open list of options"). |
| `value` | `string` | `''` |  |
| `name` | `string` | `''` |  |
| `size` | `TimePickerSize` | `'md'` |  |
| `disabled` | `boolean` | `false` |  |
| `readonly` | `boolean` | `false` |  |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `pickerDisabled` | `boolean` | Set by the surrounding `<ui-time-picker>` when it is disabled. |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<option>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `input` | The native select |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `change` | When the user picks an option |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-background` | `(ตามบริบท)` |
| `--ui-field-border` | `(ตามบริบท)` |
| `--ui-field-disabled-border-color` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-font-size` | `(ตามบริบท)` |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-field-readonly-border-color` | `(ตามบริบท)` |
| `--ui-field-underline-color` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-none` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-sm` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxl` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-time-picker-skeleton>`

Carbon `FluidTimePickerSkeleton` (Carbon has no other time picker skeleton): the shape of a fluid `<ui-time-picker>` while its data loads — the time box (25%), the AM / PM select (25%) and the time zone select (50%), each a 64px fluid box with two bars; `is-only-two` (Carbon `isOnlyTwo`) two halves. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/time-picker';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `is-only-two` | `boolean` | `false` | Two boxes (time and AM / PM), half each. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `field` | Each box |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-toaster>`

The corner where toasts stack (Carbon has no toast manager; Carbon's toast guidance: top right, under the header). Usually created by `toast()`; place one yourself to change `placement` or `max`.

นำเข้า: `import '@purpurabog/ui/toaster';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `placement` | `ToasterPlacement` | `'top-end'` | Corner: newest toast nearest the edge. |
| `max` | `number` | `3` | Most toasts shown at once; a new one closes the oldest. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-notification variant="toast">` elements (added by `toast()`) |

### CSS parts
_ไม่มี_

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-button-radius` | `(ตามบริบท)` |
| `--ui-button-tertiary-border` | `(ตามบริบท)` |
| `--ui-button-tertiary-ink` | `(ตามบริบท)` |
| `--ui-close-inset` | `(ตามบริบท)` |
| `--ui-close-size` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-easing-entrance` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-emphasis` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-button` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-ghost-hover` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-info` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-inverse-canvas` | `(ตามบริบท)` |
| `--ui-inverse-hover` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-link-inverse` | `(ตามบริบท)` |
| `--ui-notification-action-hover` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse-active` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse-hover` | `(ตามบริบท)` |
| `--ui-notification-action-tertiary-inverse-text` | `(ตามบริบท)` |
| `--ui-notification-background` | `(ตามบริบท)` |
| `--ui-notification-background-error` | `(ตามบริบท)` |
| `--ui-notification-background-info` | `(ตามบริบท)` |
| `--ui-notification-background-success` | `(ตามบริบท)` |
| `--ui-notification-background-warning` | `(ตามบริบท)` |
| `--ui-notification-bar-width` | `(ตามบริบท)` |
| `--ui-notification-edge` | `(ตามบริบท)` |
| `--ui-notification-focus` | `(ตามบริบท)` |
| `--ui-notification-frame-start` | `(ตามบริบท)` |
| `--ui-notification-hover` | `(ตามบริบท)` |
| `--ui-notification-ink` | `(ตามบริบท)` |
| `--ui-notification-link` | `(ตามบริบท)` |
| `--ui-notification-radius` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xl` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-success` | `(ตามบริบท)` |
| `--ui-toast-shadow` | `(ตามบริบท)` |
| `--ui-toaster-offset` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-toggle>`

Carbon-style toggle (`Toggle`): an on / off switch with a label above and a state text beside it.

นำเข้า: `import '@purpurabog/ui/toggle';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` | Label above the switch; the `label` slot replaces it when markup is needed. |
| `hide-label` | `boolean` | `false` | Hide the label above; it then replaces the On / Off text beside the switch (Carbon `hideLabel`). |
| `label-a` | `string` | `''` | Side text while off (Carbon `labelA`). |
| `label-b` | `string` | `''` | Side text while on (Carbon `labelB`). |
| `checked` | `boolean` | `false` |  |
| `value` | `string` | `'on'` | Submitted under `name` while checked. |
| `name` | `string` | `''` | Reflected: form-associated elements submit under the `name` attribute. |
| `size` | `ToggleSize` | `'md'` | md: 48×24 track (default) · sm: 32×16 with a check mark in the knob. |
| `disabled` | `boolean` | `false` | Disables the control; a disabled `<fieldset>` ancestor does the same. |
| `readonly` | `boolean` | `false` | Shows and submits the state but blocks toggling. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `labels` |  | The `<label>`s that point at this field. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | Label content with markup; the `label` attribute is the plain-text fallback |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `base` | The row holding the switch and the side text |
| `label` | The label above the switch |
| `switch` | The track |
| `handle` | The knob |
| `text` | The On / Off text beside the switch |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `input` |  |
| `change` | After the user toggles it (`checked` already updated) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-button-disabled` | `(ตามบริบท)` |
| `--ui-canvas` | `(ตามบริบท)` |
| `--ui-duration-fast` | `(ตามบริบท)` |
| `--ui-easing-exit` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-on-color-disabled` | `(ตามบริบท)` |
| `--ui-on-primary` | `(ตามบริบท)` |
| `--ui-pointer-focus` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-success` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-toggle-off` | `(ตามบริบท)` |
| `--ui-toggle-on` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-toggle-skeleton>`

Carbon `ToggleSkeleton` (`cds-toggle-skeleton`): an 18px circle and a 24×8 bar beside it. Hidden from assistive tech.

นำเข้า: `import '@purpurabog/ui/toggle';`

### Attributes
_ไม่มี_

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `circle` | The circle |
| `bar` | The bar |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-field-height-lg` | `(ตามบริบท)` |
| `--ui-field-height-md` | `(ตามบริบท)` |
| `--ui-field-height-sm` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-skeleton-background` | `(ตามบริบท)` |
| `--ui-skeleton-element` | `(ตามบริบท)` |
| `--ui-skeleton-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |

## `<ui-toggletip>`

Carbon-style toggletip: a click-to-open bubble that may hold links or buttons (use ui-tooltip for short hover hints instead).

นำเข้า: `import '@purpurabog/ui/toggletip';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `label` | `string` | `''` | Accessible name of the trigger, e.g. "More about retention". |
| `placement` | `Placement` | `'bottom'` |  |
| `open` | `boolean` | `false` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Bubble content (text, links, buttons) |
| `trigger` | Custom trigger icon (default: an "i" information icon) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `trigger` | The info button |
| `bubble` | The popover content box |
| `caret` | The arrow pointing at the trigger |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { open }, after it opens or closes |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-control-radius` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-menu-border` | `(ตามบริบท)` |
| `--ui-menu-radius` | `(ตามบริบท)` |
| `--ui-overlay-background` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-tooltip>`

Carbon-style tooltip: short, plain-text help for the wrapped control.

นำเข้า: `import '@purpurabog/ui/tooltip';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (same values) |
| `text` | `string` | `''` |  |
| `placement` | `TooltipPlacement` | `'top'` |  |
| `as-label` | `boolean` | `false` | Use the text as the trigger's accessible name instead of its description. |
| `small` | `boolean` | `false` | The icon tooltip's look (as `as-label`: 8px off, 2px / 16px padding, 8×4 caret) without naming the trigger. |
| `open` | `boolean` | `false` | Whether the bubble is showing. Hover / focus manage it; set it yourself together with `pinned`. |
| `pinned` | `boolean` | `false` | Keep the bubble open regardless of hover, focus, clicks and Escape — for a confirmation such as "Copied!" (Carbon copy button). While pinned, only `open` closes it. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `anchor` | `HTMLElement \| null` | The element the bubble points at, listens to and names / describes, instead of the slotted trigger — for a focusable host that renders its tooltip in its own shadow root (an icon-only content switcher item). |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | The trigger (one focusable element, e.g. `<ui-button>`) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `bubble` | The tooltip bubble |
| `caret` | The arrow pointing at the trigger |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-inverse-surface-1` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-radius-xs` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tooltip-radius` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-tree-node>`

One node of a `<ui-tree-view>` (Carbon `TreeNode`). Nest `<ui-tree-node>`s as children to make a branch (expand with the caret, Enter, or Right; collapse with Left); `href` turns the label into a link. Selection, focus and `active` are managed by the tree.

นำเข้า: `import '@purpurabog/ui/tree-view';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `value` | `string` | `''` | Identifies the node in `selected` / `active`; defaults to `label`. |
| `expanded` | `boolean` | `false` |  |
| `disabled` | `boolean` | `false` |  |
| `href` | `string` | `''` |  |
| `lazy` | `boolean` | `false` | A branch whose children aren't loaded yet: it shows a caret and fires `ui-lazy-load` when first expanded. |
| `loading` | `boolean` | `false` | The children are being fetched; set by the node when a `lazy` branch opens, cleared when children arrive. |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `depth` | `number` | Set by the tree. |
| `isBranch` |  | Has child nodes, or is `lazy` and will have them. |
| `treeValue` |  | What identifies the node in the tree's `selected` / `active`: `value`, else `label`, else the label slot's text. (Was `nodeValue`, which shadowed DOM `Node.nodeValue`.) |
| `labelText` |  | The label as text, which type-ahead matches: the `label` slot's text when it is used, else `label`. |
| `childTreeNodes` | `UiTreeNode[]` | Direct child nodes. |
| `parentTreeNode` | `UiTreeNode \| null` | The enclosing node, or null at the top level. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Child nodes |
| `icon` | 16px icon before the label |
| `label` | Rich label (Carbon React's `label` node): replaces the `label` text, which stays the plain-text fallback |
| `end` | Beyond Carbon: content at the end of the row (an amount, a count, a badge), kept whole while the label truncates; it then describes the node, which the label alone names |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The row |
| `toggle` | The caret button (branches) |
| `children` | The `role=group` container |
| `end` | The end content's wrapper (beyond Carbon) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded, value } when the branch opens / closes |
| `ui-lazy-load` | detail: { value } when a `lazy` node is expanded and its children should be fetched |
| `ui-navigate` | detail: { href } (cancelable) on a plain click of the link; cancel it to route client-side (README: SPA router) |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-1` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-layer-active-1` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-layer-selected-1` | `(ตามบริบท)` |
| `--ui-layer-selected-hover-1` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-tree-background` | `(ตามบริบท)` |
| `--ui-tree-mark` | `(ตามบริบท)` |
| `--ui-tree-mark-inset` | `(ตามบริบท)` |
| `--ui-tree-mark-radius` | `(ตามบริบท)` |
| `--ui-tree-mark-width` | `(ตามบริบท)` |
| `--ui-tree-pointer-outline` | `(ตามบริบท)` |
| `--ui-tree-row-radius` | `(ตามบริบท)` |
| `--ui-tree-selected` | `(ตามบริบท)` |
| `--ui-tree-selected-hover` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-tree-view>`

Carbon `TreeView`: a `role=tree` of nested `<ui-tree-node>`s with a Carbon label. Click or Space selects (and makes the node `active`); `multiselect` toggles with Ctrl / ⌘ + click or Space and selects all with Ctrl + A. Up / Down move through the visible nodes, Home / End jump, Left / Right collapse / expand (or move to the parent / first child). Sizes sm 32px (default) / xs 24px.

นำเข้า: `import '@purpurabog/ui/tree-view';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `label` | `string` | `''` |  |
| `hide-label` | `boolean` | `false` |  |
| `size` | `TreeViewSize` | `'sm'` |  |
| `multiselect` | `boolean` | `false` |  |
| `active` | `string` | `''` | The node that was last activated (4px marker). |

### Properties (ไม่มี attribute)
| ชื่อ | ชนิด | คำอธิบาย |
| --- | --- | --- |
| `selected` | `string[]` | Selected node values. |
| `nodes` | `UiTreeNode[]` | Every node, document order. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | Top-level `<ui-tree-node>`s |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `label` | The tree label |
| `tree` | The `role=tree` container |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-select` | detail: { selected: string[], value } after a selection change |
| `ui-activate` | detail: { active } when a node becomes the active one |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-duration-moderate` | `(ตามบริบท)` |
| `--ui-easing` | `(ตามบริบท)` |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-1` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-family` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-icon-disabled` | `(ตามบริบท)` |
| `--ui-icon-primary` | `(ตามบริบท)` |
| `--ui-icon-secondary` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-interactive` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-layer-1` | `(ตามบริบท)` |
| `--ui-layer-active-1` | `(ตามบริบท)` |
| `--ui-layer-hover-1` | `(ตามบริบท)` |
| `--ui-layer-selected-1` | `(ตามบริบท)` |
| `--ui-layer-selected-hover-1` | `(ตามบริบท)` |
| `--ui-primary` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-tree-background` | `(ตามบริบท)` |
| `--ui-tree-mark` | `(ตามบริบท)` |
| `--ui-tree-mark-inset` | `(ตามบริบท)` |
| `--ui-tree-mark-radius` | `(ตามบริบท)` |
| `--ui-tree-mark-width` | `(ตามบริบท)` |
| `--ui-tree-pointer-outline` | `(ตามบริบท)` |
| `--ui-tree-row-radius` | `(ตามบริบท)` |
| `--ui-tree-selected` | `(ตามบริบท)` |
| `--ui-tree-selected-hover` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-truncated-text>`

Carbon for IBM Products `TruncatedText` (`c4p-truncated-text`): `value` cut to `lines` lines with an ellipsis. Only when it doesn't fit: `type="tooltip"` makes it a button that shows the whole text in a tooltip (and is named by it); `type="expand"` adds a "View more" / "View less" link-coloured toggle under it that opens the rest, animating the height (110ms, none with reduced motion). The text takes the font of where it sits.

นำเข้า: `import '@purpurabog/ui/truncated-text';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `align` |  |  | Carbon's name for `placement` (the tooltip's side) |
| `value` | `string` | `''` | The text. |
| `lines` | `number` | `2` | Lines shown before the ellipsis; 0 = all. |
| `type` | `TruncatedTextType` | `'tooltip'` | What a truncated text offers: the whole text in a tooltip, or a toggle that expands it. |
| `placement` | `Placement` | `'top'` | The tooltip's side. |
| `expand-label` | `string` | `''` | The expand toggle's text (default "View more", translated). |
| `collapse-label` | `string` | `''` | The collapse toggle's text (default "View less", translated). |
| `expanded` | `boolean` | `false` | Whether an expandable text shows in full. |

### Slots
_ไม่มี_

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `content` | The text |
| `trigger` | The button around the text of a truncated `type="tooltip"` |
| `toggle` | The expand / collapse button |

### Custom states
| Selector | คำอธิบาย |
| --- | --- |
| `:state(overflowing)` | While the text doesn't fit its `lines` (also `[data-overflowing]`) |

### Events
| ชื่อ | คำอธิบาย |
| --- | --- |
| `ui-toggle` | detail: { expanded } when the toggle opens or closes the text |

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-error` | `(ตามบริบท)` |
| `--ui-error-text` | `(ตามบริบท)` |
| `--ui-field-focus-halo` | `(ตามบริบท)` |
| `--ui-field-focus-width` | `(ตามบริบท)` |
| `--ui-field-radius` | `(ตามบริบท)` |
| `--ui-field-readonly-background` | `(ตามบริบท)` |
| `--ui-fluid-background` | `(ตามบริบท)` |
| `--ui-fluid-focus-border-color` | `(ตามบริบท)` |
| `--ui-fluid-gap` | `(ตามบริบท)` |
| `--ui-fluid-icon-end` | `(ตามบริบท)` |
| `--ui-fluid-icon-top` | `(ตามบริบท)` |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-offset` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-hairline` | `(ตามบริบท)` |
| `--ui-ink` | `(ตามบริบท)` |
| `--ui-ink-disabled` | `(ตามบริบท)` |
| `--ui-ink-muted` | `(ตามบริบท)` |
| `--ui-ink-subtle` | `(ตามบริบท)` |
| `--ui-label-color` | `(ตามบริบท)` |
| `--ui-label-font` | `(ตามบริบท)` |
| `--ui-link` | `(ตามบริบท)` |
| `--ui-link-focus-radius` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xs` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-surface-1` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
| `--ui-warning` | `(ตามบริบท)` |

## `<ui-unordered-list>`

Carbon `UnorderedList` (`cds-unordered-list`): `<ui-list-item>`s marked with an en dash 16px before the text, the list 16px in; a list inside an item is nested (32px in, a ▪ marker 12px before the text, items 4px in).

นำเข้า: `import '@purpurabog/ui/list';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `nested` | `boolean` | `false` | Nested in another list's item (set for you when it sits in a `<ui-list-item>`). |
| `is-expressive` | `boolean` | `false` | Body-02 type (16px) for expressive pages. |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `(default)` | `<ui-list-item>` elements |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `list` | The `<ul>` |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-font-body` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-space-md` | `(ตามบริบท)` |
| `--ui-space-xxs` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |

## `<ui-user-avatar>`

Carbon for IBM Products `UserAvatar` (`c4p-user-avatar`): a round avatar of a person — their photo (`image`), a custom icon (`slot="icon"`), their initials from `name` ("thomas j. watson" → "TW"), or the user icon, in that order. Sizes sm 24px (label-01), md 32px (body-compact-01), lg 48px (heading-03), xl 64px (heading-04); text-inverse on one of Carbon's 12 avatar colours (`background-color` `order-1-cyan` … `order-12-teal`, a lighter grade on g90 / g100). With `tooltip-text` the avatar becomes a button named by that text, which shows it in a tooltip (`tooltip-alignment`, default bottom) and takes a 2px focus ring. Start the text with the initials ("TW, Thomas J. Watson", as Carbon's story) so the name holds what is seen (WCAG 2.5.3).

นำเข้า: `import '@purpurabog/ui/user-avatar';`

### Attributes
| ชื่อ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | `''` | The person's name or initials; the avatar shows the initials. |
| `image` | `string` | `''` | A photo's URL, shown instead of the initials. |
| `image-description` | `string` | `''` | The photo's alt text. |
| `size` | `UserAvatarSize` | `'md'` |  |
| `background-color` | `UserAvatarColor` | `'order-1-cyan'` | One of Carbon's 12 avatar colours, `order-1-cyan` … `order-12-teal`. |
| `tooltip-text` | `string` | `''` | Shown in a tooltip and names the avatar, which becomes a button (e.g. "Thomas J. Watson"). |
| `tooltip-alignment` | `Placement` | `'bottom'` |  |

### Slots
| ชื่อ | คำอธิบาย |
| --- | --- |
| `icon` | A custom icon in place of the initials / user icon (sized 16 / 20 / 24 / 32px) |

### CSS parts
| ชื่อ | คำอธิบาย |
| --- | --- |
| `avatar` | The circle |
| `image` | The photo |
| `trigger` | The button around the avatar when it has a tooltip |

### Events
_ไม่มี_

### Design tokens ที่อ่าน
ตั้งทับที่ `:root` หรือโซนรอบ element (ค่า = ธีม white; token ที่ขึ้นกับ layer แสดง `(ตามบริบท)`)
| Token | ค่าเริ่มต้น |
| --- | --- |
| `--ui-focus` | `(ตามบริบท)` |
| `--ui-focus-width` | `(ตามบริบท)` |
| `--ui-font-body-sm` | `(ตามบริบท)` |
| `--ui-font-caption` | `(ตามบริบท)` |
| `--ui-font-heading-03` | `(ตามบริบท)` |
| `--ui-font-heading-04` | `(ตามบริบท)` |
| `--ui-icon-inverse` | `(ตามบริบท)` |
| `--ui-inverse-ink` | `(ตามบริบท)` |
| `--ui-tracking-body` | `(ตามบริบท)` |
| `--ui-tracking-caption` | `(ตามบริบท)` |
