Skip to content

cie/alpine-webcomponent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alpine Web Component

This is very alpha. You can define your web components in a declarative and Alpine way.

<script src="https://cdn.jsdelivr.net/gh/cie/[email protected]/dist/alpine-webcomponent.js" defer></script>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>

<template x-webcomponent="my-card">
  <section>
    <slot/>
  </section>
  <style>
    section {
      padding: 10px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.5);
      border-radius: 10px;
    }
  </style>
</template>

<my-card>
  Hello
</my-card>

About

Define custom elements in Alpine.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published