Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Contact Form Sheet for Solid

A Contact Us button opens a right-side sheet with name, email, and message fields and a Send Message button.

UI library: Ark UI

Contact Us is both the button and the title. The description offers to write back. Name, Email, and Message are empty, and Send Message sits under them.

Use it so people can write in without leaving the page. A Popover is lighter for a one-line note. In Solid, Ark UI does not send the message.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Sheet anatomy: content, close, title, description, footer

Usage

<Sheet>
    <SheetTrigger asChild={props => <Button {...props()}>Contact Us</Button>} />
    <SheetContent>
      <SheetHeader>
        <SheetTitle>Contact Us</SheetTitle>
        <SheetDescription>
          Send us a message and we&apos

FAQ

Which fields does the form have?

Name, Email and Message, each an input with a placeholder. Email uses type="email", so phones show the email keyboard. For long messages, swap the Message input for a Textarea.

Does Send Message submit anything?

Not yet: the fields aren't in a form and the button has no handler. Wrap the FieldGroup in a form with an onSubmit, and give the button type="submit".

How do I close the sheet after sending?

Control the open state and set it to false once the message is sent: Pass open to Sheet and read details.open in onOpenChange.

How are the labels tied to the inputs?

Each label and input share a Field, so clicking Name focuses the name input and screen readers announce the label with it.

How does Contact Us open the sheet?

The button labeled Contact Us is the trigger, and its text is the accessible name. asChild on SheetTrigger receives props: spread them onto the button.

What does the contact sheet announce?

SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. It reads Contact Us, with Send us a message and we'll get back to you soon as the description.

API Reference

Sheet

Sets asChild and props. The rest is on the Sheet page.

Button

Sets props. The rest is on the Button page.