Bắt đầu 1 project mới? Đây là cách dùng kit.
File này hướng dẫn anh sử dụng Cowork UI Kit khi bắt đầu 1 công việc thực tế — từ "anh có idea" đến "có UI chạy trên browser". Không lý thuyết, chỉ workflow.
3 scenario phổ biến nhất + decision tree chọn aesthetic + code snippet copy-paste + checklist QC trước deploy.
Quy trình chuẩn 4 bước
-
1
Chọn archetype (page type)Dashboard? Landing? Editorial? Mở
_previews/index.html, nhìn 6 cái, chọn 1. -
2
Aesthetic đã có sẵn theo archetypeDashboard / Tool → Dark P4. Landing / Editorial / PWA → Warm P1. Không cần chọn thêm.
-
3
Setup tokens vào projectNext.js → copy
tokens/tailwind.preset.js. WordPress/HTML → importtokens/tokens.css. -
4
Copy component từ showcaseMở
showcase/0X-*.html, view source, copy block HTML cần dùng. Paste vào project. Xong.
Anh đang định làm gì?
Trả lời câu hỏi → cây dẫn anh đến file mockup tương ứng.
Anh không phải chọn lại
Mỗi archetype đã map cứng vào 1 aesthetic — đừng pha trộn.
Archetype C / D / E / F
Landing, editorial, deck, mobile PWA — bất cứ thứ gì người dùng cuối sẽ chạm vào.
Archetype A / B
Dashboard, internal tool, BI — bất cứ thứ gì người trong team dùng để ra quyết định.
3 scenario phổ biến
Pick scenario phù hợp + làm theo từng bước.
Start project Next.js mới
Vd: KHI Studio v2, KHI Drive, BetterBuy admin, AI Tools dashboard mới
-
A.1 Tạo Next.js project + cài Tailwind
# Trong 00-dev/ npx create-next-app@latest khi-studio --typescript --tailwind --app cd khi-studio -
A.2 Copy Tailwind preset vào project
cp ../../00-templates/ui-kit/tokens/tailwind.preset.js ./tailwind.preset.js -
A.3 Wire preset vào
tailwind.config.tsimport type { Config } from "tailwindcss"; import coworkPreset from "./tailwind.preset.js"; const config: Config = { presets: [coworkPreset], content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"], }; export default config; -
A.4 Add Google Fonts vào
app/layout.tsx// Warm aesthetic dùng Instrument Serif + Inter + Plus Jakarta Sans // Dark aesthetic dùng Inter + IBM Plex Mono import { Inter, Instrument_Serif, IBM_Plex_Mono } from "next/font/google"; const inter = Inter({ subsets: ["latin"], variable: "--font-sans" }); const serif = Instrument_Serif({ weight: "400", subsets: ["latin"], variable: "--font-serif" }); const mono = IBM_Plex_Mono({ weight: ["400", "500"], subsets: ["latin"], variable: "--font-mono" }); -
A.5 Mở showcase → copy component cần dùng
Vd cần Button warm:
Mởshowcase/01-primitives.htmltrong browser → tìm section "Button" → view source → copy block warm// Paste vào component React của anh <button className="bg-warm-coral hover:bg-warm-coral-deep text-white px-6 py-3 rounded-2xl shadow-md font-medium transition"> Start subscription </button> -
A.6 Đặt mesh background warm/dark cho layout
// Warm landing hero <section className="bg-mesh-warm min-h-screen">...</section> // Dark dashboard background <div className="bg-dark-base text-dark-text min-h-screen">...</div> -
A.7 QC trước commitTrong cli:
/kry-qc ui— em sẽ check font ≥12px, không hardcode hex, contrast 4.5:1, tap target ≥32px.
Tạo 1 page HTML standalone
Vd: landing microsite, presentation slide, ladning ads campaign, mockup gửi đối tác
-
B.1 Copy file mockup gần nhất làm starter
# Vd cần landing warm cp 00-templates/ui-kit/_previews/page-C-landing.html ./annhien/04-marketing/landing-may-2026.html -
B.2 Replace content thậtMurmur → An Nhien Trầm Hương, headline "Coffee that meets you" → headline brand mới, photo blob coffee → photo trầm hương... Giữ nguyên cấu trúc layout + token color.
-
B.3 Thêm component khác từ showcaseCần testimonial carousel? Mở
showcase/04-patterns.htmltìm section "Testimonial" → copy block → paste vào file của anh. -
B.4 Test browser + deployMở file qua
file://protocol → check render. Deploy: upload lên VPS hoặc host static (Cloudflare Pages, Vercel).
Add aesthetic vào WordPress existing
Vd: tramhuongannhien.vn, tweak Elementor section, custom block
-
C.1 Enqueue tokens.css vào theme
// functions.php của theme function enqueue_cowork_tokens() { wp_enqueue_style('cowork-tokens', get_template_directory_uri() . '/cowork-tokens.css'); } add_action('wp_enqueue_scripts', 'enqueue_cowork_tokens'); -
C.2 Dùng CSS variables trong Elementor Custom CSS
/* Custom CSS trong Elementor section */ .cta-button { background: var(--w-coral); color: white; border-radius: var(--r-2xl); padding: var(--sp-3) var(--sp-6); box-shadow: var(--shadow-md); } .cta-button:hover { background: var(--w-coral-deep); } -
C.3 Hero section → dùng class
.mesh-warm/* Elementor section custom class: mesh-warm đã có trong tokens.css */ /* Section settings → Advanced → CSS Classes: mesh-warm */ -
C.4 Test contrast + responsiveCoral trên cream phải pass 4.5:1. Test mobile breakpoint Elementor responsive control. Cache: LiteSpeed/Rocket purge.
Việc cấm vs việc bắt buộc
Đây là rule em đã enforce qua /kry-qc ui. Tránh để bị nhắc lại.
Không bao giờ làm
-
×
Hardcode hex color trong JSX/HTML. Phải dùng
bg-warm-coralhoặcvar(--w-coral). -
×
Text dưới 12px. Không dùng
text-[10px]hoặctext-[11px]. -
×
Mix aesthetic. Dashboard mà dùng Instrument Serif italic — sai. Landing mà dùng IBM Plex Mono — sai.
-
×
Mặc định cùng 1 màu cho 2 brand. KHI sage không phải An Nhien sage. Mỗi brand sẽ có preset riêng (sắp build).
-
×
Tap target nhỏ hơn 32px. Mobile ≥44px. Đặt
min-h-[44px]hoặcpy-3cho button mobile. -
×
Wrap rớt hàng "mồ côi" — như filter chip 4 cái rớt thành 2 hàng + Export rớt riêng 1 hàng. Phải
whitespace-nowrap+ tách row rõ ràng.
Luôn làm
-
✓
Dùng semantic token —
bg-warm-coral,text-dark-text-2. Đổi brand → đổi preset, không phải sửa code. -
✓
Test ở 4 breakpoint: mobile 390, tablet 768, desktop 1280, wide 1536. Mỗi viewport check không "rớt hàng mồ côi".
-
✓
Empty state, error state, loading state đầy đủ — đã có pattern trong
showcase/04-patterns.html. -
✓
Tab num cho số liệu — class
.tab-num(đã có trong tokens.css). Để cột số align thẳng. -
✓
Chạy
/kry-qc uitrước push prod. Khi báo done. -
✓
Khi cần thay đổi token — sửa trong
tokens/tokens.css+tailwind.preset.jsđồng thời. Không sửa lẻ.
Quick reference
w-base #FAF6EEw-surface #FDFAF3w-coral #C97464w-coral-deep #B5604Fw-sage #5E7355w-amber #D4A574w-ink #2D2E2Ad-base #0A0A12d-surface #12121Ad-violet #7C5CFFd-cyan #22D3EEd-emerald #10B981d-amber #F59E0Bd-danger #EF4444rounded-2xl 24px (card warm)rounded-3xl 32px (hero, big card)rounded-md 8px (input, button dark)text-xs 12px (label min)text-sm 14px (table, dense)text-base 16px (body)text-lg 18px (article body)shadow-md card hover warmshadow-glow-violet CTA darkbg-mesh-warm hero bg landingbg-mesh-dark hero bg dashboard.tab-num tabular numsfont-sans Interfont-display Plus Jakarta Sansfont-serif Instrument Serif (warm only)font-mono IBM Plex Mono (dark only)bg-warm-coral text-white rounded-2xl px-6 py-3
bg-dark-violet text-white rounded-md px-5 py-2.5
tokens/tokens.csstokens/tailwind.preset.jsshowcase/01-primitives.htmlshowcase/02-composites.htmlshowcase/03-dataviz.htmlshowcase/04-patterns.html_previews/page-A-F.htmlCâu hỏi thường gặp
Em đang làm KHI nhưng cũng muốn warm aesthetic, được không? +
Brand An Nhien dùng nâu trầm hương, không phải coral. Đổi như nào? +
w-coral → #8B4513 nâu trầm hương. Code vẫn dùng bg-warm-coral, render theo brand. Hiện tại tạm hardcode hex An Nhien trong file landing An Nhien — em sẽ migrate sau khi preset xong.
Mesh background lag/heavy không? Có nên dùng trên mobile? +
Có dark mode toggle không? +
Em update kit (vd tokens.css), project existing có break không? +
cp lại). Project WordPress: import từ kit thì cập nhật. Em không auto-push update — anh control timing.
Anh không code, có dùng được không? +
Sẵn sàng bắt đầu?
Mở gallery, chọn archetype, copy mockup gần nhất, replace content. Xong 30 phút.