Usage
import { PortfolioContact } from './PortfolioContact.jsx'
// Without onSend a brief is "sent" after a short wait. Wire it to your server:
<PortfolioContact
locale="en"
budgets={[{ id: 'small', name: 'Under $5k' }]}
onSend={async (brief) => (await fetch('/api/briefs', { method: 'POST', body: JSON.stringify(brief) })).ok}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text. |
onSend | ({ name, email, message, budget }) => Promise<boolean | void> | — | Sends a checked brief. Resolve false (or throw) to keep the form and show the error with “Send again”. |
budgets | Array<{ id, name }> | sample budgets | The budget choices; the second is chosen first. An empty array leaves the question out. |
defaultValues | { name?, email?, message?, budget? } | — | What the form starts with, for example a project named in a link. |
status | 'sending' | 'sent' | 'error' | — | Shows one state from outside, such as “sent” after a reload. |
onAnother | () => void | — | “Write another” was pressed on the sent card. |
maxLength | number | 2000 | The longest message; the count appears near the end. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
className | string | — | Added to the root section. |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
PortfolioContact.jsxportfolio-contact.csscopy.jskit.jsxkit.cssui/base-button/ui/alert-banner/ui/success-check/ui/chip-group/ui/text-input/ui/textarea/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.