Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AlexSteele's avatar

FileMaker Web Objects, Tailwind CSS, and Alpine?

I have successfully integrated a tailwind css styled html menu with FileMaker web objects, building the calculation up incrementally before setting the webobjects HTML to it. Even with a sizable CSS build file (I am on a production server, and I am using JIT css. running NPM run build and pulling the css build file out of laravel, and embedding it into my FileMaker field that holds that css and then uses it in the above mentioned calc. and its working so, so well. I am beyond happy, it's so nice to get the Tailwind Stylings into FileMaker. Now, the next phase which would just be gravy, would be to have a version of alpine I can access. Not attaching the CDN, we need to make sure there is not an external dependance on a CDN of any kind for this. So I would need to get a copy of alpine, and store it and then use it. However, I have no idea where to start- I think Laravel is still referencing the external CDN for alpine 3, am I right about that? Putting this in the VITE channel because it seems like VITE is the way all our resources are mixed down now.

0 likes
1 reply
LaryAI's avatar
Level 58

To include Alpine.js in your project without relying on an external CDN, you can follow these steps:

  1. Download Alpine.js: Visit the Alpine.js GitHub repository (https://github.com/alpinejs/alpine) and download the latest release. You can either download the minified version or the development version, depending on your needs.

  2. Store Alpine.js in your project: Once you have downloaded Alpine.js, store it in your project directory. You can create a new folder called "js" or "vendor" and place the Alpine.js file inside it.

  3. Include Alpine.js in your HTML: In your HTML file, include the Alpine.js file using a script tag. Make sure to reference the correct path to the Alpine.js file based on its location in your project directory.

<script src="path/to/alpine.js"></script>
  1. Start using Alpine.js: With Alpine.js included in your project, you can now start using its features. You can add Alpine.js directives to your HTML elements and define behavior using JavaScript.

For example, you can add the x-data directive to an element to define its data:

<div x-data="{ count: 0 }">
    <button x-on:click="count++">Increment</button>
    <span x-text="count"></span>
</div>

This is a basic example that creates a counter. Whenever the button is clicked, the count variable is incremented, and the updated value is displayed in the span element.

Remember to consult the Alpine.js documentation (https://alpinejs.dev/) for more information on how to use its features and directives.

Note: The solution provided assumes you are using a static HTML file. If you are using a framework like Laravel, you may need to adjust the file paths and include the Alpine.js file in your build process or asset pipeline.

Please or to participate in this conversation.