Use a more familiar syntax when rendering Alpine JS {variables}
๐
It's very easy to install Alpine JS plugins! ๐
<script
defer
src="https://unpkg.com/alpinejs-tash@latest/dist/tash.min.js"
></script>
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
npm i -D alpinejs-tash
yarn add -D alpinejs-tash
import Alpine from 'alpinejs'
import tash from 'alpinejs-tash'
Alpine.plugin(tash)
window.Alpine = Alpine
Alpine.start()
<div x-data="{ name: 'John Doe', age: 50, company: 'GitHub' }">
<p x-tash="name, age, company">
Hello, I am {name}! I am {age} years old and I currently work at {company}!
</p>
<!-- Hello, I am John Doe! I am 50 years old and I currently work at GitHub! -->
</div>
You don't have to use {variable}
as your syntax.
If you prefer Vue syntax use x-tash.vue
and you can write {{ variable }}
๐ธ
If you prefer Angular syntax use x-tash.angular
and you can write
{{variable}}
๐ฆ
By default it will use the {variable}
syntax that React, Svelte, Solid,
Astro... And many others use.
All variables you pass to x-tash
use Alpine JS reactivity!