Grain Kit
Grain toolkit: baked noise tiles as data URIs, a Grain Layers overlay and a grain style helper. Pick a finish such as micro, gray, felt or soft film and scale its strength over any art.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
Installation
pnpm dlx shadcn@latest add @01orbital/grain-kitnpx shadcn@latest add @01orbital/grain-kityarn dlx shadcn@latest add @01orbital/grain-kitbunx --bun shadcn@latest add @01orbital/grain-kitUsage
import { SideGlow } from "@/components/glow/side-glow"
import { Subheading } from "@/components/subheading/subheading"
import {
GrainLayers,
type GrainFinish,
} from "@/components/texture/grain-kit"
import {
D256,
DENSE,
GRITTY,
MICRO,
} from "@/lib/grain/black-alpha"
import { FELT, GREY } from "@/lib/grain/grey-static"
import { ENGINE, SOFT } from "@/lib/grain/paper-film"
const COPY = {
title: "Night notes",
body: "Written after sundown.",
} as const
// Every finish in the kit, by name; "none" draws no grain.
const FINISHES: { name: string; finish: readonly GrainFinish[] }[] = [
{ name: "none", finish: [] },
{ name: "soft", finish: [SOFT] },
{ name: "felt", finish: [FELT] },
{ name: "dense", finish: [DENSE] },
{ name: "gritty", finish: [GRITTY] },
{ name: "micro", finish: [MICRO] },
{ name: "engine", finish: [ENGINE] },
{ name: "d256", finish: [D256] },
{ name: "grey", finish: [GREY] },
{ name: "both", finish: [SOFT, DENSE] },
]
export default function GrainKitDemo() {
return (
<div className="grid min-h-full w-full flex-1 grid-cols-1 place-items-center gap-6 p-6 sm:grid-cols-2 xl:grid-cols-3">
{FINISHES.map(({ name, finish }) => (
<figure key={name} className="flex w-full flex-col items-center gap-3">
<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 />
<div aria-hidden="true">
<GrainLayers finish={finish} strength={1} />
</div>
<div className="relative">
<Subheading>{COPY.title}</Subheading>
<p className="mt-3 text-sm/6">{COPY.body}</p>
</div>
</article>
<figcaption className="text-sm text-foreground">{name}</figcaption>
</figure>
))}
</div>
)
}This example installs with everything it uses:
pnpm dlx shadcn@latest add @01orbital/grain-kit-demonpx shadcn@latest add @01orbital/grain-kit-demoyarn dlx shadcn@latest add @01orbital/grain-kit-demobunx --bun shadcn@latest add @01orbital/grain-kit-demoExamples
Embergrain-kit-ember
Grain Kit Ember: an example of grain-kit.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
pnpm dlx shadcn@latest add @01orbital/grain-kit-embernpx shadcn@latest add @01orbital/grain-kit-emberyarn dlx shadcn@latest add @01orbital/grain-kit-emberbunx --bun shadcn@latest add @01orbital/grain-kit-emberSagegrain-kit-sage
Grain Kit Sage: an example of grain-kit.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
pnpm dlx shadcn@latest add @01orbital/grain-kit-sagenpx shadcn@latest add @01orbital/grain-kit-sageyarn dlx shadcn@latest add @01orbital/grain-kit-sagebunx --bun shadcn@latest add @01orbital/grain-kit-sageAPI reference
A full-bleed grain overlay. Drop it inside a relative parent, over the art, and pass the finish to draw, or several to stack:
import { GRITTY } from "@01orbital/core/lib/grain/black-alpha" <div className="relative"><Painting /><GrainLayers finish={GRITTY} /></div>
It ignores the pointer and sits at z-10.
Prop
Type
Used in blocks
One block is built with Grain Kit.
Last updated on