Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Ripple Button

    Button that sends a ripple out from the click point, or from the center when pressed with the keyboard.

    <div class="flex flex-wrap items-center justify-center gap-3">
        <x-markas.ripple-button>Add to cart</x-markas.ripple-button>
        <x-markas.ripple-button variant="secondary">Save for later</x-markas.ripple-button>
    </div>
    import { RippleButton } from "@/components/markas/RippleButton";
    
    export default function RippleButtonExample() {
      return (
        <div className="flex flex-wrap items-center justify-center gap-3">
          <RippleButton>Add to cart</RippleButton>
          <RippleButton variant="secondary">Save for later</RippleButton>
        </div>
      );
    }
    <script setup lang="ts">
    import RippleButton from "@/components/markas/RippleButton.vue";
    </script>
    
    <template>
      <div class="flex flex-wrap items-center justify-center gap-3">
        <RippleButton>Add to cart</RippleButton>
        <RippleButton variant="secondary">Save for later</RippleButton>
      </div>
    </template>
    <script lang="ts">
      import RippleButton from "$lib/components/markas/RippleButton.svelte";
    </script>
    
    <div class="flex flex-wrap items-center justify-center gap-3">
      <RippleButton>Add to cart</RippleButton>
      <RippleButton variant="secondary">Save for later</RippleButton>
    </div>
    ---
    import RippleButton from "@/components/markas/RippleButton.astro";
    ---
    
    <div class="flex flex-wrap items-center justify-center gap-3">
      <RippleButton>Add to cart</RippleButton>
      <RippleButton variant="secondary">Save for later</RippleButton>
    </div>
    import { Component } from "@angular/core";
    import { RippleButton } from "./markas/ripple-button.component";
    
    @Component({
      selector: "markas-example",
      imports: [RippleButton],
      template: `
        <div class="flex flex-wrap items-center justify-center gap-3">
          <button markas-ripple-button>Add to cart</button>
          <button markas-ripple-button variant="secondary">Save for later</button>
        </div>
      `,
    })
    export default class RippleButtonExample {}

    Examples

    Variants

    Sizes

    Newsletter form

    Get the changelog

    One email a month with new components. No spam.

    Get the changelog

    One email a month with new components. No spam.

    Get the changelog

    One email a month with new components. No spam.

    Get the changelog

    One email a month with new components. No spam.

    Get the changelog

    One email a month with new components. No spam.

    Installation

    npx markasui@latest add ripple-button

    Usage

    <x-markas.ripple-button>Add to cart</x-markas.ripple-button>
    <x-markas.ripple-button variant="secondary" type="submit">Subscribe</x-markas.ripple-button>
    import { RippleButton } from "@/components/markas/RippleButton";
    
    <RippleButton onClick={addToCart}>Add to cart</RippleButton>
    <RippleButton variant="secondary" type="submit">Subscribe</RippleButton>
    <script setup lang="ts">
    import RippleButton from "@/components/markas/RippleButton.vue";
    </script>
    
    <template>
      <RippleButton @click="addToCart">Add to cart</RippleButton>
      <RippleButton variant="secondary" type="submit">Subscribe</RippleButton>
    </template>
    <script lang="ts">
      import RippleButton from "$lib/components/markas/RippleButton.svelte";
    </script>
    
    <RippleButton onclick={addToCart}>Add to cart</RippleButton>
    <RippleButton variant="secondary" type="submit">Subscribe</RippleButton>
    ---
    import RippleButton from "@/components/markas/RippleButton.astro";
    ---
    
    <RippleButton>Add to cart</RippleButton>
    <RippleButton variant="secondary" type="submit">Subscribe</RippleButton>
    import { Component } from "@angular/core";
    import { RippleButton } from "./markas/ripple-button.component";
    
    @Component({
      selector: "app-cart",
      imports: [RippleButton],
      template: `
        <button markas-ripple-button (click)="addToCart()">Add to cart</button>
        <button markas-ripple-button variant="secondary" type="submit">
          Subscribe
        </button>
      `,
    })
    export class Cart {
      addToCart() {}
    }

    Angular uses an attribute selector on the native button, so disabled, aria-*, and class stay on the button.

    • A mouse or touch click starts the ripple at the pointer. Enter and Space start it from the center.
    • The ripple uses the text color at low opacity, so every variant gets a matching wave.
    • Blade needs Alpine.js.

    Props

    NameTypeDefaultDescription
    variant'primary' | 'secondary' | 'ghost' | 'danger'primaryVisual style, the same set as Button.
    size'sm' | 'md' | 'lg'mdHeight 32, 40, or 48px, the same as Button.
    type'button' | 'submit' | 'reset'buttonNative type attribute.

    Accessibility

    • A native button element, so Enter and Space work and focus shows a 2px primary outline.
    • Ripples live in an aria-hidden layer and are removed when they finish.
    • With prefers-reduced-motion no ripple is drawn, the click still works.

    Related components

    More buttons components with the same classes in every framework.