Socket
Book a DemoInstallSign in
Socket

astro-htmx

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-htmx

This **[Astro integration](https://astro.build/integrations/)** adds [HTMX.org](https://htmx.org) to your project so that you can use HTMX.org anywhere on your page.

1.0.6
latest
Source
npmnpm
Version published
Weekly downloads
980
25.16%
Maintainers
1
Weekly downloads
 
Created
Source

astro-htmx

This Astro integration adds HTMX.org to your project so that you can use HTMX.org anywhere on your page.

Installation

Manual Install

First, install the astro-htmx package using your package manager. If you're using npm or aren't sure, run this in the terminal:

npm install astro-htmx htmx.org

Then, apply this integration to your astro.config.* file using the integrations property:

  // astro.config.mjs
  import { defineConfig } from 'astro/config';
+ import htmx from 'astro-htmx';

  export default defineConfig({
    // ...
    integrations: [htmx()],
    //             ^^^^^^^^
  });

Usage

Once the integration is installed, you can use HTMX.org directives and syntax inside any Astro component. The HTMX.org script is automatically added and enabled on every page of your website.

Check Astro Integration Documentation for more on integrations.

Limitations

The HTMX.org integration does not give you control over how the script is loaded or initialized. If you require this control, consider installing and using HTMX.org manually. Astro supports all officially documented HTMX.org manual setup instructions, using <script> tags inside of an Astro component.

---
// src/pages/index.astro
---

<!-- Example: Load HTMX on a single page. -->
<script>
  import "htmx.org";
</script>

Configuration

The HTMX.org integration does not support any custom configuration at this time.

Examples

Contributing

This package is maintained by xstevenyung. You're welcome to submit an issue or PR!

Keywords

astro

FAQs

Package last updated on 27 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.