Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Shimmer Button

    Tombol dengan kilau lembut yang melintas berulang. Animasi berhenti saat di luar layar dan saat reduced motion aktif.

    <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 {}

    Contoh

    Varian

    Ajakan di hero

    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.

    Kartu harga

    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

    Instalasi

    npx markasui@latest add shimmer-button

    Pemakaian

    <x-markas.shimmer-button size="lg">Mulai gratis</x-markas.shimmer-button>
    <x-markas.shimmer-button variant="secondary" :duration="3200">Jadwalkan demo</x-markas.shimmer-button>
    import { ShimmerButton } from "@/components/markas/ShimmerButton";
    
    <ShimmerButton size="lg">Mulai gratis</ShimmerButton>
    <ShimmerButton variant="secondary" duration={3200}>Jadwalkan demo</ShimmerButton>
    <script setup lang="ts">
    import ShimmerButton from "@/components/markas/ShimmerButton.vue";
    </script>
    
    <template>
      <ShimmerButton size="lg">Mulai gratis</ShimmerButton>
      <ShimmerButton variant="secondary" :duration="3200"
        >Jadwalkan demo</ShimmerButton
      >
    </template>
    <script lang="ts">
      import ShimmerButton from "$lib/components/markas/ShimmerButton.svelte";
    </script>
    
    <ShimmerButton size="lg">Mulai gratis</ShimmerButton>
    <ShimmerButton variant="secondary" duration={3200}>Jadwalkan demo</ShimmerButton
    >
    ---
    import ShimmerButton from "@/components/markas/ShimmerButton.astro";
    ---
    
    <ShimmerButton size="lg">Mulai gratis</ShimmerButton>
    <ShimmerButton variant="secondary" duration={3200}>Jadwalkan 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">Mulai gratis</button>
        <button markas-shimmer-button variant="secondary" [duration]="3200">
          Jadwalkan demo
        </button>
      `,
    })
    export class Hero {}

    Angular memakai attribute selector pada button native, jadi disabled, aria-*, dan class tetap di button itu.

    • Kilau berjalan dengan Web Animations API, jadi tidak perlu CSS atau keyframes tambahan.
    • IntersectionObserver menjeda animasi saat tombol di luar layar. Dengan reduced motion animasi tidak pernah mulai.
    • Blade butuh Alpine.js.

    Props

    NamaTipeDefaultKeterangan
    variant'primary' | 'secondary' | 'ghost' | 'danger'primaryGaya visual, sama seperti Button.
    size'sm' | 'md' | 'lg'mdTinggi 32, 40, atau 48px, sama seperti Button.
    durationnumber2400Lama satu siklus kilau dalam milidetik.
    type'button' | 'submit' | 'reset'buttonAtribut type native.

    Aksesibilitas

    • Elemen button native, jadi Enter dan Spasi berfungsi dan fokus tampil sebagai outline 2px warna primary.
    • Kilau adalah span dekoratif aria-hidden, labelnya teks biasa.
    • Dengan prefers-reduced-motion kilau tidak berjalan dan tombol tampak seperti Button biasa.

    Komponen terkait

    Komponen tombol lain dengan class yang sama di setiap framework.