Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Float

    Wrapper that makes its children drift, bob, orbit, or breathe on their own loops, with optional pointer parallax and a staggered entrance.

    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";
    }

    Examples

    Bobbing badge on a pricing card

    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

    Orbiting avatars with a staggered entrance

    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

    Breathing icons in a footer

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    MarkasUI made in Bandung

    Installation

    npx markasui@latest add float

    Usage

    <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">Ship the idea this week</h1>
    </div>

    Needs 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">
        Save 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>

    Each group is a small custom element, so it keeps working after view transitions.

    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 and class move from the host to the group.

    • Every direct child floats on its own loop. motion picks the path: drift (figure eight with a slight sway), bob (rise and fall), orbit (small circle), or breathe (gentle swell).
    • Timing, size, and direction vary per child from seed, so the same seed looks the same in Blade, React, and Vue.
    • parallax shifts children toward the pointer. Set data-depth="0.2" to "1" on a child to control how far it moves.
    • entrance pops the children in one after another the first time the group scrolls into view.
    • A child stops while it is hovered or focused, and all loops pause off screen. The loop animates transform on each child; wrap a child that needs its own transform utilities.

    Props

    NameTypeDefaultDescription
    motion"drift" | "bob" | "orbit" | "breathe""drift"Path each child follows: a slow figure eight with a slight sway, a rise and fall, a small circle, or a gentle swell.
    amplitudenumber10Distance in px each child travels, varied a little per child. For breathe it is also the growth in percent.
    durationnumber6Seconds for one loop, varied a little per child so they never move in step.
    seednumber1Changes the per-child timing, size, and direction. The same seed always gives the same motion.
    parallaxnumber0Largest shift in px toward the pointer. Each child moves by its depth: data-depth="0.2" to "1", or a seeded depth. 0 turns it off.
    entrancebooleanfalseChildren pop in one after another the first time the group scrolls into view.
    children / slotReactNode / slot-The floating items. Each direct child moves on its own; position them with your own classes, such as absolute top-[12%] left-[10%].

    Accessibility

    • Floating is decoration only; mark a purely decorative group with aria-hidden="true".
    • A child stops moving while it is hovered or holds keyboard focus, so floating buttons and links stay easy to hit.
    • All loops pause while the group is off screen.
    • With reduced motion nothing moves: no loops, parallax, or entrance.

    Related components

    More markasui components with the same classes in every framework.