The ways to reach you beside a short form: name, email, topic and message. It validates as people fix fields, then shows a thank-you of the same height so the page doesn't jump. The company, address and contact details are fictional.
- Talk to sales
- Support request form
- Partnership enquiry
- Office and chat details
Examples
Installation
npx knowns-ui@latest add contact-sectionPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Contact section from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/contact-section
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add contact-section
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- components/ui/knowns/textarea.tsx
- components/ui/knowns/chat-composer/use-autosize.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/input.tsx
- components/ui/knowns/blocks/marketing/marketing-2b-utils.ts
- components/ui/knowns/illustrations/illust-utils.ts
- components/ui/knowns/illustrations/use-in-view.ts
- components/ui/knowns/marquee/marquee.tsx
- components/ui/knowns/marquee/marquee-utils.ts
- components/ui/knowns/blocks/marketing/section-heading.tsx
- components/ui/knowns/blocks/marketing/marketing-utils.ts
- components/ui/knowns/select.tsx
- components/ui/knowns/blocks/marketing/contact-section.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/contact-section, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "contact-section" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- onSubmit
({ name, email, topic, message }) => Promise<void | string>- Gets trimmed values. Return a string or throw an Error to show a message.
- topics
string[]- Default
4 defaults - Choices for the topic select. [] drops the field.
- methods
{ label, value, href?, icon?, note? }[]- Default
[] - Email, chat, office, phone. MethodIcons has icons for these.
- minMessage / maxMessage
number- Default
10 / 2000 - Message length limits. The field shows a counter.
- layout
"split"|"cards"|"simple"- Default
"split" - Methods beside the form, methods as cards above it, or a centred form with the methods as links.
- formSide
"right"|"left"- Default
"right" - Split layout: which side the form sits on from 820px.
- successText
(values) => ReactNode- The thank-you text.
- eyebrow / title / lead
ReactNode- The heading beside the form.
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | ({ name, email, topic, message }) => Promise<void | string> | - | Gets trimmed values. Return a string or throw an Error to show a message. |
| topics | string[] | 4 defaults | Choices for the topic select. [] drops the field. |
| methods | { label, value, href?, icon?, note? }[] | [] | Email, chat, office, phone. MethodIcons has icons for these. |
| minMessage / maxMessage | number | 10 / 2000 | Message length limits. The field shows a counter. |
| layout | "split" | "cards" | "simple" | "split" | Methods beside the form, methods as cards above it, or a centred form with the methods as links. |
| formSide | "right" | "left" | "right" | Split layout: which side the form sits on from 820px. |
| successText | (values) => ReactNode | - | The thank-you text. |
| eyebrow / title / lead | ReactNode | - | The heading beside the form. |
Errors show after the first submit and clear as each field is fixed; focus moves to the first field that needs attention. Every field has a label, required fields are marked for screen readers, and errors are tied to their fields.
What it handles
- 01Pairs a form of name, email, topic and message with a list of contact methods, each with a label, value, link, icon and note.
- 02Validates on submit and re-validates on every change afterwards, so each error clears as the field is fixed.
- 03Moves focus to the first invalid field in the order name, email, topic and message when a submit fails.
- 04Limits the message length from minMessage and maxMessage, and drops the topic Select when you pass an empty topics list.
- 05Replaces the form with a thank-you panel that keeps the form's measured height, and offers Send another message to reset.
- 06Shows a failure from onSubmit, returned as a string or thrown, under the button, and lays out as split, cards or simple, with formSide to flip the split.
States
- First render
- Nothing. The form paints with its hint line
- none
- Field error
- The message appears under the field and clears when the value is fixed
- none, at once
- Sending
- The label hides and a spinner shows, and the fields are disabled
- none
- Sent
- The form becomes a thank-you panel of the same height
- none, at once
- Method link hover
- The link colour and underline change
- 120ms, ease out
- Reduced motion
- The spinner stops spinning
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The form paints with its hint line | none |
| Field error | The message appears under the field and clears when the value is fixed | none, at once |
| Sending | The label hides and a spinner shows, and the fields are disabled | none |
| Sent | The form becomes a thank-you panel of the same height | none, at once |
| Method link hover | The link colour and underline change | 120ms, ease out |
| Reduced motion | The spinner stops spinning | 0ms |
Works with
When to use
When to use
- A contact page: the ways to reach you and a short form for the rest.
- Sales or partnership enquiries routed by topic.
When not to use
- Questions with known answers: answer them first: use FAQ Section.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Contact Section to my app and wire it to my own data.
- I need a contact page: the ways to reach you and a short form for the rest. Set that up with the Knowns UI Contact Section.
- Which Contact Section props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "contact-section" }) and search_docs({ query: "contact section" }).