Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Shimmer Button

    Button with a soft sheen that sweeps across it on a loop. The loop pauses off screen and stops with reduced motion.

    <div class="flex justify-center">
        <x-markas.shimmer-button size="lg">Get started for free</x-markas.shimmer-button>
    </div>
    import { ShimmerButton } from "@/components/markas/ShimmerButton";
    
    export default function ShimmerButtonExample() {
      return (
        <div className="flex justify-center">
          <ShimmerButton size="lg">Get started for free</ShimmerButton>
        </div>
      );
    }
    <script setup lang="ts">
    import ShimmerButton from "@/components/markas/ShimmerButton.vue";
    </script>
    
    <template>
      <div class="flex justify-center">
        <ShimmerButton size="lg">Get started for free</ShimmerButton>
      </div>
    </template>
    <script lang="ts">
      import ShimmerButton from "$lib/components/markas/ShimmerButton.svelte";
    </script>
    
    <div class="flex justify-center">
      <ShimmerButton size="lg">Get started for free</ShimmerButton>
    </div>
    ---
    import ShimmerButton from "@/components/markas/ShimmerButton.astro";
    ---
    
    <div class="flex justify-center">
      <ShimmerButton size="lg">Get started for free</ShimmerButton>
    </div>
    import { Component } from "@angular/core";
    import { ShimmerButton } from "./markas/shimmer-button.component";
    
    @Component({
      selector: "markas-example",
      imports: [ShimmerButton],
      template: `
        <div class="flex justify-center">
          <button markas-shimmer-button size="lg">Get started for free</button>
        </div>
      `,
    })
    export default class ShimmerButtonExample {}

    Examples

    Variants

    Hero call to action

    Version 2.0 is out

    Ship your dashboard this week

    Copy the components you need. Own every line of code.

    Version 2.0 is out

    Ship your dashboard this week

    Copy the components you need. Own every line of code.

    Version 2.0 is out

    Ship your dashboard this week

    Copy the components you need. Own every line of code.

    Version 2.0 is out

    Ship your dashboard this week

    Copy the components you need. Own every line of code.

    Version 2.0 is out

    Ship your dashboard this week

    Copy the components you need. Own every line of code.

    Pricing card

    Pro

    $24 / month

    • Unlimited projects
    • Priority support
    • Team roles and audit log

    Pro

    $24 / month

    • Unlimited projects
    • Priority support
    • Team roles and audit log

    Pro

    $24 / month

    • Unlimited projects
    • Priority support
    • Team roles and audit log

    Pro

    $24/ month

    • Unlimited projects
    • Priority support
    • Team roles and audit log

    Pro

    $24 / month

    • Unlimited projects
    • Priority support
    • Team roles and audit log

    Installation

    npx markasui@latest add shimmer-button

    Usage

    <x-markas.shimmer-button size="lg">Get started for free</x-markas.shimmer-button>
    <x-markas.shimmer-button variant="secondary" :duration="3200">Book a demo</x-markas.shimmer-button>
    import { ShimmerButton } from "@/components/markas/ShimmerButton";
    
    <ShimmerButton size="lg">Get started for free</ShimmerButton>
    <ShimmerButton variant="secondary" duration={3200}>Book a demo</ShimmerButton>
    <script setup lang="ts">
    import ShimmerButton from "@/components/markas/ShimmerButton.vue";
    </script>
    
    <template>
      <ShimmerButton size="lg">Get started for free</ShimmerButton>
      <ShimmerButton variant="secondary" :duration="3200"
        >Book a demo</ShimmerButton
      >
    </template>
    <script lang="ts">
      import ShimmerButton from "$lib/components/markas/ShimmerButton.svelte";
    </script>
    
    <ShimmerButton size="lg">Get started for free</ShimmerButton>
    <ShimmerButton variant="secondary" duration={3200}>Book a demo</ShimmerButton>
    ---
    import ShimmerButton from "@/components/markas/ShimmerButton.astro";
    ---
    
    <ShimmerButton size="lg">Get started for free</ShimmerButton>
    <ShimmerButton variant="secondary" duration={3200}>Book a demo</ShimmerButton>
    import { Component } from "@angular/core";
    import { ShimmerButton } from "./markas/shimmer-button.component";
    
    @Component({
      selector: "app-hero",
      imports: [ShimmerButton],
      template: `
        <button markas-shimmer-button size="lg">Get started for free</button>
        <button markas-shimmer-button variant="secondary" [duration]="3200">
          Book a demo
        </button>
      `,
    })
    export class Hero {}

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

    • The sheen runs with the Web Animations API, so no extra CSS or keyframes are needed.
    • An IntersectionObserver pauses the loop while the button is off screen. With reduced motion it never starts.
    • 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.
    durationnumber2400Length of one shimmer cycle in milliseconds.
    type'button' | 'submit' | 'reset'buttonNative type attribute.

    Accessibility

    • A native button element, so Enter and Space work and focus shows a 2px primary outline.
    • The sheen is a decorative aria-hidden span, the label is plain text.
    • With prefers-reduced-motion the sheen never runs and the button looks like a plain Button.

    Related components

    More buttons components with the same classes in every framework.