Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Background Boxes

    Grid kotak miring, datar, atau berperspektif yang menyala di bawah kursor lalu memudar, hanya dengan CSS hover.

    Design in blocks

    Move your cursor across the grid and watch each tile light up.

    Design in blocks

    Move your cursor across the grid and watch each tile light up.

    Design in blocks

    Move your cursor across the grid and watch each tile light up.

    Design in blocks

    Move your cursor across the grid and watch each tile light up.

    Design in blocks

    Move your cursor across the grid and watch each tile light up.

    <x-markas.background-boxes class="rounded-xl border border-line bg-surface px-6 py-16">
      <div class="grid justify-items-center gap-4 text-center">
        <h2 class="text-4xl font-bold tracking-tight text-ink">
          Design in blocks
        </h2>
        <p class="max-w-72 rounded-md bg-surface/80 text-sm text-muted">
          Move your cursor across the grid and watch each tile light up.
        </p>
        <x-markas.button>Explore blocks</x-markas.button>
      </div>
    </x-markas.background-boxes>
    import { BackgroundBoxes } from "@/components/markas/BackgroundBoxes";
    import { Button } from "@/components/markas/Button";
    
    export default function BackgroundBoxesExample() {
      return (
        <BackgroundBoxes className="rounded-xl border border-line bg-surface px-6 py-16">
          <div className="grid justify-items-center gap-4 text-center">
            <h2 className="text-4xl font-bold tracking-tight text-ink">
              Design in blocks
            </h2>
            <p className="max-w-72 rounded-md bg-surface/80 text-sm text-muted">
              Move your cursor across the grid and watch each tile light up.
            </p>
            <Button>Explore blocks</Button>
          </div>
        </BackgroundBoxes>
      );
    }
    <script setup lang="ts">
    import BackgroundBoxes from "@/components/markas/BackgroundBoxes.vue";
    import Button from "@/components/markas/Button.vue";
    </script>
    
    <template>
      <BackgroundBoxes class="rounded-xl border border-line bg-surface px-6 py-16">
        <div class="grid justify-items-center gap-4 text-center">
          <h2 class="text-4xl font-bold tracking-tight text-ink">
            Design in blocks
          </h2>
          <p class="max-w-72 rounded-md bg-surface/80 text-sm text-muted">
            Move your cursor across the grid and watch each tile light up.
          </p>
          <Button>Explore blocks</Button>
        </div>
      </BackgroundBoxes>
    </template>
    <script lang="ts">
      import BackgroundBoxes from "$lib/components/markas/BackgroundBoxes.svelte";
      import Button from "$lib/components/markas/Button.svelte";
    </script>
    
    <BackgroundBoxes class="rounded-xl border border-line bg-surface px-6 py-16">
      <div class="grid justify-items-center gap-4 text-center">
        <h2 class="text-4xl font-bold tracking-tight text-ink">Design in blocks</h2>
        <p class="max-w-72 rounded-md bg-surface/80 text-sm text-muted">
          Move your cursor across the grid and watch each tile light up.
        </p>
        <Button>Explore blocks</Button>
      </div>
    </BackgroundBoxes>
    ---
    import BackgroundBoxes from "@/components/markas/BackgroundBoxes.astro";
    import Button from "@/components/markas/Button.astro";
    ---
    
    <BackgroundBoxes class="rounded-xl border border-line bg-surface px-6 py-16">
      <div class="grid justify-items-center gap-4 text-center">
        <h2 class="text-4xl font-bold tracking-tight text-ink">
          Design in blocks
        </h2>
        <p class="max-w-72 rounded-md bg-surface/80 text-sm text-muted">
          Move your cursor across the grid and watch each tile light up.
        </p>
        <Button>Explore blocks</Button>
      </div>
    </BackgroundBoxes>
    import { Component } from "@angular/core";
    import { BackgroundBoxes } from "./markas/background-boxes.component";
    import { Button } from "./markas/button.component";
    
    @Component({
      selector: "markas-example",
      imports: [BackgroundBoxes, Button],
      template: `
        <div
          markas-background-boxes
          class="rounded-xl border border-line bg-surface px-6 py-16"
        >
          <div class="grid justify-items-center gap-4 text-center">
            <h2 class="text-4xl font-bold tracking-tight text-ink">
              Design in blocks
            </h2>
            <p class="max-w-72 rounded-md bg-surface/80 text-sm text-muted">
              Move your cursor across the grid and watch each tile light up.
            </p>
            <button markas-button>Explore blocks</button>
          </div>
        </div>
      `,
    })
    export default class BackgroundBoxesFixture {}

    Contoh

    Section fitur grid datar

    Everything in its place

    • Boards

      Plan work in columns.

    • Docs

      Write specs next to tasks.

    • Goals

      Track progress weekly.

    • Reports

      Share wins with one link.

    Everything in its place

    • Boards

      Plan work in columns.

    • Docs

      Write specs next to tasks.

    • Goals

      Track progress weekly.

    • Reports

      Share wins with one link.

    Everything in its place

    • Boards

      Plan work in columns.

    • Docs

      Write specs next to tasks.

    • Goals

      Track progress weekly.

    • Reports

      Share wins with one link.

    Everything in its place

    • Boards

      Plan work in columns.

    • Docs

      Write specs next to tasks.

    • Goals

      Track progress weekly.

    • Reports

      Share wins with one link.

    Everything in its place

    • Boards

      Plan work in columns.

    • Docs

      Write specs next to tasks.

    • Goals

      Track progress weekly.

    • Reports

      Share wins with one link.

    Halaman 404 berperspektif

    404

    This tile is missing

    The page may have moved. Try the dashboard instead.

    404

    This tile is missing

    The page may have moved. Try the dashboard instead.

    404

    This tile is missing

    The page may have moved. Try the dashboard instead.

    404

    This tile is missing

    The page may have moved. Try the dashboard instead.

    404

    This tile is missing

    The page may have moved. Try the dashboard instead.

    Banner promo ringkas

    Black Friday deal

    Half off every annual plan.

    Black Friday deal

    Half off every annual plan.

    Black Friday deal

    Half off every annual plan.

    Black Friday deal

    Half off every annual plan.

    Black Friday deal

    Half off every annual plan.

    Instalasi

    npx markasui@latest add background-boxes

    Pemakaian

    <x-markas.background-boxes variant="skewed" :rows="12" :cols="18" class="rounded-xl bg-surface px-6 py-16">
        <h2 class="text-center text-3xl font-bold text-ink">Desain per blok</h2>
    </x-markas.background-boxes>

    Tidak butuh JavaScript atau Alpine.js.

    import { BackgroundBoxes } from "@/components/markas/BackgroundBoxes";
    
    <BackgroundBoxes
      variant="skewed"
      rows={12}
      cols={18}
      className="rounded-xl bg-surface px-6 py-16"
    >
      <h2 className="text-center text-3xl font-bold text-ink">Desain per blok</h2>
    </BackgroundBoxes>;
    <template>
      <BackgroundBoxes
        variant="skewed"
        :rows="12"
        :cols="18"
        class="rounded-xl bg-surface px-6 py-16"
      >
        <h2 class="text-center text-3xl font-bold text-ink">Desain per blok</h2>
      </BackgroundBoxes>
    </template>
    <script lang="ts">
      import BackgroundBoxes from "$lib/components/markas/BackgroundBoxes.svelte";
    </script>
    
    <BackgroundBoxes
      variant="skewed"
      rows={12}
      cols={18}
      class="rounded-xl bg-surface px-6 py-16"
    >
      <h2 class="text-center text-3xl font-bold text-ink">Desain per blok</h2>
    </BackgroundBoxes>
    ---
    import BackgroundBoxes from "@/components/markas/BackgroundBoxes.astro";
    ---
    
    <BackgroundBoxes
      variant="skewed"
      rows={12}
      cols={18}
      class="rounded-xl bg-surface px-6 py-16"
    >
      <h2 class="text-center text-3xl font-bold text-ink">Desain per blok</h2>
    </BackgroundBoxes>

    Tanpa JavaScript di browser; markup dirender di server.

    import { Component } from "@angular/core";
    import { BackgroundBoxes } from "./markas/background-boxes.component";
    
    @Component({
      selector: "app-hero",
      imports: [BackgroundBoxes],
      template: `
        <div
          markas-background-boxes
          variant="skewed"
          [rows]="12"
          [cols]="18"
          class="rounded-xl bg-surface px-6 py-16"
        >
          <h2 class="text-center text-3xl font-bold text-ink">Desain per blok</h2>
        </div>
      `,
    })
    export class Hero {}

    Komponen ini berupa atribut pada div, jadi class, style, dan atribut lain tetap di elemen akar.

    • Kotak menyala dengan CSS :hover biasa dan memudar dalam satu detik. Di layar sentuh, beberapa kotak tetap menyala sendiri.
    • Pembungkus konten meneruskan pointer ke grid. Tautan, tombol, label, dan kolom form tetap bisa diklik; teks di dalam konten tidak bisa dipilih dengan mouse.
    • Jaga rows kali cols tetap kecil: grid berhenti di 600 kotak.
    • Komponen ini tidak punya teks bawaan, jadi tidak ada prop label yang perlu diterjemahkan.

    Props

    NamaTipeDefaultKeterangan
    variantskewed | flat | perspectiveskewedskewed memiringkan grid seperti lantai isometrik, flat membuatnya lurus, perspective merebahkannya ke arah cakrawala.
    rowsnumber12Jumlah baris, maksimal 40. Grid berhenti di 600 kotak.
    colsnumber18Jumlah kolom, maksimal 40.
    sizenumber40Ukuran kotak dalam piksel.
    speedslow | normal | fastnormalSiklus beberapa kotak yang menyala sendiri: 9s, 6s, atau 3.5s.
    colormuted | primary | success | warning | dangerprimaryWarna token saat kotak menyala.
    children / slotslot / ReactNode / snippet-Konten yang tampil di atas grid.

    Aksesibilitas

    • Grid memakai aria-hidden dan kotaknya tidak bisa difokus.
    • Konten meneruskan pointer ke grid, kecuali tautan, tombol, label, dan kolom form yang tetap bisa diklik.
    • Dengan reduced motion, kotak berhenti menyala sendiri dan berganti warna tanpa transisi.

    Komponen terkait

    Komponen latar lain dengan class yang sama di setiap framework.