Sections
All-AccessNewWebGLA commission enquiry over a photographed flatweave that weaves as the form validates; the hand parts the threads.
Use Weft for a made-to-order enquiry: a form that is worth filling in slowly, beside the studio's address and hours. Each valid field weaves its band of cloth; sending weaves the border.
pnpm dlx shadcn@latest add @motionkit-pro/weftnpx shadcn@latest add @motionkit-pro/weftyarn dlx shadcn@latest add @motionkit-pro/weftbunx --bun shadcn@latest add @motionkit-pro/weftRequires an All-Access or Signature license and the @motionkit-pro registry with your token. See Installation.
The files land in components/sections/.
import { Weft } from "@/components/sections/weft"
export default function Page() {
return (
<Weft
image="/rug-stripes.jpg"
content={{
eyebrow: "Commissions",
title: "Tell us about the room.",
lede: "Every piece is made once, to size.",
details: [{ label: "Studio", value: "12 Mill Lane, Leeds" }],
}}
onSubmit={async (values) => {
const res = await fetch("/api/enquiry", { method: "POST", body: JSON.stringify(values) })
return (await res.json()).reference
}}
/>
)
}Every text sits in one typed content prop; each key you pass replaces the default copy (a rug
workshop), and messages is merged key by key.
| Key | Type | Notes |
|---|---|---|
eyebrow, title, lede | ReactNode | Heading column on the woven field. |
details | { label, value: ReactNode }[] | Address, hours, phone, reply time (two columns). |
formTitle, formLede, tag | ReactNode / string | The form's label and the woven tag on its corner. |
name, email, room, width, length, unit, palette, message, consent | string / ReactNode | Field labels. |
nameHint, emailHint, roomHint, consentHint | ReactNode | Hints under the fields. |
count | (count, min) => string | Live count under the message. |
submit, submitNote, sending | string / ReactNode | The send button and the line beside it. |
successTitle, successReference, successSteps, again | mixed | The panel shown once sent. |
messages | Partial<WeftMessages> | Validation and failure messages. |
palettes (yarns offered in the form), minMessage, roomRange and reference are props of
their own. onSubmit(values) may return or resolve to the enquiry reference; a rejection shows
messages.failed.
The demo image stays on this site and is not installed: pass your own through image.
| Prop | Type | Ratio | Transparent | Max weight | Notes |
|---|---|---|---|---|---|
image | string | any; 1600–2048 px wide | no | 400 KB | A straight-on photograph of a striped flatweave. Its four main yarns and its plain stripes are found in the image and re-dyed with the chosen palette; the busiest rows become the border. |
Use WebP or JPEG on your own origin or with CORS headers. A photograph without stripes still
weaves (its rows are re-dyed), but horizontal stripes read best. Without image a drawn kilim in
the same layout is woven.
loom (default): cloth across the section. Preview it with ?demo=default.selvedge: a narrow strip of cloth, calm paper elsewhere. Preview it with ?demo=selvedge.sampler: woven from the start; validity sets each stripe's dye. Preview it with ?demo=sampler.Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH. field and onField
are the woven heading column and its text, ecru the bare warp, backdrop the room behind it,
paper and ink the form's label, accent the send button, error and success the field
states and wood the shuttle. The yarns come from palettes.
<Weft
colors={{
field: "#1f3a7a",
onField: "#f4ecd8",
ecru: "#eee3cb",
backdrop: "#141b2e",
paper: "#fbf7ee",
ink: "#1d2333",
accent: "#b8402a",
error: "#a8321f",
}}
palettes={[{ value: "sea", label: "Sea", yarns: ["#1f6f8b", "#e8c468", "#20304f"] }]}
/>use-prefers-reduced-motion, fx-runtime, fx-glsl, section-runtime.aria-invalid and error text; the first invalid field takes
focus on send and the success panel is announced.stack: the heading column sits above the form. On touch screens a slow strum crosses the warp
every nine seconds; vertical scroll is never blocked.
The cloth is woven and still; validation changes stripes in one step, the shuttle only fades.
ogl loads the first time the section nears the viewport; until then (and without WebGL) the
photograph and a flat field stand in.pnpm size).Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 16.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
—
The cloth is woven and still; validation changes stripes in one step, the shuttle only fades.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)