United Kingdomx-govuk/govuk-components
Lightweight Ruby on Rails components for developing with the GOV.UK Design System.
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository Của Tháng
#1 Repository Của Tháng
#1 Repository Của Tháng
🇬🇧 Gem Rails triển khai toàn bộ GOV.UK Design System dưới dạng ViewComponent
Lightweight alternative to GOV.UK Publishing Components — blocks over HTML strings, every component is a Ruby object.
gx-govuk/govuk-components là gem Ruby on Rails cung cấp bộ component tái sử dụng đầy đủ cho GOV.UK Design System. Dự án nhắm đến việc thay thế thư viện GOV.UK Publishing Components nặng nề hơn bằng một giải pháp nhẹ, xây dựng trên framework ViewComponent của GitHub.
Thay vì truyền chuỗi HTML, mỗi component sử dụng khối (blocks) — bên trong, mỗi component đơn thuần là một đối tượng Ruby, có thể kế thừa và ghi đè. Cách tiếp cận này giúp lập trình viên Rails làm việc với component một cách tự nhiên hơn so với các macro Nunjucks gốc.
✨ Điểm nổi bật
- 21 component không phải form: Accordion, Breadcrumbs, Cookie banner, Details, Footer, Header, Notification banner, Panel, Pagination, Tabs, Tables, Tags, Task list, Warning text và nhiều hơn nữa
- Hỗ trợ hai cách render: dùng trực tiếp Rails
#renderhoặc qua helper wrappergovuk_*(ví dụ:govuk_tabs,govuk_warning_text) - Blocks thay vì HTML string: mỗi component là một Ruby object, có thể kế thừa và ghi đè
- GOV.UK Design System 6.2.0: tương thích phiên bản mới nhất của hệ thống thiết kế chính phủ Anh
- ViewComponent 4.6.0: tận dụng framework component chính thức của GitHub
- Hỗ trợ Rails 7.2.2, 8.0.2, 8.1.0 và Ruby 3.3.11, 4.0.2
- Guide đầy đủ: tài liệu trực tuyến với code và output examples, luôn cập nhật vì chính trang guide được build bằng các component này
- Helper riêng cho link, button, skip link, back-to-top link
- Form components tách riêng: handled by GOV.UK Form Builder
💡 Vì sao đáng chú ý
Thay vì nhúng HTML cứng trong view, dự án đưa toàn bộ component GOV.UK Design System vào hệ sinh thái Rails dưới dạng Ruby object thuần túy. Mỗi component có thể tùy chỉnh, ghi đè, và kế thừa — phù hợp cho các dự án cần tuân thủ nghiêm ngặt chuẩn giao diện GOV.UK mà không muốn kéo theo toàn bộ thư viện govuk_publishing_components.
Dự án đang được sử dụng thực tế bởi các dịch vụ chính phủ Anh như Apply for teacher training và Find postgraduate teacher training. Nếu bạn đang xây dựng ứng dụng Rails cần giao diện tuân thủ GOV.UK Design System, đây là lựa chọn nhẹ hơn và sát với cách tư duy của lập trình viên Rails so với các giải pháp thay thế.
#Ruby #Rails #ViewComponent #GOVUK #DesignSystem #TiniX
Similar Projects
Discover other similar projects and AI models.
Write documentation using Markdown and publish it using GOV.UK styles.
Composable, accessible components with thoughtful defaults. Build your own component library with code you can customize, extend, and make your own.
all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...
Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.