Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Background Lines

    SVG lines that draw in and fade out one after another, as waves, rays from a point, or a lattice. Made for hero sections.

    Ideas in motion

    Sketch, review, and ship product updates in one calm workspace.

    Ideas in motion

    Sketch, review, and ship product updates in one calm workspace.

    Ideas in motion

    Sketch, review, and ship product updates in one calm workspace.

    Ideas in motion

    Sketch, review, and ship product updates in one calm workspace.

    Ideas in motion

    Sketch, review, and ship product updates in one calm workspace.

    <x-markas.background-lines 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">
          Ideas in motion
        </h2>
        <p class="max-w-72 text-sm text-muted">
          Sketch, review, and ship product updates in one calm workspace.
        </p>
        <x-markas.button>Start sketching</x-markas.button>
      </div>
    </x-markas.background-lines>
    import { BackgroundLines } from "@/components/markas/BackgroundLines";
    import { Button } from "@/components/markas/Button";
    
    export default function BackgroundLinesExample() {
      return (
        <BackgroundLines 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">
              Ideas in motion
            </h2>
            <p className="max-w-72 text-sm text-muted">
              Sketch, review, and ship product updates in one calm workspace.
            </p>
            <Button>Start sketching</Button>
          </div>
        </BackgroundLines>
      );
    }
    <script setup lang="ts">
    import BackgroundLines from "@/components/markas/BackgroundLines.vue";
    import Button from "@/components/markas/Button.vue";
    </script>
    
    <template>
      <BackgroundLines 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">
            Ideas in motion
          </h2>
          <p class="max-w-72 text-sm text-muted">
            Sketch, review, and ship product updates in one calm workspace.
          </p>
          <Button>Start sketching</Button>
        </div>
      </BackgroundLines>
    </template>
    <script lang="ts">
      import BackgroundLines from "$lib/components/markas/BackgroundLines.svelte";
      import Button from "$lib/components/markas/Button.svelte";
    </script>
    
    <BackgroundLines 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">Ideas in motion</h2>
        <p class="max-w-72 text-sm text-muted">
          Sketch, review, and ship product updates in one calm workspace.
        </p>
        <Button>Start sketching</Button>
      </div>
    </BackgroundLines>
    ---
    import BackgroundLines from "@/components/markas/BackgroundLines.astro";
    import Button from "@/components/markas/Button.astro";
    ---
    
    <BackgroundLines 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">
          Ideas in motion
        </h2>
        <p class="max-w-72 text-sm text-muted">
          Sketch, review, and ship product updates in one calm workspace.
        </p>
        <Button>Start sketching</Button>
      </div>
    </BackgroundLines>
    import { Component } from "@angular/core";
    import { BackgroundLines } from "./markas/background-lines.component";
    import { Button } from "./markas/button.component";
    
    @Component({
      selector: "markas-example",
      imports: [BackgroundLines, Button],
      template: `
        <div
          markas-background-lines
          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">
              Ideas in motion
            </h2>
            <p class="max-w-72 text-sm text-muted">
              Sketch, review, and ship product updates in one calm workspace.
            </p>
            <button markas-button>Start sketching</button>
          </div>
        </div>
      `,
    })
    export default class BackgroundLinesFixture {}

    Examples

    404 page with rays

    404

    Nothing under this spotlight

    The page you are looking for was moved or never existed.

    404

    Nothing under this spotlight

    The page you are looking for was moved or never existed.

    404

    Nothing under this spotlight

    The page you are looking for was moved or never existed.

    404

    Nothing under this spotlight

    The page you are looking for was moved or never existed.

    404

    Nothing under this spotlight

    The page you are looking for was moved or never existed.

    Sign-in lattice

    Sign in

    Use your work email to continue.

    Sign in

    Use your work email to continue.

    Sign in

    Use your work email to continue.

    Sign in

    Use your work email to continue.

    Sign in

    Use your work email to continue.

    Trial CTA card

    Your first month is on us

    Invite the whole team and keep every project in sync from day one.

    Your first month is on us

    Invite the whole team and keep every project in sync from day one.

    Your first month is on us

    Invite the whole team and keep every project in sync from day one.

    Your first month is on us

    Invite the whole team and keep every project in sync from day one.

    Your first month is on us

    Invite the whole team and keep every project in sync from day one.

    Installation

    npx markasui@latest add background-lines

    Usage

    <x-markas.background-lines variant="waves" :count="12" class="rounded-xl bg-surface px-6 py-16">
        <h2 class="text-center text-3xl font-bold text-ink">Ideas in motion</h2>
    </x-markas.background-lines>

    No JavaScript or Alpine.js needed.

    import { BackgroundLines } from "@/components/markas/BackgroundLines";
    
    <BackgroundLines
      variant="waves"
      count={12}
      className="rounded-xl bg-surface px-6 py-16"
    >
      <h2 className="text-center text-3xl font-bold text-ink">Ideas in motion</h2>
    </BackgroundLines>;
    <template>
      <BackgroundLines
        variant="waves"
        :count="12"
        class="rounded-xl bg-surface px-6 py-16"
      >
        <h2 class="text-center text-3xl font-bold text-ink">Ideas in motion</h2>
      </BackgroundLines>
    </template>
    <script lang="ts">
      import BackgroundLines from "$lib/components/markas/BackgroundLines.svelte";
    </script>
    
    <BackgroundLines
      variant="waves"
      count={12}
      class="rounded-xl bg-surface px-6 py-16"
    >
      <h2 class="text-center text-3xl font-bold text-ink">Ideas in motion</h2>
    </BackgroundLines>
    ---
    import BackgroundLines from "@/components/markas/BackgroundLines.astro";
    ---
    
    <BackgroundLines
      variant="waves"
      count={12}
      class="rounded-xl bg-surface px-6 py-16"
    >
      <h2 class="text-center text-3xl font-bold text-ink">Ideas in motion</h2>
    </BackgroundLines>

    No client-side JavaScript; the markup is rendered on the server.

    import { Component } from "@angular/core";
    import { BackgroundLines } from "./markas/background-lines.component";
    
    @Component({
      selector: "app-hero",
      imports: [BackgroundLines],
      template: `
        <div
          markas-background-lines
          variant="waves"
          [count]="12"
          class="rounded-xl bg-surface px-6 py-16"
        >
          <h2 class="text-center text-3xl font-bold text-ink">Ideas in motion</h2>
        </div>
      `,
    })
    export class Hero {}

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

    • Each line draws in, holds, and fades out, offset from its neighbours so the picture never empties.
    • rays fans out from the top center: add top padding so the light source sits above the headline.
    • The lines scale with the area (the 800x400 drawing covers it like object-fit: cover).
    • The component has no built-in text, so there are no label props to translate.

    Props

    NameTypeDefaultDescription
    variantwaves | rays | latticewaveswaves stacks gentle curves, rays fans lines out from the top center, lattice crosses diagonal lines.
    countnumber12Number of lines, up to 24.
    speedslow | normal | fastnormalLength of one draw and fade cycle: 12s, 8s, or 5s.
    colormuted | primary | success | warning | dangerprimaryToken color of the lines.
    children / slotslot / ReactNode / snippet-Content shown on top of the lines.

    Accessibility

    • The line layer is aria-hidden and ignores pointer events.
    • With reduced motion, every line is shown fully drawn and still.
    • Line positions come from a formula, so the server and client render the same markup.

    Related components

    More backgrounds components with the same classes in every framework.