Get Started
Start developing a Hugo theme with the Keystone UI.
Introduction
Keystone UI brings the component architecture of Shadcn UI (Opens in a new tab) to the Hugo ecosystem.
It is not a rigid library or a black-box dependency. Instead, Keystone is a collection of accessible components designed to be copied into your project and customized to fit your needs. You own the code.
We built Keystone to be the foundation for high-quality Hugo themes, adhering strictly to three core pillars:
- Accessibility: Components are implemented to meet WCAG 2.2 standards.
- Security: All logic is compatible with strict Content Security Policies (CSP).
- Performance: A zero-bloat architecture and no negative impact on Core Web Vitals.
Installation
The frictionless path to start developing with Keystone UI is using our starter template.
- Press the Use this template button on GitHub (Opens in a new tab) to setup a new repository.
- Clone it locally.
- Run
npm install.
Alternatively, if you prefer not to use GitHub templates, run:
If you are integrating Keystone into an existing Hugo project, follow these steps to set up Tailwind and the Alpine.js library.
1. CSS & Tailwind Setup
Keystone uses a CSS variable theme system compatible and based upon Shadcn UI.
Install Tailwind
Follow the official Hugo Tailwind Documentation (Opens in a new tab) to set up the cli.
Define Base Variables
Create a base CSS file to define your theme color palette (Default: neutral).
Configure Main CSS
Replace your default assets/main.css with the following.
2. JavaScript & Alpine setup
Keystone uses Alpine.js (CSP build) for interactivity.
Install Dependencies
Create entry point
Create the main JavaScript entry file.
Create Hugo Bundle Pipeline
Create a partial to build and fingerprint the JavaScript.
Inject into Head
Finally, include the partial in your site’s <head> tag.