Coder Social home page Coder Social logo

rawilk / alpine-ripple Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 0.0 1.87 MB

Ripple effect (materialize) for Alpine.js.

Home Page: https://randallwilk.dev/docs/alpine-ripple

License: MIT License

CSS 7.90% JavaScript 91.83% Shell 0.27%
alpinejs ripple-effect

alpine-ripple's Introduction

โœจ Help support the maintenance of this package by sponsoring me.

alpine-ripple

GitHub tag (latest by date) Npm downloads GitHub stars

social image

alpine-ripple is a simple Alpine.js plugin that adds a ripple effect to any element with an alpine directive x-ripple.

Requirements

  • Alpine.js v3.x
  • Tailwind CSS (only required if you want to use custom color classes on the directive)

Installation

CDN

Include the following <script> and <link> tags in the <head> of your document, just before Alpine.

<link
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/npm/@wilkr/[email protected]/dist/alpine-ripple.css"
/>
<script
    src="https://cdn.jsdelivr.net/npm/@wilkr/[email protected]/dist/alpine-ripple.min.js"
    defer
></script>

NPM

npm i -S @wilkr/alpine-ripple

Add the x-ripple directive to your project by importing the package.

import Alpine from "alpinejs";
import Ripple from "@wilkr/alpine-ripple";

Alpine.plugin(Ripple);

window.Alpine = Alpine;
window.Alpine.start();

Import the package styles into your css.

@import "@wilkr/alpine-ripple/dist/alpine-ripple.css";

Usage

Add the x-ripple directive to any element, which in most cases will be a <button>.

<button x-data x-ripple>Click me</button>

This will result in a ripple effect when the button is clicked. By default, the ripple will be white, but this can be changed globally or on a per-element basis.

Documentation

More documentation can be found here: https://randallwilk.dev/docs/alpine-ripple

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

alpine-ripple is heavily inspired from:

License

The MIT License (MIT). Please see License File for more information.

alpine-ripple's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar rawilk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.