Library / SDK
megh-bari/pattern-craft avatar
megh-bari/pattern-craft

Pattern Craft: Copy-Paste CSS Background Patterns for React and Tailwind

Professional-grade background patterns and gradients for your websites and apps. Easily copy and paste into your next project. Crafted with modern CSS and Tailwind for seamless integration.

3,085 stars232 forksTypeScriptMIT

At a glance

What is it?
Pattern Craft is a Next.js and TypeScript gallery of more than 100 CSS background patterns and gradients, and it ships its snippets as JSX with Tailwind classes rather than plain CSS. Here is what the repository actually gives you, and where it stops.
Who is it for?
Pattern Craft fits React and Next.js teams using Tailwind who need a background in an afternoon and do not want to write gradient math. It does not fit projects on plain HTML, vanilla CSS, or a non-Tailwind styling system: the README states the project does not provide plain HTML or vanilla CSS snippets, and every example is JSX.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 38 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 4, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Pattern Craft solves, and who it is aimed at

Background patterns sit in an awkward place. A dotted grid or a soft radial wash is a few lines of CSS, but getting the gradient stops, the tile size, and the layering to look intentional takes longer than the rest of the layout. Pattern Craft collects that work into a browsable gallery and hands you the result as a copyable snippet. The README describes it as "100+ modern CSS background patterns and gradient snippets" and names the audience directly: developers and designers working with React, Next.js, Vue, Angular, or any modern frontend framework. The listed use cases are hero sections, landing pages, cards and sections, and background art.

The repository itself is a Next.js 14 site with TypeScript and Tailwind CSS, deployed on Vercel. That matters for how you consume it. The product is the gallery and the snippets, not an npm package. There is no importable component library in package.json; the dependencies are the site's own UI stack (Radix tabs and slot, lucide-react, sonner, next-themes, geist). You take code out of the site or out of the pattern objects in the repository, not out of a registry.

How a pattern is actually structured

Each pattern is a plain object. The README gives the shape: an id, a name, an optional badge, a style object holding background, backgroundImage and backgroundSize, and a code string containing the JSX you paste. The style object drives the live preview on the site; the code string is what you copy. Keeping both means the preview and the snippet can drift apart if a contributor edits one and not the other, and nothing in the repository layout suggests a test that compares them.

The patterns are built from layered CSS gradients rather than image files, which is why the README can claim zero dependencies and pure CSS implementations. A typical backgroundImage stacks a repeating linear-gradient for the lines on top of a radial-gradient for the wash, and backgroundSize carries two values so each layer tiles at its own scale. That is the whole mechanism. There is no runtime, no build step on your side, and no JavaScript involved in rendering the pattern.

The customization tips in the README are the honest core of the project: change hex values in backgroundImage gradients, modify backgroundSize for scale, adjust gradient positions and directions, and add layers for more complex results. The worked example swaps #f0f0f0 for #3b82f6 and drops backgroundSize to "48px 32px" for a smaller grid. If you understand those two properties, you can stop browsing and write your own.

Installing Pattern Craft locally and copying your first pattern

The README requires Node.js 18+ and npm, yarn, pnpm, or bun. Cloning is the only install path it documents; there is no package to add to an existing app. Run these two commands to get the source and enter it.

bash
git clone https://github.com/megh-bari/pattern-craft.git
cd pattern-craft

Then install the dependencies. The README lists npm, yarn, and pnpm as equivalents; the npm form is shown here.

bash
npm install

Start the development server and open the local site.

bash
npm run dev

After that, open http://localhost:3000 in a browser. You should see the pattern gallery the README shows in its screenshots. For a production build the README gives two commands, npm run build followed by npm start.

Using a pattern in a React component

The README is explicit that snippets target JSX and Tailwind, so the paste target is a component. The generated code follows a fixed shape: a relative wrapper, an absolutely positioned layer that carries the inline background styles, and your content above it. The pattern below is the structure the README shows, with the gradient lines replaced by the customization example's blue variant.

tsx
export default function Hero() {
  return (
    <div className="min-h-screen w-full bg-white relative">
      <div
        className="absolute inset-0 z-0"
        style={{
          backgroundImage: `linear-gradient(to right, #3b82f6 1px, transparent 1px)`,
          backgroundSize: "48px 32px",
        }}
      />
      <div className="relative z-10">Your content here</div>
    </div>
  );
}

The z-index pairing is the part worth noticing. The pattern layer sits at z-0 and the content at z-10, so the background never intercepts clicks or covers text. If you drop the pattern layer into an existing component without that wrapper, the absolutely positioned div will sit over your layout instead of behind it.

