Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Stars Background

    Bidang bintang berkelip yang posisinya dari seed tetap, jadi setiap render terlihat sama. Paling cocok di mode gelap.

    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 {}

    Contoh

    Hitung mundur acara

    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

    Daftar waitlist

    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.

    Section selalu gelap

    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.

    Instalasi

    npx markasui@latest add stars-background

    Pemakaian

    <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">Deploy yang jalan saat kamu tidur</h2>
        <x-markas.button>Mulai sekarang</x-markas.button>
    </x-markas.stars-background>

    Tidak butuh JavaScript atau Alpine.js.

    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">
        Deploy yang jalan saat kamu tidur
      </h2>
      <Button>Mulai sekarang</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">
          Deploy yang jalan saat kamu tidur
        </h2>
        <Button>Mulai sekarang</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 memakai attribute selector pada div native, jadi class, aria-*, dan atribut lain tetap di elemen akar.

    • Posisi bintang dihitung dari seed dengan bilangan bulat, jadi semua framework merender langit yang sama di server dan klien.
    • Tambahkan class dark supaya section tetap gelap di semua tema. Dengan reduced motion bintang berhenti berkelip.
    • Komponen ini tidak punya teks bawaan, jadi tidak ada prop label yang perlu diterjemahkan.

    Props

    NamaTipeDefaultKeterangan
    countnumber80Jumlah bintang, maksimal 400. Makin banyak, langit makin rapat.
    seednumber7Bilangan bulat yang menentukan posisi bintang. Seed sama selalu menghasilkan langit yang sama.
    colormuted | primary | success | warning | dangerprimaryWarna token bintang.
    children / slotslot / ReactNode-Konten yang tampil di atas bintang.

    Aksesibilitas

    • Lapisan bintang memakai aria-hidden dan mengabaikan pointer.
    • Dengan reduced motion, bintang berhenti berkelip dan tetap pada kecerahannya masing-masing.

    Komponen terkait

    Komponen latar lain dengan class yang sama di setiap framework.