@ark-ui/react/json-tree-view + Tailwind CSS v4

Ark JsonTreeView

Thành phần cây phân cấp JSON tương tác cho ChillCMS, được xây dựng dựa trên máy trạng thái chuẩn WAI-ARIA từ @ark-ui/react/json-tree-view kết hợp hệ thống kiểu dáng tô màu cú pháp (Syntax Highlighting) hiện đại của Tailwind CSS v4. Hỗ trợ mở rộng/thu gọn đệ quy, sao chép một chạm vào bộ nhớ tạm, chuyển đổi mã thô, nhóm mảng lớn và tùy biến linh hoạt từng giá trị hiển thị.

Tailwind CSS v4@ark-ui/react v5Syntax HighlightingWAI-ARIA TreeExpand / Collapse AllOne-Click CopyRaw Code ToggleCustom Value RenderCompound & Declarative API

Sử dụng Cơ bản (Declarative API)

Hiển thị hồ sơ người dùng với thanh công cụ đầy đủ: sao chép JSON, mở rộng/thu gọn toàn bộ, chuyển đổi mã thô và tùy chọn hiển thị ngoặc kép cho khóa.

Cơ bản
Dấu ngoặc kép khóa (quotes):
Độ sâu mở mặc định:
user-profile.json
object12 props(550 B)
{ id: "usr_89f02c4", username: "hanhcode", displayName: "Nguyễn Văn Hạnh", email: "hanh@chillcms.dev", avatarUrl: "https://images.unsplash.com/ph…", … }
"id": "usr_89f02c4"
"username": "hanhcode"
"displayName": "Nguyễn Văn Hạnh"
"email": "hanh@chillcms.dev"
"avatarUrl": "https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&w=120&q=80"
"isVerified": true
"role": "SUPER_ADMIN"
"lastLoginAt": "2026-10-09T08:30:15.000Z"
"loginCount": 342

Dữ liệu Đơn hàng Phức tạp (Complex Payload)

Hiển thị phản hồi webhook đơn hàng e-commerce nhiều cấp lồng nhau, kiểm thử tính năng tự động thu gọn các chuỗi văn bản dài (collapseStringsAfterLength).

E-Commerce
Thu gọn chuỗi dài (trên 35 ký tự như User-Agent hay địa chỉ):
webhook.order.created.json
object12 props(1.2 KB)
{ orderNumber: "ORD-2026-98102", status: "PAID", isGift: false, currency: "VND", subtotal: 1850000, … }
"orderNumber": "ORD-2026-98102"
"status": "PAID"
"isGift": false
"currency": "VND"
"subtotal": 1850000
"discount": 150000
"shippingFee": 30000
"totalAmount": 1730000
"customer": { name: "Trần Thị Mai", phone: "0987654321", email: "mai.tran@example.com", shippingAddress: Object }
"name": "Trần Thị Mai"
"phone": "0987654321"
"email": "mai.tran@example.com"
"items": (2) [ {…}, {…} ]
"length": 2
"payment": { provider: "STRIPE", transactionId: "txn_3MteH92eZvKYlo2C17p92x", paymentMethod: "credit_card", cardBrand: "visa", last4: "4242", … }
"provider": "STRIPE"
"transactionId": "txn_3MteH92eZvKYlo2C17p92x"
"paymentMethod": "credit_card"
"cardBrand": "visa"
"last4": "4242"
"isCaptured": true
"capturedAt": "2026-10-09T07:45:20Z"
"metadata": { campaign: "autumn_sale_2026", clientIp: "118.69.182.45", userAgent: "Mozilla/5.0 (Windows NT 10.0; …", processedByQueueWorker: "worker-node-03" }
"campaign": "autumn_sale_2026"
"clientIp": "118.69.182.45"
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/131.0"
"processedByQueueWorker": "worker-node-03"

Tùy biến Giá trị Hiển thị (renderValue)

Sử dụng hàm renderValue để tự động biến các liên kết URL thành hyperlink có thể nhấp chuột, xem trước ảnh thumbnail và định dạng trạng thái boolean trực quan.

Tùy biến
💡 renderValue cho phép biến chuỗi URL thành liên kết bấm được kèm ảnh preview, biến boolean thành badge màu trực quan!
service-config.json
object9 props(447 B)
{ serviceName: "chillcms-auth-service", version: "3.1.0", isOnline: true, maintenanceMode: false, documentationUrl: "https://chillcms.dev/docs", … }
"serviceName": "chillcms-auth-service"
"version": "3.1.0"
"isOnline": TRUE
"maintenanceMode": FALSE
"documentationUrl": "https://chillcms.dev/docs"
"endpoints": (2) [ "https://api.chillcms.dev/v1/auth/login", "https://api.chillcms.dev/v1/auth/refresh" ]
"supportEmail": "contact@chillcms.dev"

Kích thước và Biến thể (Sizes & Variants)

Lựa chọn linh hoạt giữa 3 kích thước (sm, md, lg) và 4 kiểu biến thể nền (outline, surface, card, plain) để phù hợp với từng ngữ cảnh giao diện.

Giao diện
Kích thước (size):
Biến thể (variant):
system-metrics.json
object9 props(422 B)
{ service: "chillcms-api-cluster", version: "2.8.4", environment: "production", healthy: true, uptimeSeconds: 846291, … }
"service": "chillcms-api-cluster"
"version": "2.8.4"
"environment": "production"
"healthy": true
"uptimeSeconds": 846291

Compound Components API

Sử dụng trực tiếp các thành phần con: ArkJsonTreeView.RootProvider, Toolbar, Tree kết hợp hook useJsonTreeView để làm chủ hoàn toàn giao diện và luồng điều khiển.

Nâng cao
Sử dụng trực tiếp các subcomponents: ArkJsonTreeView.RootProvider, ArkJsonTreeView.Toolbar, ArkJsonTreeView.Tree kết hợp hook useJsonTreeView để kiểm soát hoàn toàn markup và trạng thái cây.
app-config.jsonCompound API
object3 props(300 B)
{ application: "ChillCMS Headless Engine", features: Object, cluster: Object }
application: "ChillCMS Headless Engine"
features: { authentication: Object, storage: Object }
cluster: { region: "ap-southeast-1", zone: "sg-zone-b", activeNodes: 6 }
region: "ap-southeast-1"
zone: "sg-zone-b"
activeNodes: 6

Sân chơi Thử nghiệm Trực tiếp (Live Playground)

Nhập hoặc dán bất kỳ dữ liệu JSON nào vào khung soạn thảo để kiểm tra tính hợp lệ và xem cây phân cấp hiển thị tức thì theo thời gian thực.

Tương tác
Dữ liệu mẫu:
Dán hoặc gõ chuỗi JSON vào đây:Hợp lệ
Kết quả hiển thị cây tương tác:
live-preview.json
object1 props(233 B)
{ product: Object }
"product": { id: "p_8410", name: "Chill Keyboard Pro", price: 2490000, currency: "VND", specs: Object, … }
"id": "p_8410"
"name": "Chill Keyboard Pro"
"price": 2490000
"currency": "VND"
"inStock": true
© 2026. FlatVn All rights reserved. Version 4.4.2