How to Add PrimeVue to Jekyll
Adding Vue.js to Jekyll opens up interactive possibilities, but what if you want more than basic components? PrimeVue is a comprehensive UI component library that brings professional, pre-built components to your Vue applications. Think datepickers, galleries, data tables, and complex forms—all ready to use.
In this guide, we’ll integrate PrimeVue with Jekyll to demonstrate how you can build rich user interfaces directly in your blog posts without complex build tooling. If you’re looking to add professional UI components to your Jekyll site, this is how you do it.
Back to the HACKS!
What is PrimeVue?
PrimeVue is an open-source UI component library for Vue 3 that provides:
- 80+ Ready-to-Use Components - Everything from simple buttons to complex data tables
- Professional Theming - Pre-built themes including Aura, Material, Bootstrap, and more
- Accessibility - WCAG compliant components with proper ARIA support
- Responsive Design - Components that work seamlessly across devices
- No Build Step Required - Can be loaded via CDN for simple integrations
Unlike building custom Vue components from scratch, PrimeVue gives you production-ready UI elements that look professional out of the box.
Setting Up PrimeVue in Jekyll
Just like with vanilla Vue.js, we can load PrimeVue via CDN without any build tools. Here’s what we need:
Required Dependencies
Add these to the top of your Jekyll post (inside the Markdown file). Here’s what each does:
- PrimeIcons CSS - Icon library used by PrimeVue components
- PrimeFlex CSS - Optional utility CSS framework for layouts (similar to Tailwind)
- Vue 3 - The core Vue.js framework
- PrimeVue UMD - The PrimeVue component library
- Aura Theme - PrimeVue’s modern, clean theme
The Integration Pattern
The key to using PrimeVue in Jekyll is understanding the three-step process:
- Create the Vue app - Initialize Vue with
createApp() - Configure PrimeVue - Register PrimeVue with theme settings using
app.use() - Register components - Import only the components you need with
app.component()
This selective component registration keeps your page lean—you’re not loading the entire library, just what you use.
Example 1: DatePicker Component
Let’s start with a simple interactive datepicker:
Select a Date:
Selected Date: {{ date }}