Skip to content
hyva-themes avatar

Hyva Alpine Component

Constructor-driven Alpine.js components for Hyvä Magento themes, written to work under strict CSP with no unsafe-eval.

CCM score
69 of 100
skills.sh installs
1.4K
GitHub stars
86
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the Alpine CSP constraints table, component structure, constructor registration, property access, mutations, and x-for patterns
  • Includes x-model replacements for text, number, textarea, checkbox, and select inputs, plus the hyva utility functions
  • Enforces Alpine.data() registration inside alpine:init with {once: true} and $hyvaCsp->registerInlineScript() after every script block
  • Designed for Magento 2 developers building Hyvä templates on payment pages subject to PCI-DSS 4.0 CSP rules

Install

$ npx -y skills add hyva-themes/hyva-ai-tools --skill hyva-alpine-component -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Hyvä Alpine Component

Overview

This skill provides guidance for writing CSP-compatible Alpine.js components in Hyvä themes. Alpine CSP is a specialized Alpine.js build that operates without the unsafe-eval CSP directive, which is required for PCI-DSS 4.0 compliance on payment-related pages (mandatory from April 1, 2025).

Key principle: CSP-compatible code functions in both standard and Alpine CSP builds. Write all Alpine code using CSP patterns for future-proofing.

CSP Constraints Summary

CapabilityStandard AlpineAlpine CSP
Property readsx-show="open"Same
Negationx-show="!open"Method: x-show="isNotOpen"
Mutations@click="open = false"Method: @click="close"
Method args@click="setTab('info')"Dataset: @click="setTab" data-tab="info"
x-modelAvailableNot supported - use :value + @input
Range iterationx-for="i in 10"Not supported

Component Structure Pattern

Every Alpine component in Hyvä follows this structure:

Details

Repository
github.com/hyva-themes/hyva-ai-tools
Categories
Frontend & UI Code, PHP & Laravel
First seen
Jun 3, 2026

More from hyva-themes/hyva-ai-tools

All 12

Similar to Hyva Alpine Component

More Frontend & UI Code