Table of Contents & Menu
On this page

No subsections

Navigation

Hyvä's Component Strategy: Why .phtml Templates?

Unlike other frameworks that build views from small, atomic components (like input fields or buttons), Hyvä leverages `.phtml` templates as its smallest components. This strategic choice offers several key benefits within the Magento ecosystem:

  • Each template file is a self-contained component that includes styles (thanks to Tailwind), JavaScript (thanks to Alpine), and HTML.
  • This allows swapping out UI components like banners, menus, footers, swatches and such on a template file level.
  • Template level components are better when making existing Magento extensions compatible with Hyvä.
  • More familiarity for Magento developers, which allows faster on-boarding.