Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Noise Background

    Tekstur grain, film, atau kertas statis di atas gradien token yang bergeser pelan. Murni CSS dengan satu tile noise SVG inline.

    Design tools with a little texture

    Brushes, grain, and paper that make digital work feel made by hand.

    Design tools with a little texture

    Brushes, grain, and paper that make digital work feel made by hand.

    Design tools with a little texture

    Brushes, grain, and paper that make digital work feel made by hand.

    Design tools with a little texture

    Brushes, grain, and paper that make digital work feel made by hand.

    Design tools with a little texture

    Brushes, grain, and paper that make digital work feel made by hand.

    <x-markas.noise-background color="warning" class="rounded-xl border border-line bg-surface px-6 py-14">
        <div class="grid gap-4">
            <h2 class="text-3xl font-semibold tracking-tight text-balance text-ink">Design tools with a little texture</h2>
            <p class="max-w-80 text-sm text-muted">Brushes, grain, and paper that make digital work feel made by hand.</p>
            <div class="flex gap-2">
                <x-markas.button>Download the kit</x-markas.button>
                <x-markas.button variant="ghost">Browse samples</x-markas.button>
            </div>
        </div>
    </x-markas.noise-background>
    import { Button } from "@/components/markas/Button";
    import { NoiseBackground } from "@/components/markas/NoiseBackground";
    
    export default function NoiseBackgroundExample() {
      return (
        <NoiseBackground
          color="warning"
          className="rounded-xl border border-line bg-surface px-6 py-14"
        >
          <div className="grid gap-4">
            <h2 className="text-3xl font-semibold tracking-tight text-balance text-ink">
              Design tools with a little texture
            </h2>
            <p className="max-w-80 text-sm text-muted">
              Brushes, grain, and paper that make digital work feel made by hand.
            </p>
            <div className="flex gap-2">
              <Button>Download the kit</Button>
              <Button variant="ghost">Browse samples</Button>
            </div>
          </div>
        </NoiseBackground>
      );
    }
    <script setup lang="ts">
    import Button from "@/components/markas/Button.vue";
    import NoiseBackground from "@/components/markas/NoiseBackground.vue";
    </script>
    
    <template>
      <NoiseBackground
        color="warning"
        class="rounded-xl border border-line bg-surface px-6 py-14"
      >
        <div class="grid gap-4">
          <h2 class="text-3xl font-semibold tracking-tight text-balance text-ink">
            Design tools with a little texture
          </h2>
          <p class="max-w-80 text-sm text-muted">
            Brushes, grain, and paper that make digital work feel made by hand.
          </p>
          <div class="flex gap-2">
            <Button>Download the kit</Button>
            <Button variant="ghost">Browse samples</Button>
          </div>
        </div>
      </NoiseBackground>
    </template>
    <script lang="ts">
      import Button from "$lib/components/markas/Button.svelte";
      import NoiseBackground from "$lib/components/markas/NoiseBackground.svelte";
    </script>
    
    <NoiseBackground
      color="warning"
      class="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <div class="grid gap-4">
        <h2 class="text-3xl font-semibold tracking-tight text-balance text-ink">
          Design tools with a little texture
        </h2>
        <p class="max-w-80 text-sm text-muted">
          Brushes, grain, and paper that make digital work feel made by hand.
        </p>
        <div class="flex gap-2">
          <Button>Download the kit</Button>
          <Button variant="ghost">Browse samples</Button>
        </div>
      </div>
    </NoiseBackground>
    ---
    import Button from "@/components/markas/Button.astro";
    import NoiseBackground from "@/components/markas/NoiseBackground.astro";
    ---
    
    <NoiseBackground
      color="warning"
      class="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <div class="grid gap-4">
        <h2 class="text-3xl font-semibold tracking-tight text-balance text-ink">
          Design tools with a little texture
        </h2>
        <p class="max-w-80 text-sm text-muted">
          Brushes, grain, and paper that make digital work feel made by hand.
        </p>
        <div class="flex gap-2">
          <Button>Download the kit</Button>
          <Button variant="ghost">Browse samples</Button>
        </div>
      </div>
    </NoiseBackground>
    import { Component } from "@angular/core";
    import { Button } from "./markas/button.component";
    import { NoiseBackground } from "./markas/noise-background.component";
    
    @Component({
      selector: "markas-example",
      imports: [Button, NoiseBackground],
      template: `
        <div
          markas-noise-background
          color="warning"
          class="rounded-xl border border-line bg-surface px-6 py-14"
        >
          <div class="grid gap-4">
            <h2 class="text-3xl font-semibold tracking-tight text-balance text-ink">
              Design tools with a little texture
            </h2>
            <p class="max-w-80 text-sm text-muted">
              Brushes, grain, and paper that make digital work feel made by hand.
            </p>
            <div class="flex gap-2">
              <button markas-button>Download the kit</button>
              <button markas-button variant="ghost">Browse samples</button>
            </div>
          </div>
        </div>
      `,
    })
    export default class NoiseBackgroundExample {}

    Contoh

    Pemutaran film

    Premieres Friday

    The Last Release

    A documentary about the team that shipped on time, every time.

    Premieres Friday

    The Last Release

    A documentary about the team that shipped on time, every time.

    Premieres Friday

    The Last Release

    A documentary about the team that shipped on time, every time.

    Premieres Friday

    The Last Release

    A documentary about the team that shipped on time, every time.

    Premieres Friday

    The Last Release

    A documentary about the team that shipped on time, every time.

    Daftar newsletter

    The Sunday Letter

    One long read, three links, and no noise. Every Sunday morning.

    The Sunday Letter

    One long read, three links, and no noise. Every Sunday morning.

    The Sunday Letter

    One long read, three links, and no noise. Every Sunday morning.

    The Sunday Letter

    One long read, three links, and no noise. Every Sunday morning.

    The Sunday Letter

    One long read, three links, and no noise. Every Sunday morning.

    Bilah statistik

    Teams
    12k
    Uptime
    99.98%
    Rating
    4.9
    Teams
    12k
    Uptime
    99.98%
    Rating
    4.9
    Teams
    12k
    Uptime
    99.98%
    Rating
    4.9
    Teams
    12k
    Uptime
    99.98%
    Rating
    4.9
    Teams
    12k
    Uptime
    99.98%
    Rating
    4.9

    Instalasi

    npx markasui@latest add noise-background

    Pemakaian

    <x-markas.noise-background color="warning" class="rounded-xl border border-line bg-surface px-6 py-14">
        <h2 class="text-3xl font-semibold text-ink">Alat desain dengan sedikit tekstur</h2>
        <x-markas.button>Unduh kit</x-markas.button>
    </x-markas.noise-background>

    Tidak butuh JavaScript atau Alpine.js.

    import { Button } from "@/components/markas/Button";
    import { NoiseBackground } from "@/components/markas/NoiseBackground";
    
    <NoiseBackground
      color="warning"
      className="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <h2 className="text-3xl font-semibold text-ink">
        Alat desain dengan sedikit tekstur
      </h2>
      <Button>Unduh kit</Button>
    </NoiseBackground>;
    <template>
      <NoiseBackground
        color="warning"
        class="rounded-xl border border-line bg-surface px-6 py-14"
      >
        <h2 class="text-3xl font-semibold text-ink">
          Alat desain dengan sedikit tekstur
        </h2>
        <Button>Unduh kit</Button>
      </NoiseBackground>
    </template>
    <script lang="ts">
      import Button from "$lib/components/markas/Button.svelte";
      import NoiseBackground from "$lib/components/markas/NoiseBackground.svelte";
    </script>
    
    <NoiseBackground
      color="warning"
      class="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <h2 class="text-3xl font-semibold text-ink">
        Design tools with a little texture
      </h2>
      <Button>Download the kit</Button>
    </NoiseBackground>
    ---
    import Button from "@/components/markas/Button.astro";
    import NoiseBackground from "@/components/markas/NoiseBackground.astro";
    ---
    
    <NoiseBackground
      color="warning"
      class="rounded-xl border border-line bg-surface px-6 py-14"
    >
      <h2 class="text-3xl font-semibold text-ink">
        Design tools with a little texture
      </h2>
      <Button>Download the kit</Button>
    </NoiseBackground>
    import { Component } from "@angular/core";
    import { Button } from "./markas/button.component";
    import { NoiseBackground } from "./markas/noise-background.component";
    
    @Component({
      selector: "app-kit",
      imports: [Button, NoiseBackground],
      template: `
        <div
          markas-noise-background
          color="warning"
          class="rounded-xl border border-line bg-surface px-6 py-14"
        >
          <h2 class="text-3xl font-semibold text-ink">
            Design tools with a little texture
          </h2>
          <button markas-button>Download the kit</button>
        </div>
      `,
    })
    export class Kit {}

    Angular memakai attribute selector pada div native, jadi class, aria-*, dan atribut lain tetap di elemen akar.

    • Tekstur berupa satu tile SVG feTurbulence yang disisipkan sebagai data URL dan dipakai sebagai mask CSS di atas token ink, jadi ikut mode terang dan gelap. Browser merendernya sekali lalu mengulangnya.
    • Hanya gradien di bawah tekstur yang bergerak, lewat transform pelan. Butirannya statis, jadi tidak ada kerja per frame.
    • variant="film" menambah vignette yang menggelapkan tepi di kedua tema.
    • Komponen ini tidak punya teks bawaan, jadi tidak ada prop label yang perlu diterjemahkan.

    Props

    NamaTipeDefaultKeterangan
    variantgrain | film | papergraingrain: butiran halus. film: butiran dengan vignette gelap di tepi. paper: serat kertas bergaris yang lembut.
    colorprimary | success | warning | danger | mutedprimaryToken untuk gradien di bawah tekstur.
    intensitylow | medium | highmediumSeberapa terlihat teksturnya.
    sizefine | medium | coarsemediumUkuran satu tile noise: 120px, 200px, atau 320px. Tile lebih besar memberi butiran lebih kasar.
    speedslow | normal | fastnormalKecepatan gradien bergeser: 30s, 18s, atau 10s per siklus. Teksturnya sendiri tidak bergerak.
    children / slotslot / ReactNode-Konten yang tampil di atas tekstur.

    Aksesibilitas

    • Lapisan tekstur memakai aria-hidden dan mengabaikan pointer.
    • Butiran memakai token ink dengan opacity rendah, jadi teks ink dan muted tetap kontras.
    • Dengan reduced motion, gradien berhenti bergeser.

    Komponen terkait

    Komponen latar lain dengan class yang sama di setiap framework.