Layout Guide
Tài liệu mô tả các mẫu layout dùng chung trên toàn hệ thống ELS HRM. Mỗi module đều được xây dựng từ các pattern có sẵn — không sáng tạo layout mới. Áp dụng đúng pattern giúp UI nhất quán và rút ngắn thời gian triển khai.
shadcn/ui × Archivo
Font: Archivo Variable
Base: 16px / 4px grid
Locale: vi-VN
01
App Shell — HRMShell
Khung bao ngoài dùng cho mọi màn hình trong hệ thống. Gồm Sidebar cố định + Main area (Topbar → PageTitle → Content).
Sidebar — 240px fixed
Topbar — 52px
PageTitle — auto height
Content — flex:1, overflow:auto
HRMSidebar
width 240px (15rem)
height 100%
background var(--sidebar)
border-right 1px var(--sidebar-border)
Brand padding 14px 20px
Nav padding 8px 12px 2px
Active indicator 3px left border
Nav item height ~30px (7px padding)
Section label 10px / 700 / uppercase
Nav item font 13.5px / 500
User footer pad 10px 14px
HRMTopbar
height 52px
padding 0 24px
background var(--card)
border-bottom 1px var(--border)
Search width 320px
Action icons 34×34px, r:6px
HRMPageTitle
padding 13px 24px
background var(--card)
border-bottom 1px var(--border)
h1 font-size 21px / 700
Breadcrumb 11.5px, muted
Content Area
flex 1
overflow auto
padding 20px
background var(--background)
02–06
Layout Patterns
5 pattern tái sử dụng trên toàn module. Chọn pattern phù hợp với mục đích màn hình.
Stat Card 1
Stat Card 2
Stat Card 3
Stat Card 4
🔍 Search
Select ▾
Select ▾
1–8/247
Cấu trúc
Layout flex column
Stats grid repeat(4,1fr)
Stats gap 12px
Stats margin-bottom 16px
Filter bar card, pad 10px 14px, mb 14px
Table wrap 100% width
Filter Bar — nội dung trái → phải
1 Search input (280px)
2 Select dropdowns
3 Button "Lọc nâng cao"
4 flex:1 spacer
5 View toggle (optional)
6 Pagination info text
Table
thead bg var(--muted)
thead font 12px / 600 / uppercase
td padding 12px 14px
row hover var(--muted)
Col: Nhân viên Avatar + tên + mã/meta
Col: Actions ghost icon btns, 80px
Stats là tùy chọn — bỏ qua nếu module không có tổng hợp số liệu.
Outer grid
grid-template-columns 260px 1fr
gap 16px
Variant (ESS, nhỏ hơn) 240px 1fr
Left Profile Card
padding 20px
Avatar zone center, border-bottom, pb:16px, mb:14px
Avatar size xl (72px)
Avatar edit btn 24×24px, absolute bottom-right
Info fields icon 13px + label 11px + val 12.5px
Info field gap 9px margin-bottom each
Quick Actions Card
padding 14px
Action row icon + label + chevron-right
Row padding 7px 6px
Separator border-bottom 1px var(--border)
Right Card — Tabs
Tab bar padding 0 20px
Tab padding 12px 14px
Content padding 22px
Field grid 1fr 1fr, gap: 6px 28px
Field separator border-bottom 1px, pad 9px 0
Field label 11.5px, muted, mb:3px
Field value 13.5px / 500
Stat 1
Stat 2
Stat 3
Stat 4
Content grid
grid-template-columns 1fr 320px
gap 16px
Stats (trên) repeat(4,1fr), gap:12px, mb:16px
Main (trái)
Filter bar card, pad:10px 14px, mb:12px
Nội dung chính table-wrap hoặc card list
Action buttons trong row primary "Duyệt" + outline "Từ chối"
Right Panel (phải)
width 320px fixed
Layout flex column, gap:12px
Cards thường gặp Summary · Balance · Calendar · Legend
Card padding 16px
Right panel thường chứa context phụ trợ cho việc ra quyết định (số dư phép, lịch tháng, thống kê nhóm).
Filter / Tab bar (tùy chọn)
Cấu trúc
Layout flex column
Content 1 card hoặc table-wrap 100%
Overflow horizontal scroll nếu cần
Màn hình áp dụng
Org Chart SVG/drag tree, overflow-x:auto
RBAC Matrix sticky col/header table
Lịch phỏng vấn calendar grid 7-col
Bảng công date-scrollable table
Lưu ý kỹ thuật
Sticky header position:sticky, top:0, z-index:10
Sticky col position:sticky, left:0
Min content width min-width: fit-content
03
Content Zones — Vùng tái sử dụng
Các block nhỏ xuất hiện trong nhiều pattern. Implement một lần, dùng nhiều nơi.
Padding 16px (1rem)
Border-radius var(--radius-lg)
Value font text-2xl / 700
Label font text-xs / 500 / uppercase
Icon area 36×36px, radius-md
Delta up var(--success)
Delta down var(--destructive)
Height auto (~40px)
Internal gap 10px
Search width 240–320px
Select width 130–160px each
All inputs input--sm (h-sm = 32px)
Container card, center, min-h:460px
Illustration SVG 80×80, muted circle
Title 20px / 700, mb:10px
Description 14px, muted, max-w:440px
CTAs outline + primary, gap:10px
Thao tác không thể hoàn tác
Sau khi xác nhận, tài khoản đăng nhập sẽ bị vô hiệu hóa.
Bạn chỉ có thể chỉnh sửa các trường được phép .
Padding 12–14px 14–16px
Border-radius 8–9px
Icon size 14–16px, flex-shrink:0
Danger var(--destructive-soft)
Info var(--info-soft)
Warning var(--warning-soft)
04
Spacing & Tokens
Các giá trị kích thước và token màu sắc thường dùng nhất trong layout.
Nơi dùng
Giá trị
px
Content area padding
20px
20
Topbar / PageTitle padding
0 24px
24
Gap giữa stats
12px
12
Gap outer grid (pattern B/D)
16px
16
Gap outer grid (pattern C)
18px
18
Gap form field columns
28px
28
Card padding (default)
20–22px
20–22
Card padding (compact)
14–16px
14–16
Sidebar width
240px
240
Right panel width (pattern D)
320px
320
Component heights
--h-sm
32px — btn sm, input sm
--h-md
36px — default input/btn
05
Component Reference
Mapping component → file và class CSS. Mỗi module import từ shared.jsx + hrm-shell.jsx.
HRMShell
File hrm-shell.jsx
Props active, title, crumbs, actions, meta, dark
Children content area slot
HRMSidebar
File hrm-shell.jsx
CSS .sidebar, .sidebar__*
Width 240px
HRMTopbar
File hrm-shell.jsx
CSS .topbar, .topbar__*
Height 52px
Icon
File shared.jsx
Props name, size (default 16)
Library inline SVG paths
Avatar
File shared.jsx
Sizes sm (24) · default (32) · lg (48) · xl (72)
CSS .avatar, .avatar--{size}
Badge
File shared.jsx
Variants success · warning · info · danger · primary · neutral
Prop dot (boolean)
Btn
File shared.jsx
Variants primary · outline · ghost · soft · destructive
Sizes xs · sm · (default) · lg
StatCard
File shared.jsx
CSS .stat, .stat__*
Props label, value, delta, deltaDir, icon, iconBg, iconColor
MiniChart / Bars / Donut
File shared.jsx
Type SVG inline
Usage dashboard cards chỉ
Page Title
21px / 700 / -0.015em
Section Title
16px / 700
Card Title
14px / 700
Field Value
13.5px / 500
Body / Table Cell
13px / 400
Form Label
12.5px / 500
Meta / Secondary
12px / muted
Field Label
11.5px / muted
Section Label
10px / 700 / uppercase