Developer Resources

Mastering Hyvä UI Components

Stop reinventing the wheel. Learn how the official Hyva UI Library accelerates development by 50% with accessible, copy-paste Tailwind components.

One of the most powerful aspects of the Hyva Theme for Magento is not just the theme itself, but the tooling that surrounds it. Chief among these tools is the Hyvä UI Library: a free, open-source collection of pre-built components designed specifically for Magento 2 stores running Hyvä.

In this guide, we explore how to leverage Hyvä UI to build beautiful, accessible stores in record time.

What is Hyvä UI?

Hyvä UI is essentially a component library, similar to Tailwind UI or Flowbite, but tailored for Magento. It provides ready-to-use snippets for common e-commerce elements like:

  • Headers and Mega Menus
  • Product Cards & Listings
  • Cart Drawers & Minicarts
  • Footers
  • Checkout Steps

The philosophy is "Copy, Paste, Adapt." You don't install a heavy npm package. You simply browse the library, copy the code relative to the component you need, paste it into your `.phtml` file, and customize the Tailwind classes to match your brand.

Accessibility Built-In (a11y)

Building accessible web components is hard. Managing focus traps in modals, ensuring keyboard navigation works in menus, and providing correct ARIA labels requires deep knowledge of WCAG standards.

The Hyvä team has done the heavy lifting for you. All components in the Hyvä UI library are rigorously tested for accessibility.

  • Modals: Automatically trap focus and close on Escape key.
  • Sliders: Fully keyboard navigable.
  • Forms: Proper error states and label associations.

By using these components, you ensure your Magento Hyva Theme is usable by everyone, protecting you from potential lawsuits and improving SEO.

The Integration Workflow

How do you actually use it? Here is a typical workflow for a developer:

Step 1: Browse

Go to the Hyvä UI docs and find a component that fits your need, for example, a "Hero Section with Video."

Step 2: Copy

Click the "Source" tab. You will see clean HTML mixed with Alpine.js logic and Tailwind classes. Copy it.

Step 3: Paste & Connect

Paste the code into your Magento `.phtml` template (e.g., `cms_page_view.phtml`). Since Hyvä uses standard Magento view models, you can easily inject dynamic data (like product names or prices) into the HTML structure using PHP.

Step 4: Customize

Because it's just Tailwind, you can instantly change colors, spacing, or typography by editing the classes. `bg-blue-500` becomes `bg-brand-primary`. No compilation needed if you are running the Tailwind JIT watcher.

Must-Have Components

Here are a few standout components that save days of development time:

The Mega Menu

Building a responsive, accessible mega menu is notoriously difficult. Hyvä UI offers several variations (slide-out, dropdown, full-width) that work perfectly on mobile and desktop out of the box.

Product Sliders (Splide.js)

While Hyvä avoids heavy libraries, it natively supports Splide.js (lightweight) for carousels. The UI library includes pre-configured product sliders that hook into Magento's product collection data.

Start Building Faster Today

The Hyva Theme for Magento ecosystem is designed to make developers efficient. Hyvä UI is the force multiplier that turns a blank canvas into a finished store in weeks, not months. By reusing verified, accessible code, you reduce bugs and focus on what matters: the unique brand experience.

Need a Custom Component?

Our team contributes to the Hyvä UI library and builds custom components for enterprise clients.

Get Development Help
M

Meetanshi Team

We are a team of certified Magento developers passionate about performance and Hyvä. We help merchants build faster, more profitable stores.