Contact

Contact form patterns with split layouts, contact information sidebars, and map integration. Accessible and responsive designs for customer communication.

Overview

Contact forms are essential for user communication. These patterns demonstrate various layouts from simple centered forms to complex split designs with contact information and map placeholders.

Key features:

  • <form-field> for consistent input styling and validation
  • <textarea> with appropriate rows attribute for message input
  • <layout-sidebar> for split layouts with contact information
  • <icon-wc> for visual contact method indicators
  • Proper autocomplete attributes for form autofill
  • Accessible validation with <output> and aria-live

Simple Contact Form

A centered contact form using data-layout="cover" for vertical centering. Includes name, email, and message fields with validation support.

Split Layout with Contact Info

A two-column layout using <layout-sidebar> with the form as the main content and contact information in the sidebar. Includes address, phone, email, and business hours.

Contact Info Styles

With Map

Contact form with a <geo-map> component for displaying your location. Uses a centered header above a split layout with free OpenStreetMap tiles.

Map Styles

Configuration

Key configuration options for contact forms:

Element/Attribute Purpose Options
textarea rows Message field height 4, 5, 6 (adjust to content needs)
layout-sidebar data-sidebar-width Contact info sidebar width narrow, default, wide
layout-sidebar data-content-min Minimum form width before wrapping 45, 50, 60 (percentage)
data-layout="split" Side-by-side form fields Use for first/last name pairs
autocomplete Enable browser autofill name, email, tel, given-name, family-name

Usage Notes

  • Required fields: Mark essential fields with required attribute; <form-field> adds visual asterisk automatically
  • Validation messages: Use <output class="error"> with aria-describedby linking to the input
  • Success states: Consider showing a success message or redirecting after submission
  • Spam prevention: Add honeypot fields or CAPTCHA for production forms
  • Map integration: The <geo-map> component uses free OpenStreetMap tiles — no API key needed
  • Phone links: Use tel: protocol for clickable phone numbers on mobile
  • Email links: Use mailto: protocol for email addresses
  • Accessibility: All form fields have labels, icons have appropriate aria attributes

Related

Sign In

Login form patterns with validation

Form Field

Form field element with validation

Layout Sidebar

Sidebar layout for split designs

Icon

Icon component for contact indicators

Geo Map

Map component for location display