The JSX-only decision is the biggest constraint

The README carries a note that is easy to skim past: "This project does not provide plain HTML or vanilla CSS snippets. All code is optimized for JSX (React/Next.js) and Tailwind CSS." A discussion link is attached to that announcement, which suggests it was a deliberate call rather than an oversight.

It is still a real limitation. The underlying patterns are pure CSS gradients, so the styles themselves are portable, but the delivered artifact is a JSX string with className attributes and an inline style object. If you work in Svelte, Astro, a server-rendered template, or a styling system that is not Tailwind, you are converting every snippet by hand: strip the JSX wrapper, move the style object into a stylesheet, and translate the utility classes. For one background that is ten minutes. For a design system that wants a dozen patterns, it is a chore the gallery does not do for you.

There is a second constraint in the packaging. package.json sets "private": true and version 0.1.0, and no releases were retrieved for the repository, so there is no published version to pin and no changelog to read. If you fork the site to add patterns, you are tracking main.

Pattern Craft compared with a CSS pattern generator

The closest alternative in practice is a CSS background pattern generator, the kind of tool that exposes sliders for tile size, line thickness, and two colors, then emits a single CSS rule you paste into a stylesheet. The difference is in the output format, not the visual result. A generator hands you CSS that works in any project and lets you tune parameters before copying; Pattern Craft hands you a finished JSX component with the values already chosen, and you tune them afterward by editing hex codes and backgroundSize.

That trade favors Pattern Craft when you want a decision made for you and your stack is React with Tailwind. It favors the generator when you need the snippet in plain CSS, when you want to see the effect of a parameter before committing to it, or when the pattern has to match a design token that already exists in your system. Pattern Craft's gallery is the appeal; its output format is the cost.

Maintenance, licensing, and what upgrading looks like

The last push to the repository was on 2026-09-02, so the project has seen recent commits. The README credits Vercel's OSS program as a sponsor, which the project says helps maintain a stable development environment. Beyond that, the repository gives no roadmap, and no releases were retrieved, so there is no version history to reason about.

For adoption purposes, the upgrade cost is close to zero and that is the point. You are copying a few lines of CSS gradients into your own files, so nothing breaks when the upstream project changes. The flip side is that you get no upstream fixes either: if a pattern has a rendering quirk in a particular browser, you own it once it is in your codebase.

The licence is MIT, which permits use, modification, and redistribution with the licence and copyright notice retained. That is permissive enough for commercial products, and it applies to the repository code and the snippets alike. This is a description of the licence text, not legal advice; check the LICENSE file in the repository root before you rely on it.

Editorial conclusion

Pattern Craft fits React and Next.js teams using Tailwind who need a background in an afternoon and do not want to write gradient math. It does not fit projects on plain HTML, vanilla CSS, or a non-Tailwind styling system: the README states the project does not provide plain HTML or vanilla CSS snippets, and every example is JSX. Before adopting, open a pattern you like on https://patterncraft.store, copy its code field, and check whether the inline style block drops into your component unchanged. The licence is MIT, so the snippets can travel into your codebase, but the repository carries version 0.1.0 and no releases were retrieved, so treat the git history as the only versioning you have.

Frequently asked questions

Does Pattern Craft work with plain HTML and vanilla CSS?

No. The README states that the project does not provide plain HTML or vanilla CSS snippets and that all code is optimized for JSX (React/Next.js) and Tailwind CSS. The underlying gradients are standard CSS, so you can convert a snippet manually, but the gallery does not ship that version.

Is Pattern Craft free to use in a commercial project?

The repository is licensed under MIT, which permits use, modification, and redistribution provided the licence and copyright notice are kept. The README does not add any separate commercial restriction.

How do I install Pattern Craft?

There is no package to install. The README documents cloning the repository, running npm install, and starting the site with npm run dev on http://localhost:3000. To use a pattern in your own app you copy the snippet from the site or from the pattern object in the source.

How do I change the colors or size of a pattern?

The README's customization tips say to change the hex values inside the backgroundImage gradients and to modify the backgroundSize values for a different scale. Its worked example replaces #f0f0f0 with #3b82f6 and sets backgroundSize to "48px 32px".

Official sources

  1. Issues
  2. License: MIT
  3. megh-bari/pattern-craft on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/megh-bari-pattern-craft.svg)](https://hysenlabs.com/projects/megh-bari-pattern-craft)