Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Float

    Pembungkus yang membuat anaknya melayang, naik turun, mengorbit, atau bernapas dengan ritme sendiri, dengan parallax kursor dan kemunculan berurutan.

    Ship the idea this week

    Copy a component into Blade, React, or Vue and keep going.

    Ship the idea this week

    Copy a component into Blade, React, or Vue and keep going.

    Ship the idea this week

    Copy a component into Blade, React, or Vue and keep going.

    Ship the idea this week

    Copy a component into Blade, React, or Vue and keep going.

    Ship the idea this week

    Copy a component into Blade, React, or Vue and keep going.

    @php
        $hero = 'relative grid h-80 place-items-center overflow-hidden rounded-xl border border-line bg-canvas px-6 text-center';
        $layer = 'absolute inset-0';
        $tileA = 'absolute top-[12%] left-[10%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay';
        $tileB = 'absolute top-[16%] right-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay';
        $tileC = 'absolute bottom-[14%] left-[16%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay';
        $tileD = 'absolute right-[18%] bottom-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay';
        $tileE = 'absolute top-[46%] left-[4%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay';
        $icon = 'size-6';
        $copy = 'relative max-w-64';
        $title = 'text-2xl font-semibold text-ink';
        $text = 'mt-2 text-sm text-muted';
    @endphp
    
        <div class="{{ $hero }}">
          <x-markas.float :parallax="14" aria-hidden="true" :class="$layer">
            <span class="{{ $tileA }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="{{ $icon }}"><path d="m8 8-4 4 4 4"></path><path d="m16 8 4 4-4 4"></path></svg></span>
            <span class="{{ $tileB }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="{{ $icon }}"><path d="M12 3 13.9 8.1 19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3Z"></path></svg></span>
            <span class="{{ $tileC }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="{{ $icon }}"><path d="m12 4 8 4-8 4-8-4 8-4Z"></path><path d="m4 12 8 4 8-4"></path><path d="m4 16 8 4 8-4"></path></svg></span>
            <span class="{{ $tileD }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="{{ $icon }}"><path d="M13 3 5 14h6l-1 7 8-11h-6l1-7Z"></path></svg></span>
            <span class="{{ $tileE }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="{{ $icon }}"><path d="m5 3 14 7-6 2-2 6-6-15Z"></path></svg></span>
          </x-markas.float>
          <div class="{{ $copy }}">
            <p class="{{ $title }}">Ship the idea this week</p>
            <p class="{{ $text }}">Copy a component into Blade, React, or Vue and keep going.</p>
          </div>
        </div>
    import { Float } from "@/components/markas/Float";
    
    const hero =
      "relative grid h-80 place-items-center overflow-hidden rounded-xl border border-line bg-canvas px-6 text-center";
    const layer = "absolute inset-0";
    const tileA =
      "absolute top-[12%] left-[10%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileB =
      "absolute top-[16%] right-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileC =
      "absolute bottom-[14%] left-[16%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileD =
      "absolute right-[18%] bottom-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileE =
      "absolute top-[46%] left-[4%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const icon = "size-6";
    const copy = "relative max-w-64";
    const title = "text-2xl font-semibold text-ink";
    const text = "mt-2 text-sm text-muted";
    
    export default function FloatExample() {
      return (
        <div className={hero}>
          <Float parallax={14} aria-hidden="true" className={layer}>
            <span className={tileA}>
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
                className={icon}
              >
                <path d="m8 8-4 4 4 4"></path>
                <path d="m16 8 4 4-4 4"></path>
              </svg>
            </span>
            <span className={tileB}>
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
                className={icon}
              >
                <path d="M12 3 13.9 8.1 19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3Z"></path>
              </svg>
            </span>
            <span className={tileC}>
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
                className={icon}
              >
                <path d="m12 4 8 4-8 4-8-4 8-4Z"></path>
                <path d="m4 12 8 4 8-4"></path>
                <path d="m4 16 8 4 8-4"></path>
              </svg>
            </span>
            <span className={tileD}>
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
                className={icon}
              >
                <path d="M13 3 5 14h6l-1 7 8-11h-6l1-7Z"></path>
              </svg>
            </span>
            <span className={tileE}>
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
                className={icon}
              >
                <path d="m5 3 14 7-6 2-2 6-6-15Z"></path>
              </svg>
            </span>
          </Float>
          <div className={copy}>
            <p className={title}>Ship the idea this week</p>
            <p className={text}>
              Copy a component into Blade, React, or Vue and keep going.
            </p>
          </div>
        </div>
      );
    }
    <script setup lang="ts">
    import Float from "@/components/markas/Float.vue";
    
    const hero =
      "relative grid h-80 place-items-center overflow-hidden rounded-xl border border-line bg-canvas px-6 text-center";
    const layer = "absolute inset-0";
    const tileA =
      "absolute top-[12%] left-[10%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileB =
      "absolute top-[16%] right-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileC =
      "absolute bottom-[14%] left-[16%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileD =
      "absolute right-[18%] bottom-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileE =
      "absolute top-[46%] left-[4%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const icon = "size-6";
    const copy = "relative max-w-64";
    const title = "text-2xl font-semibold text-ink";
    const text = "mt-2 text-sm text-muted";
    </script>
    
    <template>
      <div :class="hero">
        <Float :parallax="14" aria-hidden="true" :class="layer">
          <span :class="tileA"
            ><svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              :class="icon"
            >
              <path d="m8 8-4 4 4 4"></path>
              <path d="m16 8 4 4-4 4"></path></svg
          ></span>
          <span :class="tileB"
            ><svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              :class="icon"
            >
              <path
                d="M12 3 13.9 8.1 19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3Z"
              ></path></svg
          ></span>
          <span :class="tileC"
            ><svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              :class="icon"
            >
              <path d="m12 4 8 4-8 4-8-4 8-4Z"></path>
              <path d="m4 12 8 4 8-4"></path>
              <path d="m4 16 8 4 8-4"></path></svg
          ></span>
          <span :class="tileD"
            ><svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              :class="icon"
            >
              <path d="M13 3 5 14h6l-1 7 8-11h-6l1-7Z"></path></svg
          ></span>
          <span :class="tileE"
            ><svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              :class="icon"
            >
              <path d="m5 3 14 7-6 2-2 6-6-15Z"></path></svg
          ></span>
        </Float>
        <div :class="copy">
          <p :class="title">Ship the idea this week</p>
          <p :class="text">
            Copy a component into Blade, React, or Vue and keep going.
          </p>
        </div>
      </div>
    </template>
    <script lang="ts">
      import Float from "$lib/components/markas/Float.svelte";
    
      const hero =
        "relative grid h-80 place-items-center overflow-hidden rounded-xl border border-line bg-canvas px-6 text-center";
      const layer = "absolute inset-0";
      const tileA =
        "absolute top-[12%] left-[10%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      const tileB =
        "absolute top-[16%] right-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      const tileC =
        "absolute bottom-[14%] left-[16%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      const tileD =
        "absolute right-[18%] bottom-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      const tileE =
        "absolute top-[46%] left-[4%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      const icon = "size-6";
      const copy = "relative max-w-64";
      const title = "text-2xl font-semibold text-ink";
      const text = "mt-2 text-sm text-muted";
    </script>
    
    <div class={hero}>
      <Float parallax={14} aria-hidden="true" class={layer}>
        <span class={tileA}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="m8 8-4 4 4 4" />
            <path d="m16 8 4 4-4 4" />
          </svg>
        </span>
        <span class={tileB}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path
              d="M12 3 13.9 8.1 19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3Z"
            />
          </svg>
        </span>
        <span class={tileC}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="m12 4 8 4-8 4-8-4 8-4Z" />
            <path d="m4 12 8 4 8-4" />
            <path d="m4 16 8 4 8-4" />
          </svg>
        </span>
        <span class={tileD}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="M13 3 5 14h6l-1 7 8-11h-6l1-7Z" />
          </svg>
        </span>
        <span class={tileE}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="m5 3 14 7-6 2-2 6-6-15Z" />
          </svg>
        </span>
      </Float>
      <div class={copy}>
        <p class={title}>Ship the idea this week</p>
        <p class={text}>
          Copy a component into Blade, React, or Vue and keep going.
        </p>
      </div>
    </div>
    ---
    import Float from "@/components/markas/Float.astro";
    
    const hero =
      "relative grid h-80 place-items-center overflow-hidden rounded-xl border border-line bg-canvas px-6 text-center";
    const layer = "absolute inset-0";
    const tileA =
      "absolute top-[12%] left-[10%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileB =
      "absolute top-[16%] right-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileC =
      "absolute bottom-[14%] left-[16%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileD =
      "absolute right-[18%] bottom-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const tileE =
      "absolute top-[46%] left-[4%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
    const icon = "size-6";
    const copy = "relative max-w-64";
    const title = "text-2xl font-semibold text-ink";
    const text = "mt-2 text-sm text-muted";
    ---
    
    <div class={hero}>
      <Float parallax={14} aria-hidden="true" class={layer}>
        <span class={tileA}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="m8 8-4 4 4 4" />
            <path d="m16 8 4 4-4 4" />
          </svg>
        </span>
        <span class={tileB}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="M12 3 13.9 8.1 19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3Z" />
          </svg>
        </span>
        <span class={tileC}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="m12 4 8 4-8 4-8-4 8-4Z" />
            <path d="m4 12 8 4 8-4" />
            <path d="m4 16 8 4 8-4" />
          </svg>
        </span>
        <span class={tileD}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="M13 3 5 14h6l-1 7 8-11h-6l1-7Z" />
          </svg>
        </span>
        <span class={tileE}>
          <svg
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            class={icon}
          >
            <path d="m5 3 14 7-6 2-2 6-6-15Z" />
          </svg>
        </span>
      </Float>
      <div class={copy}>
        <p class={title}>Ship the idea this week</p>
        <p class={text}>
          Copy a component into Blade, React, or Vue and keep going.
        </p>
      </div>
    </div>
    import { Component } from "@angular/core";
    import { Float } from "./markas/float.component";
    
    @Component({
      selector: "markas-example",
      imports: [Float],
      template: `
        <div [class]="hero">
          <markas-float [parallax]="14" aria-hidden="true" [class]="layer">
            <span [class]="tileA">
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
                [class]="icon"
              >
                <path d="m8 8-4 4 4 4" />
                <path d="m16 8 4 4-4 4" />
              </svg>
            </span>
            <span [class]="tileB">
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
                [class]="icon"
              >
                <path
                  d="M12 3 13.9 8.1 19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3Z"
                />
              </svg>
            </span>
            <span [class]="tileC">
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
                [class]="icon"
              >
                <path d="m12 4 8 4-8 4-8-4 8-4Z" />
                <path d="m4 12 8 4 8-4" />
                <path d="m4 16 8 4 8-4" />
              </svg>
            </span>
            <span [class]="tileD">
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
                [class]="icon"
              >
                <path d="M13 3 5 14h6l-1 7 8-11h-6l1-7Z" />
              </svg>
            </span>
            <span [class]="tileE">
              <svg
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
                [class]="icon"
              >
                <path d="m5 3 14 7-6 2-2 6-6-15Z" />
              </svg>
            </span>
          </markas-float>
          <div [class]="copy">
            <p [class]="title">Ship the idea this week</p>
            <p [class]="text">
              Copy a component into Blade, React, or Vue and keep going.
            </p>
          </div>
        </div>
      `,
    })
    export default class FloatExample {
      protected readonly hero =
        "relative grid h-80 place-items-center overflow-hidden rounded-xl border border-line bg-canvas px-6 text-center";
      protected readonly layer = "absolute inset-0";
      protected readonly tileA =
        "absolute top-[12%] left-[10%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      protected readonly tileB =
        "absolute top-[16%] right-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      protected readonly tileC =
        "absolute bottom-[14%] left-[16%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      protected readonly tileD =
        "absolute right-[18%] bottom-[12%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      protected readonly tileE =
        "absolute top-[46%] left-[4%] grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-overlay";
      protected readonly icon = "size-6";
      protected readonly copy = "relative max-w-64";
      protected readonly title = "text-2xl font-semibold text-ink";
      protected readonly text = "mt-2 text-sm text-muted";
    }

    Contoh

    Badge naik turun di kartu harga

    Save 20%

    Pro yearly

    Rp 79.000 / month

    • Unlimited projects
    • Priority support in Bahasa Indonesia
    • Billed Rp 948.000 a year
    Save 20%

    Pro yearly

    Rp 79.000 / month

    • Unlimited projects
    • Priority support in Bahasa Indonesia
    • Billed Rp 948.000 a year
    Save 20%

    Pro yearly

    Rp 79.000 / month

    • Unlimited projects
    • Priority support in Bahasa Indonesia
    • Billed Rp 948.000 a year
    Save 20%

    Pro yearly

    Rp 79.000 / month

    • Unlimited projects
    • Priority support in Bahasa Indonesia
    • Billed Rp 948.000 a year
    Save 20%

    Pro yearly

    Rp 79.000 / month

    • Unlimited projects
    • Priority support in Bahasa Indonesia
    • Billed Rp 948.000 a year

    Avatar mengorbit dengan kemunculan berurutan

    2,400

    makers across Indonesia

    2,400

    makers across Indonesia

    2,400

    makers across Indonesia

    2,400

    makers across Indonesia

    2,400

    makers across Indonesia

    Ikon bernapas di footer

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    Instalasi

    npx markasui@latest add float

    Pemakaian

    <div class="relative grid h-80 place-items-center overflow-hidden rounded-xl bg-canvas">
        <x-markas.float :parallax="14" aria-hidden="true" class="absolute inset-0">
            <span class="absolute top-[12%] left-[10%] rounded-xl bg-surface p-3">...</span>
            <span class="absolute right-[12%] bottom-[16%] rounded-xl bg-surface p-3">...</span>
        </x-markas.float>
        <h1 class="relative text-2xl font-semibold">Luncurkan idenya minggu ini</h1>
    </div>

    Butuh Alpine.js.

    import { Float } from "@/components/markas/Float";
    
    <Float
      motion="bob"
      amplitude={6}
      duration={3}
      className="absolute -top-3 right-5"
    >
      <span className="rounded-full bg-primary px-3 py-1 text-xs text-on-primary">
        Hemat 20%
      </span>
    </Float>;
    <template>
      <Float
        motion="orbit"
        :amplitude="8"
        entrance
        aria-hidden="true"
        class="absolute inset-0"
      >
        <span
          class="absolute top-[14%] left-[18%] size-12 rounded-full bg-primary-soft"
          >RP</span
        >
        <span
          class="absolute right-[14%] bottom-[18%] size-14 rounded-full bg-primary"
          >DP</span
        >
      </Float>
    </template>
    <script lang="ts">
      import Float from "$lib/components/markas/Float.svelte";
    </script>
    
    <Float motion="bob" amplitude={6} duration={3} class="absolute -top-3 right-5">
      <span class="rounded-full bg-primary px-3 py-1 text-xs text-on-primary">
        Save 20%
      </span>
    </Float>
    ---
    import Float from "@/components/markas/Float.astro";
    ---
    
    <Float motion="bob" amplitude={6} duration={3} class="absolute -top-3 right-5">
      <span class="rounded-full bg-primary px-3 py-1 text-xs text-on-primary">
        Save 20%
      </span>
    </Float>

    Setiap grup adalah custom element kecil, jadi tetap jalan setelah view transition.

    import { Component } from "@angular/core";
    import { Float } from "./markas/float.component";
    
    @Component({
      selector: "app-save-badge",
      imports: [Float],
      template: `
        <markas-float
          motion="bob"
          [amplitude]="6"
          [duration]="3"
          class="absolute -top-3 right-5"
        >
          <span class="rounded-full bg-primary px-3 py-1 text-xs text-on-primary">
            Save 20%
          </span>
        </markas-float>
      `,
    })
    export class SaveBadge {}

    aria-hidden dan class pindah dari host ke grup.

    • Setiap anak langsung melayang dengan ritmenya sendiri. motion memilih jalurnya: drift (angka delapan dengan sedikit goyang), bob (naik turun), orbit (lingkaran kecil), atau breathe (membesar lembut).
    • Waktu, ukuran, dan arah berbeda per anak dari seed, sehingga seed yang sama terlihat sama di Blade, React, dan Vue.
    • parallax menggeser anak ke arah kursor. Pasang data-depth="0.2" sampai "1" pada anak untuk mengatur seberapa jauh ia bergerak.
    • entrance memunculkan anak satu per satu saat grup pertama kali masuk layar.
    • Anak berhenti saat disorot kursor atau difokus, dan semua putaran berhenti di luar layar. Putaran menganimasikan transform pada setiap anak; bungkus anak yang butuh utilitas transform sendiri.

    Props

    NamaTipeDefaultKeterangan
    motion"drift" | "bob" | "orbit" | "breathe""drift"Jalur yang diikuti setiap anak: angka delapan pelan dengan sedikit goyang, naik turun, lingkaran kecil, atau membesar lembut.
    amplitudenumber10Jarak tempuh setiap anak dalam px, sedikit berbeda per anak. Untuk breathe juga besar pembesaran dalam persen.
    durationnumber6Detik untuk satu putaran, sedikit berbeda per anak supaya tidak pernah bergerak serempak.
    seednumber1Mengubah waktu, ukuran, dan arah per anak. Seed yang sama selalu menghasilkan gerakan yang sama.
    parallaxnumber0Pergeseran terbesar dalam px ke arah kursor. Setiap anak bergerak sesuai kedalamannya: data-depth="0.2" sampai "1", atau kedalaman dari seed. 0 mematikannya.
    entrancebooleanfalseAnak-anak muncul satu per satu saat grup pertama kali masuk layar.
    children / slotReactNode / slot-Item yang melayang. Setiap anak langsung bergerak sendiri; atur posisinya dengan class sendiri, misalnya absolute top-[12%] left-[10%].

    Aksesibilitas

    • Gerakan melayang hanya dekorasi; tandai grup yang murni dekoratif dengan aria-hidden="true".
    • Anak berhenti bergerak saat disorot kursor atau memegang fokus keyboard, sehingga tombol dan tautan yang melayang tetap mudah dikenai.
    • Semua putaran berhenti saat grup di luar layar.
    • Dengan reduced motion tidak ada yang bergerak: tanpa putaran, parallax, atau kemunculan.

    Komponen terkait

    Komponen markasui lain dengan class yang sama di setiap framework.