Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Stars Background

    A field of twinkling stars placed from a fixed seed, so every render looks the same. Best in dark mode.

    Launch week, day 3

    Deploys that ship while you sleep

    Schedule releases for any time zone and wake up to a green dashboard.

    Launch week, day 3

    Deploys that ship while you sleep

    Schedule releases for any time zone and wake up to a green dashboard.

    Launch week, day 3

    Deploys that ship while you sleep

    Schedule releases for any time zone and wake up to a green dashboard.

    Launch week, day 3

    Deploys that ship while you sleep

    Schedule releases for any time zone and wake up to a green dashboard.

    Launch week, day 3

    Deploys that ship while you sleep

    Schedule releases for any time zone and wake up to a green dashboard.

    <x-markas.stars-background :count="120" class="rounded-xl border border-line bg-surface px-6 py-14">
        <div class="grid justify-items-center gap-4 text-center">
            <p class="text-sm font-medium text-muted">Launch week, day 3</p>
            <h2 class="text-2xl font-semibold text-balance text-ink">Deploys that ship while you sleep</h2>
            <p class="max-w-80 text-sm text-muted">Schedule releases for any time zone and wake up to a green dashboard.</p>
            <x-markas.button>Read the announcement</x-markas.button>
        </div>
    </x-markas.stars-background>
    import { Button } from "@/components/markas/Button";
    import { StarsBackground } from "@/components/markas/StarsBackground";
    
    export default function StarsBackgroundExample() {
      return (
        <StarsBackground
          count={120}
          className="rounded-xl border border-line bg-surface px-6 py-14"
        >
          <div className="grid justify-items-center gap-4 text-center">
            <p className="text-sm font-medium text-muted">Launch week, day 3</p>
            <h2 className="text-2xl font-semibold text-balance text-ink">
              Deploys that ship while you sleep
            </h2>
            <p className="max-w-80 text-sm text-muted">
              Schedule releases for any time zone and wake up to a green dashboard.
            </p>
            <Button>Read the announcement</Button>
          </div>
        </StarsBackground>
      );
    }
    <script setup lang="ts">
    import Button from "@/components/markas/Button.vue";
    import StarsBackground from "@/components/markas/StarsBackground.vue";
    </script>
    
    <template>
      <StarsBackground
        :count="120"
        class="rounded-xl border border-line bg-surface px-6 py-14"
      >
        <div class="grid justify-items-center gap-4 text-center">
          <p class="text-sm font-medium text-muted">Launch week, day 3</p>
          <h2 class="text-2xl font-semibold text-balance text-ink">
            Deploys that ship while you sleep
          </h2>
          <p class="max-w-80 text-sm text-muted">
            Schedule releases for any time zone and wake up to a green dashboard.
          </p>
          <Button>Read the announcement</Button>
        </div>
      </StarsBackground>
    </template>
    <script lang="ts">
      import Button from "$lib/components/markas/Button.svelte";
      import StarsBackground from "$lib/components/markas/StarsBackground.svelte";
    </script>
    
    <StarsBackground
      count={120}
      class="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <div class="grid justify-items-center gap-4 text-center">
        <p class="text-sm font-medium text-muted">Launch week, day 3</p>
        <h2 class="text-2xl font-semibold text-balance text-ink">
          Deploys that ship while you sleep
        </h2>
        <p class="max-w-80 text-sm text-muted">
          Schedule releases for any time zone and wake up to a green dashboard.
        </p>
        <Button>Read the announcement</Button>
      </div>
    </StarsBackground>
    ---
    import Button from "@/components/markas/Button.astro";
    import StarsBackground from "@/components/markas/StarsBackground.astro";
    ---
    
    <StarsBackground
      count={120}
      class="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <div class="grid justify-items-center gap-4 text-center">
        <p class="text-sm font-medium text-muted">Launch week, day 3</p>
        <h2 class="text-2xl font-semibold text-balance text-ink">
          Deploys that ship while you sleep
        </h2>
        <p class="max-w-80 text-sm text-muted">
          Schedule releases for any time zone and wake up to a green dashboard.
        </p>
        <Button>Read the announcement</Button>
      </div>
    </StarsBackground>
    import { Component } from "@angular/core";
    import { Button } from "./markas/button.component";
    import { StarsBackground } from "./markas/stars-background.component";
    
    @Component({
      selector: "markas-example",
      imports: [Button, StarsBackground],
      template: `
        <div
          markas-stars-background
          count="120"
          class="rounded-xl border border-line bg-surface px-6 py-14"
        >
          <div class="grid justify-items-center gap-4 text-center">
            <p class="text-sm font-medium text-muted">Launch week, day 3</p>
            <h2 class="text-2xl font-semibold text-balance text-ink">
              Deploys that ship while you sleep
            </h2>
            <p class="max-w-80 text-sm text-muted">
              Schedule releases for any time zone and wake up to a green dashboard.
            </p>
            <button markas-button>Read the announcement</button>
          </div>
        </div>
      `,
    })
    export default class StarsBackgroundExample {}

    Examples

    Event countdown

    Product launch goes live in

    Days
    02
    Hours
    14
    Minutes
    36

    Product launch goes live in

    Days
    02
    Hours
    14
    Minutes
    36

    Product launch goes live in

    Days
    02
    Hours
    14
    Minutes
    36

    Product launch goes live in

    Days
    02
    Hours
    14
    Minutes
    36

    Product launch goes live in

    Days
    02
    Hours
    14
    Minutes
    36

    Waitlist signup

    Join the waitlist

    Be first to try MarkasUI Pro when invites open this spring.

    Join the waitlist

    Be first to try MarkasUI Pro when invites open this spring.

    Join the waitlist

    Be first to try MarkasUI Pro when invites open this spring.

    Join the waitlist

    Be first to try MarkasUI Pro when invites open this spring.

    Join the waitlist

    Be first to try MarkasUI Pro when invites open this spring.

    Always-dark section

    Built for night owls

    This section stays dark in every theme. Add the dark class to the component to keep it that way.

    Built for night owls

    This section stays dark in every theme. Add the dark class to the component to keep it that way.

    Built for night owls

    This section stays dark in every theme. Add the dark class to the component to keep it that way.

    Built for night owls

    This section stays dark in every theme. Add the dark class to the component to keep it that way.

    Built for night owls

    This section stays dark in every theme. Add the dark class to the component to keep it that way.

    Installation

    npx markasui@latest add stars-background

    Usage

    <x-markas.stars-background :count="120" :seed="7" class="rounded-xl border border-line bg-surface px-6 py-12">
        <h2 class="text-2xl font-semibold text-ink">Deploys that ship while you sleep</h2>
        <x-markas.button>Get started</x-markas.button>
    </x-markas.stars-background>

    No JavaScript or Alpine.js needed.

    import { Button } from "@/components/markas/Button";
    import { StarsBackground } from "@/components/markas/StarsBackground";
    
    <StarsBackground
      count={120}
      seed={7}
      className="rounded-xl border border-line bg-surface px-6 py-12"
    >
      <h2 className="text-2xl font-semibold text-ink">
        Deploys that ship while you sleep
      </h2>
      <Button>Get started</Button>
    </StarsBackground>;
    <template>
      <StarsBackground
        :count="120"
        :seed="7"
        class="rounded-xl border border-line bg-surface px-6 py-12"
      >
        <h2 class="text-2xl font-semibold text-ink">
          Deploys that ship while you sleep
        </h2>
        <Button>Get started</Button>
      </StarsBackground>
    </template>
    <script lang="ts">
      import Button from "$lib/components/markas/Button.svelte";
      import StarsBackground from "$lib/components/markas/StarsBackground.svelte";
    </script>
    
    <StarsBackground
      count={120}
      seed={7}
      class="rounded-xl border border-line bg-surface px-6 py-12"
    >
      <h2 class="text-2xl font-semibold text-ink">
        Deploys that ship while you sleep
      </h2>
      <Button>Get started</Button>
    </StarsBackground>
    ---
    import Button from "@/components/markas/Button.astro";
    import StarsBackground from "@/components/markas/StarsBackground.astro";
    ---
    
    <StarsBackground
      count={120}
      seed={7}
      class="rounded-xl border border-line bg-surface px-6 py-12"
    >
      <h2 class="text-2xl font-semibold text-ink">
        Deploys that ship while you sleep
      </h2>
      <Button>Get started</Button>
    </StarsBackground>
    import { Component } from "@angular/core";
    import { Button } from "./markas/button.component";
    import { StarsBackground } from "./markas/stars-background.component";
    
    @Component({
      selector: "app-launch",
      imports: [Button, StarsBackground],
      template: `
        <div
          markas-stars-background
          count="120"
          seed="7"
          class="rounded-xl border border-line bg-surface px-6 py-12"
        >
          <h2 class="text-2xl font-semibold text-ink">
            Deploys that ship while you sleep
          </h2>
          <button markas-button>Get started</button>
        </div>
      `,
    })
    export class Launch {}

    Angular uses an attribute selector on the native div, so class, aria-*, and other attributes stay on the root element.

    • Star positions come from seed with integer math, so all six frameworks render the same sky on the server and client.
    • Add the dark class to keep a section dark in every theme. With reduced motion the stars stop twinkling.
    • The component has no built-in text, so there are no label props to translate.

    Props

    NameTypeDefaultDescription
    countnumber80Number of stars, up to 400. More stars make a denser sky.
    seednumber7Whole number that decides star positions. The same seed always gives the same sky.
    colormuted | primary | success | warning | dangerprimaryToken color of the stars.
    children / slotslot / ReactNode-Content shown on top of the stars.

    Accessibility

    • The star layer is aria-hidden and ignores pointer events.
    • With reduced motion, stars stop twinkling and keep their own brightness.

    Related components

    More backgrounds components with the same classes in every framework.