Enhancement: Add Alpine.js Integration — demo page section and usage guide

Aperta
#49 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hiranya25 ci sta già lavorando.

Dal 16/6/2026.

  • #154 di @hiranya25 — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

planned

🎯 Direction

SocialShareButton is a lightweight, zero-dependency, framework-agnostic social sharing component. Alpine.js is a minimal JavaScript framework used for behavior-sprinkling in server-rendered pages (e.g., Laravel Blade, Django templates, Rails ERB) — it shares the zero-dependency, no-build-step philosophy perfectly. No separate wrapper file is needed; integration is achieved purely through Alpine's x-init and x-data directives in HTML.

📹 See the button in action: https://youtu.be/cLJaT-8rEvQ?si=CLipA0Db4WL0EqKM


📁 Files to Create / Modify

ℹ️ No New Wrapper File Needed

Alpine.js integrates directly in HTML via CDN — no separate .js wrapper component is required. The integration snippet is self-contained.


✅ Existing File: index.html — Add Alpine.js Integration Section

Add a new section with:

  • Section heading: 🏔️ Alpine.js Integration
  • Step 1: Include SocialShareButton CSS and JS via CDN
  • Step 2: Include Alpine.js via CDN
  • Step 3: Initialize via x-data and x-init directives

Example code snippet to display:

<!-- Include dependencies -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share-button/dist/social-share-button.css">
<script src="https://cdn.jsdelivr.net/npm/social-share-button/dist/social-share-button.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>

<!-- Usage -->
<div
  x-data="{ shareBtn: null }"
  x-init="shareBtn = new SocialShareButton({
    container: $el,
    url: 'https://your-website.com',
    title: 'Check this out!',
    description: 'An amazing website',
    theme: 'dark',
    buttonText: 'Share'
  })"
  x-destroy="shareBtn && shareBtn.destroy()"
></div>

✅ Acceptance Criteria

  • No new wrapper file required — integration is HTML-only via CDN
  • index.html updated with an Alpine.js section containing install + usage code snippets
  • Copy-to-clipboard button present on new code blocks in index.html
  • README updated to list Alpine.js as a supported integration pattern

⚠️ Planned — Not Final
This issue represents a planned enhancement and is not guaranteed to be implemented. It may be dropped if it does not align with the repository's direction. Before opening a pull request, please discuss with the maintainers in this issue thread.

Lingua principale
TypeScript
Stelle
29
Fork
74
Merge medio
8h 52m
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/SocialShareButton

Tutte le issue di AOSSIE-Org/SocialShareButton

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.