Skip to content

Contact Section

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.

On this page
Used for
  • Talk to sales
  • Support request form
  • Partnership enquiry
  • Office and chat details

Examples

Layout

Installation

npx knowns-ui@latest add contact-section
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

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[]
Default4 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
Default10 / 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.

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

  1. 01Pairs a form of name, email, topic and message with a list of contact methods, each with a label, value, link, icon and note.
  2. 02Validates on submit and re-validates on every change afterwards, so each error clears as the field is fixed.
  3. 03Moves focus to the first invalid field in the order name, email, topic and message when a submit fails.
  4. 04Limits the message length from minMessage and maxMessage, and drops the topic Select when you pass an empty topics list.
  5. 05Replaces the form with a thank-you panel that keeps the form's measured height, and offers Send another message to reset.
  6. 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

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" }).

Need help?

Stuck on Contact Section, or found something off? We read every message.