Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Background Boxes

    A skewed, flat, or perspective grid of tiles that light up under the cursor and fade back, using only 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 {}

    Examples

    Flat grid feature section

    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.

    404 page in perspective

    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.

    Compact promo banner

    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.

    Installation

    npx markasui@latest add background-boxes

    Usage

    <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">Design in blocks</h2>
    </x-markas.background-boxes>

    No JavaScript or Alpine.js needed.

    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">Design in blocks</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">Design in blocks</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">Design in blocks</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">Design in blocks</h2>
    </BackgroundBoxes>

    No client-side JavaScript; the markup is rendered on the 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">Design in blocks</h2>
        </div>
      `,
    })
    export class Hero {}

    The component is an attribute on a div, so class, style, and other attributes stay on the root element.

    • Tiles light up with plain CSS :hover and fade back over one second. Touch screens see the few tiles that glow on their own.
    • The content wrapper lets the pointer through to the grid. Links, buttons, labels, and form fields stay clickable; text inside the content cannot be selected with the mouse.
    • Keep rows times cols small: the grid stops at 600 tiles.
    • The component has no built-in text, so there are no label props to translate.

    Props

    NameTypeDefaultDescription
    variantskewed | flat | perspectiveskewedskewed tilts the grid like an isometric floor, flat keeps it square, perspective lays it back toward the horizon.
    rowsnumber12Number of rows, up to 40. The grid stops at 600 tiles.
    colsnumber18Number of columns, up to 40.
    sizenumber40Tile size in pixels.
    speedslow | normal | fastnormalCycle of the few tiles that glow on their own: 9s, 6s, or 3.5s.
    colormuted | primary | success | warning | dangerprimaryToken color a tile lights up with.
    children / slotslot / ReactNode / snippet-Content shown on top of the grid.

    Accessibility

    • The grid is aria-hidden and its tiles are not focusable.
    • Content lets the pointer through to the grid, except links, buttons, labels, and form fields, which stay clickable.
    • With reduced motion, tiles stop glowing on their own and change color without a fade.

    Related components

    More backgrounds components with the same classes in every framework.