Skip to Content

Gritty Grain

Gritty grain texture: coarse black noise like raw canvas, using the same paired tiles as Dense Grain at roughly double the opacity. A full-bleed overlay; the tile is exported for reuse.

Installation

pnpm dlx shadcn@latest add @01orbital/gritty-grain

Usage

import { SideGlow } from "@/components/glow/side-glow"
import { Subheading } from "@/components/subheading/subheading"
import { GrittyGrain } from "@/components/texture/gritty-grain"

const COPY = {
  title: "Night notes",
  body: "Written after sundown.",
} as const

export default function GrittyGrainDemo() {
  return (
    <div className="flex min-h-full w-full flex-1 items-center justify-center p-6">
      <article className="relative isolate flex aspect-4/3 w-full max-w-96 flex-col justify-end overflow-hidden rounded-3xl bg-[oklch(0.372_0.044_257.3)] p-8 text-scene-foreground">
        <SideGlow />
        <GrittyGrain />
        <div className="relative">
          <Subheading>{COPY.title}</Subheading>
          <p className="mt-3 text-sm/6">{COPY.body}</p>
        </div>
      </article>
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/gritty-grain-demo

Examples

Claygritty-grain-clay

Gritty Grain Clay: an example of gritty-grain.

pnpm dlx shadcn@latest add @01orbital/gritty-grain-clay

Mossgritty-grain-moss

Gritty Grain Moss: an example of gritty-grain.

pnpm dlx shadcn@latest add @01orbital/gritty-grain-moss

API reference

Gritty black grain: coarse, like raw canvas. The parent needs relative.

It accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs it for you.

Last updated on