Foundations · policy

Component governance

One list of patterns that are already designed and must be reused everywhere — no native OS controls, no one-off pills, no bespoke re-implementations. This card is the visible face of the registry; the authoritative copy is guidelines/MANDATES.md, the binding rule is in CLAUDE.md, and machine checks live in _adherence.oxlintrc.json.

01The mandate registryuse this — never that
#PatternUse thisNever this
1Select / dropdown<Select> · vanilla .sc-select via scEnhanceSelects()the browser's native option popup
2Status pill<Badge> · .sc-badge--<tone>a span with inline background + radius
3Button<Button> · .sc-btna raw <button> styled inline
4Input & field<Input> · .sc-field + .sc-inputa bare <input> without the field shell
5Icon<Icon> · data-lucide (Lucide)a hand-drawn inline <svg>
6Avatar + presence<Avatar status> · .sc-avatara circle with an absolutely-placed dot
7Data table.sc-table chrome (--striped / --hover)an unstyled <table> or ad-hoc grid
8Pagination<Pager> · .sc-pagera custom prev / next number row
9Color & spacingtoken var(--…) valuesraw hex / px where a token exists

The full table — with the exact React component file and CSS class per row — lives in guidelines/MANDATES.md. Add a row whenever you create a pattern worth reusing.

02Reference case · #1 Selectwhat "mandated" looks like in practice
✓ Mandated — system listbox
Click it — the open menu is our tokenised popup, identical in every browser.
#2 Badge — the only status pill
ส่งมอบแล้ว รอตรวจสอบ กำลังชั่ง เกินกำหนด อ้อยสด พรีเมียม

Every status across the portal, mobile app and specimen tables resolves to these — audited, no drift. Content is text or a system icon + label — never a leading bullet.

03How control is keptfour files, one source of truth
guidelines/MANDATES.md— the registry + adherence log. Authoritative. Edit this first.
CLAUDE.md— makes the registry binding on every future change in this project.
_adherence.oxlintrc.json— machine-checkable lint rules for component props & usage.
guidelines/select-enhance.js— the shared enhancer that brings any native <select> into line with #1.