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>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
<x-markas.stars-background :count="150" :seed="3" color="muted" class="rounded-xl border border-line bg-canvas p-6">
<form class="grid gap-4">
<div class="grid gap-1.5"><svg class="mb-2 size-8" viewBox="0 0 1464 1430" aria-hidden="true"><polygon points="354,578 1256,138 1171,430 268,868" class="fill-ink/15" /><polygon points="553,443 1455,3 1370,295 467,733" class="fill-ink/55" /><polygon points="421,762 1325,318 1240,611 336,1050" class="fill-success/35" /><polygon points="265,1073 1169,629 1084,922 180,1362" class="fill-ink/25" /><polygon points="93,965 997,521 912,814 8,1253" class="fill-ink/75" /><polygon points="347,1135 1251,691 1166,984 262,1424" class="fill-success" /></svg>
<h3 class="text-lg font-semibold text-ink">Join the waitlist</h3>
<p class="text-sm text-muted">Be first to try MarkasUI Pro when invites open this spring.</p>
</div>
<div class="flex items-end gap-2">
<x-markas.input label="Email" type="email" placeholder="you@company.com" class="flex-1" />
<x-markas.button type="submit">Request invite</x-markas.button>
</div>
</form>
</x-markas.stars-background>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.
<x-markas.stars-background :count="140" :seed="42" class="dark rounded-xl bg-canvas px-6 py-10 text-ink">
<div class="grid gap-4">
<h3 class="text-xl font-semibold text-ink">Built for night owls</h3>
<p class="text-sm text-muted">This section stays dark in every theme. Add the dark class to the component to keep it that way.</p>
<div class="flex gap-2">
<x-markas.button>Start building</x-markas.button>
<x-markas.button variant="ghost">Read the guide</x-markas.button>
</div>
</div>
</x-markas.stars-background>Instalasi
npx markasui@latest add stars-backgroundpnpm dlx markasui@latest add stars-backgroundyarn dlx markasui@latest add stars-backgroundbunx --bun markasui@latest add stars-background- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
resources/views/components/markas/stars-background.blade.php.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/components/markas/StarsBackground.tsx.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/components/markas/StarsBackground.vue.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/lib/components/markas/StarsBackground.svelte.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/components/markas/StarsBackground.astro.
- Pastikan Tailwind CSS v4 dan markas.css sudah terpasang. Lihat Instalasi.
- Salin source komponen di bawah ini ke
src/app/markas/stars-background.component.ts.
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
seeddengan bilangan bulat, jadi semua framework merender langit yang sama di server dan klien. - Tambahkan class
darksupaya 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
| Nama | Tipe | Default | Keterangan |
|---|---|---|---|
count | number | 80 | Jumlah bintang, maksimal 400. Makin banyak, langit makin rapat. |
seed | number | 7 | Bilangan bulat yang menentukan posisi bintang. Seed sama selalu menghasilkan langit yang sama. |
color | muted | primary | success | warning | danger | primary | Warna token bintang. |
children / slot | slot / 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.
- Aurora BackgroundBidang warna bercahaya yang bergeser pelan di belakang konten, dari token primary dan satu token aksen.
- Background BeamsBerkas cahaya tipis melengkung yang mengalir, berdenyut, atau jatuh dan memercik di belakang konten. Murni SVG dan CSS, tanpa JavaScript.
- Background BoxesGrid kotak miring, datar, atau berperspektif yang menyala di bawah kursor lalu memudar, hanya dengan CSS hover.
- Background LinesGaris SVG yang tergambar lalu menghilang bergantian, berupa gelombang, sinar dari satu titik, atau kisi. Dibuat untuk hero.
- Dot PatternGrid titik kecil di belakang konten, dengan pudar radial atau linear opsional. Murni CSS, tanpa JavaScript.
- Gradient BorderMembungkus kartu, tombol, atau kolom dengan border gradien bergerak yang berputar, berkilau, atau berdenyut, dengan pendar lembut opsional.