Skip to Content

Fracture Field

Barnett Newman style minimal painting background: a cream field with a narrow black mass on the left edge and a thin black vertical zip, plus grain. An optional one-shot entrance draws both and is skipped under reduced motion.

Installation

pnpm dlx shadcn@latest add @01orbital/fracture-field

Usage

import { cn } from "cn"

import { FractureField } from "@/components/scene/fracture-field"
import { SectionTitleGroup } from "@/components/section/section"
import { Subheading } from "@/components/subheading/subheading"
import { Text } from "@/components/text/text"
import { buttonVariants } from "@/components/ui/button"

const COPY = {
  title: "Form & space",
  body: "Notes on architecture and the objects we live with.",
  action: "Read the journal",
  href: "#",
} as const

export default function FractureFieldDemo() {
  return (
    // The journal's masthead face: Geist Serif on the heading.
    <section className="relative isolate flex min-h-[32rem] w-full flex-1 items-center overflow-hidden py-12 text-scene [--font-display:var(--font-serif)]">
      <FractureField />
      <div className="relative ml-[12%] w-[50%] md:ml-[14%] md:w-[38%]">
        {/* The heading, description and action are 24px apart. */}
        <SectionTitleGroup gap="lg">
          <Subheading>{COPY.title}</Subheading>
          <Text>{COPY.body}</Text>
        </SectionTitleGroup>
        <a
          href={COPY.href}
          className={cn(
            buttonVariants(),
            "mt-6 bg-scene text-scene-foreground hover:bg-scene/90"
          )}
        >
          {COPY.action}
        </a>
      </div>
    </section>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/fracture-field-demo

API reference

Full-bleed art layer: drop it inside a relative parent; it sits behind content. The black mass narrows from 8% to 5% and the zip moves from 58% to 70% on screens narrower than 48rem.

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs it for you.

Last updated on