@at-flux/astroflare
v1.0.3
Published
Reusable headless components, styles, and utilities for Astro + Tailwind v4 + Cloudflare projects
Downloads
555
Maintainers
Readme
@at-flux/astroflare
Reusable headless components, styles, and utilities for Astro + Tailwind v4 + Cloudflare projects.
For type-safe DOM helpers, use the separate package @at-flux/dom.
There is no @at-flux/astroflare/dom subpath (it is not published and must not be used). Add @at-flux/dom as its own dependency.
Package entrypoints
| Subpath | Contents |
|---------|----------|
| @at-flux/astroflare | Core — forms utilities (same as ./core) |
| @at-flux/astroflare/core | Forms; also exposes the forms namespace |
| @at-flux/astroflare/forms | Resend email + form HTML helpers |
| @at-flux/astroflare/components/* | Astro components (source) |
| @at-flux/astroflare/styles/* | CSS (source) |
Examples
// Flat imports from core
import { sendEmail } from '@at-flux/astroflare';
// Explicit subpaths
import { renderEmailTemplate } from '@at-flux/astroflare/forms';
// Namespaced (from core / root)
import { forms } from '@at-flux/astroflare/core';Contents
Components (Astro)
Modal.astro— Headless modal using native<dialog>and<app-modal>web component (classapplies to the panel)ModalTrigger.astro— Trigger that opens a modal by ID using<modal-trigger>web componentContactModalCta.astro— Opinionated contact button (solid pill or text link) wrapped inModalTriggerInstagramProfileLink.astro— Small Instagram icon +@handlelink with safe defaultsSection.astro— Page section with optionalnarrowandcontentOnly(inner width wrapper without outer padding)ThemeToggle.astro— Dark/light mode toggle using<theme-toggle>web componentClientRouterLoadingSpinner.astro— Loading spinner for Astro view transitions
Styles (CSS)
styles/prose.css— Markdown prose styling using CSS custom propertiesstyles/no-save.css— Image protection utilities (prevent right-click, drag, select)styles/accessibility.css— Focus styles, reduced motion, selection stylingstyles/scrollbar.css— Branded scrollbar styling
Usage
Local checkout without changing package.json or lockfile
Keep @at-flux/astroflare on a normal semver range in package.json and run pnpm install so the lockfile records the registry version. Then overlay the install with a symlink (only under node_modules):
pnpm exec astroflare-link-local link /absolute/or/relative/path/to/astroflare/packages/astroflare
# or
ASTROFLARE_LOCAL_PATH=../../ts-libs/astroflare/packages/astroflare pnpm exec astroflare-link-localUSE_LOCAL_ASTROFLARE=1(ortrue/yes) is supported only together withASTROFLARE_LOCAL_PATHorUSE_LOCAL_ASTROFLARE_PATH(path topackages/astroflare).unlinkremoves the overlay and runspnpm installagain sonode_modulesmatches the lockfile:
pnpm exec astroflare-link-local unlinkstatusshows whether an overlay is active.
Re-running pnpm install may replace the symlink with the store copy; run link again if that happens.
Local Import (file: protocol) — alternative
{
"dependencies": {
"@at-flux/astroflare": "file:../../ts-libs/astroflare/packages/astroflare"
}
}Components
---
import Modal from '@at-flux/astroflare/components/Modal.astro';
import ModalTrigger from '@at-flux/astroflare/components/ModalTrigger.astro';
---Styles
@import '@at-flux/astroflare/styles/prose.css';
@import '@at-flux/astroflare/styles/no-save.css';Testing
From repo root:
pnpm install
pnpm --filter @at-flux/astroflare testOr in packages/astroflare:
pnpm test