<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu" -->

---
title: Why I use Alpine.js | daily.dev
description: Alpine.js is a library that adds JavaScript interactivity to HTML pages, simplifying certain tasks such as closing modals and showing/hiding menus. It is a...
canonical: https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Why I use Alpine.js | daily.dev
og:description: Alpine.js is a library that adds JavaScript interactivity to HTML pages, simplifying certain tasks such as closing modals and showing/hiding menus. It is a...
og:url: https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu
og:image: https://api.daily.dev/og/posts/XXQMVETLU.png
og:image:alt: Why I use Alpine.js
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why I use Alpine.js

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 3 min read · 20 upvotes · 4 comments

## Summary

Alpine.js is a library that adds JavaScript interactivity to HTML pages, simplifying certain tasks such as closing modals and showing/hiding menus. It is a great fit for server-side HTML generation and client-server interactions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/why-i-use-alpinejs>

## Community discussion

Top comments from developers on daily.dev.

**@ryderelb** · 0 upvotes

> I do love using Alpine for little bits and pieces - definitely makes little features easy to implement.
>
> There are also some pretty handy plugins too - if you ever need masking for input fields, scroll observers or smoothly collapsing boxes!

**@axidguy** · 0 upvotes

> alpine.js made me love react and never go back.

**@jacques146** · 0 upvotes

> Good preparation for HTMX: https://htmx.org/

**@ghost** · 0 upvotes

> You don't need js for darkmode. My eyes are burning!

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#frontend](https://daily.dev/tags/frontend)

[View this post on daily.dev](https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Why I use Alpine.js","url":"https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu"},"datePublished":"2024-01-15T16:02:48.821Z","dateModified":"2024-01-15T16:02:48.245Z","description":"Alpine.js is a library that adds JavaScript interactivity to HTML pages, simplifying certain tasks such as closing modals and showing/hiding menus. It is a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7c87a122721eba666b7933247636e7c7?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7c87a122721eba666b7933247636e7c7?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":4,"discussionUrl":"https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":20},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"keywords":"webdev,javascript,frontend","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"Why I use Alpine.js"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/why-i-use-alpine-js-xxqmvetlu","comment":[{"@type":"Comment","text":"I do love using Alpine for little bits and pieces - definitely makes little features easy to implement.\nThere are also some pretty handy plugins too - if you ever need masking for input fields, scroll observers or smoothly collapsing boxes!","datePublished":"2024-01-23T00:39:43.100Z","url":"https://daily.dev/posts/XXQMVETLU#c-3EgfPyWIg","author":{"@type":"Person","name":"Ryder","url":"https://daily.dev/ryderelb","image":"https://avatars.githubusercontent.com/u/110982520?v=4"}},{"@type":"Comment","text":"alpine.js made me love react and never go back.","datePublished":"2024-01-23T09:02:06.898Z","url":"https://daily.dev/posts/XXQMVETLU#c-OzgjiyDj7","author":{"@type":"Person","name":"Nicolas Felipe","url":"https://daily.dev/axidguy","image":"https://lh3.googleusercontent.com/a/AGNmyxYyfEiBy9ZZpegXa0d1Rb1YpgvrYT0OCYYnAW-mRw=s96-c"}},{"@type":"Comment","text":"Good preparation for HTMX: https://htmx.org/","datePublished":"2024-01-23T09:12:04.524Z","url":"https://daily.dev/posts/XXQMVETLU#c-c5ZfLeEBW","author":{"@type":"Person","name":"Jacques Gudath Uys","url":"https://daily.dev/jacques146","image":"https://avatars.githubusercontent.com/u/4271380?v=4"}},{"@type":"Comment","text":"You don’t need js for darkmode. My eyes are burning!","datePublished":"2024-01-23T06:37:22.460Z","url":"https://daily.dev/posts/XXQMVETLU#c-07kod1wpO","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"}}]}
```

