Free Online Alpine.js Playground
Write Alpine.js markup and see it react live, with everything you log shown in a console beside the preview. Edit the HTML, script and CSS in separate tabs.
Press Run, or Ctrl or Cmd + Enter, to run your code. The page shows in Preview and everything you log shows in Console. Use Stop if a script never ends. Alpine.js 3 is loaded for you: add x-data, x-text, @click and the other attributes in the HTML tab.
Preview
Console
Output appears here. Press Run, then try console.log("Hello")
How to use
Write your markup in the HTML tab and put x-data on the element that wraps your component.
Add Alpine's attributes, such as x-text, x-show, x-model, x-for and @click, to make the page respond.
Register reusable components with Alpine.data in the JavaScript tab, and style everything in the CSS tab.
Press Run, or Ctrl or Cmd + Enter. Turn on Auto-run to refresh the preview as you type.
Read console.log output, warnings and errors in the Console panel under the preview.
Use Format to tidy the tab you are editing, or open the full screen editor for more room.
Why use this tool
Alpine.js 3, ready to go
The current Alpine 3 is loaded for you, with its directives, magic properties and transitions.
Separate HTML, JavaScript and CSS
Keep markup, logic and styles apart, just like on a real page.
Built-in console
Output from console.log, plus warnings and errors, appears beside the preview.
Isolated preview
Your code runs in an isolated frame, so it cannot reach this site or your other tabs.
Comfortable editor
Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.
About this tool
Try Alpine.js 3 without setting up a project. This online Alpine.js playground gives you separate HTML, JavaScript and CSS tabs and a live preview, so you can test x-data, x-show, x-model, x-for and @click as you write them. Build a dropdown, a set of tabs or a modal, check a snippet before it goes into your site, or learn how Alpine's reactivity works. Press Run and the preview updates, with every console message shown beside it.
Frequently asked questions
Alpine.js 3, loaded from a public CDN and verified with an integrity check.
Only Alpine itself is loaded. To try a plugin, add a script tag for it in the HTML tab, using a public https address that the browser allows.
Check that the element has x-data, that you pressed Run, and that your expressions are valid. Errors appear in the console.
Yes, the first time you press Run, because Alpine.js is fetched from a public CDN.
Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.