Contact section
A validated contact form that morphs into a confirmation, support channels, and office cards with local times.
npx shadcn@latest add @silicon-ui/contact-sectionInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/contact-sectionManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/blocks/contact-section/contact-section.tsx
- components/silicon-ui/blocks/contact-section/contact-section.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/media.ts
- components/silicon-ui/textarea/textarea.tsx
- components/silicon-ui/textarea/textarea.module.css
- components/silicon-ui/segmented-control/segmented-control.tsx
- components/silicon-ui/segmented-control/segmented-control.module.css
- components/silicon-ui/input/input.tsx
- components/silicon-ui/input/input.module.css
- components/silicon-ui/copy-button/copy-button.tsx
- components/silicon-ui/copy-button/copy-button.module.css
- components/silicon-ui/lib/use-copy-feedback.ts
- components/silicon-ui/button/button.tsx
- components/silicon-ui/button/button.module.css
- components/silicon-ui/avatar/avatar.tsx
- components/silicon-ui/avatar/avatar.module.css
- components/silicon-ui/lib/silicon-provider.tsx
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
ContactSection
| Prop | Type | Default |
|---|---|---|
variant`form` validates and morphs into a confirmation, `channels` lists ways to reach you, `offices` shows live local times. | ContactSectionVariant
| "form" |
title | string | — |
description | string | — |
topicsTopics offered in the form. | string[] | ["Sales", "Support", "Partnerships", "Press"] |
onSubmitCalled with a valid message. Reject to keep the form and show an error; resolve to show the confirmation. | (message: ContactMessage) => void | Promise<void> | — |
channels | ContactChannel[] | contactExampleChannels |
channelSelected channel (controlled). | string | — |
defaultChannel | string | — |
onChannelChange | (value: string) => void | — |
offices | ContactOffice[] | contactExampleOffices |
className | string | — |
Also accepts the props of HTMLAttributes.
ContactSectionBlock
| Prop | Type | Default |
|---|---|---|
variant | ContactSectionVariant
| "form" |