Contact Form with Consent & Privacy Notice

This contact form includes an explicit consent checkbox and privacy notice, helping businesses meet compliance requirements while building user trust.

HTML

<form class="contact-consent">
  <h3>Contact Us</h3>
  <p class="subtitle">We respect your privacy</p>

  <input type="text" placeholder="Your name" required>
  <input type="email" placeholder="Email address" required>

  <textarea rows="4" placeholder="Your message" required></textarea>

  <label class="consent">
    <input type="checkbox" required>
    I agree to the processing of my data according to the
    <a href="#" target="_blank">Privacy Policy</a>.
  </label>

  <button type="button">Send Message</button>

  <p class="notice">
    Your information will only be used to respond to your inquiry.
  </p>
</form>

Replace type="button" with type="submit" and link the Privacy Policy properly.

CSS

:root{
  --bg:#f8fafc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;

  --primary:#2563eb;
  --primary-dark:#1d4ed8;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#020617;
    --card:#020617;
    --text:#e5e7eb;
    --muted:#94a3b8;
    --border:#1f2937;

    --primary:#3b82f6;
    --primary-dark:#60a5fa;
  }
}

.contact-consent{
  max-width:420px;
  margin:80px auto;
  padding:32px;

  background:var(--card);
  border-radius:18px;
  border:1px solid var(--border);
  box-shadow:0 16px 40px rgba(0,0,0,.12);

  font-family:system-ui, -apple-system, sans-serif;
  color:var(--text);
}

.contact-consent h3{
  font-size:22px;
  margin-bottom:6px;
}

.contact-consent .subtitle{
  font-size:14px;
  color:var(--muted);
  margin-bottom:22px;
}

.contact-consent input,
.contact-consent textarea{
  width:100%;
  padding:14px 16px;
  margin-bottom:16px;

  border-radius:12px;
  border:1px solid var(--border);
  background:linear-gradient(180deg,var(--card),var(--bg));
  color:var(--text);
  font-size:15px;

  outline:none;
  resize:none;
  transition:border .2s ease, box-shadow .2s ease;
}

.contact-consent input::placeholder,
.contact-consent textarea::placeholder{
  color:var(--muted);
}

.contact-consent input:focus,
.contact-consent textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(37,99,235,.18);
}

.consent{
  display:flex;
  gap:10px;
  align-items:flex-start;

  font-size:13px;
  color:var(--muted);
  margin:12px 0 20px;
  line-height:1.4;
}

.consent input{
  margin-top:3px;
  accent-color:var(--primary);
}

.consent a{
  color:var(--primary);
  text-decoration:none;
}

.consent a:hover{
  text-decoration:underline;
}

.contact-consent button{
  width:100%;
  padding:14px;

  border:none;
  border-radius:12px;
  background:linear-gradient(
    135deg,
    var(--primary),
    var(--primary-dark)
  );

  color:#ffffff;
  font-size:15px;
  font-weight:600;
  cursor:pointer;

  transition:transform .15s ease, box-shadow .15s ease;
}

.contact-consent button:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 30px rgba(0,0,0,.2);
}

.contact-consent button:active{
  transform:translateY(0);
  box-shadow:none;
}

.notice{
  margin-top:14px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

Notes

  • GDPR & privacy friendly
  • Builds trust and transparency
  • Required for many business sites
  • Backend-ready for consent logging

Preview styles shown. Production customization recommended.

Browse More UI Components

Explore hundreds of reusable HTML & CSS UI components built for modern web projects.
Discover buttons, cards, loaders, animations, layouts, and more all with live previews and clean, copy-paste code.

Leave a Reply

Your email address will not be published. Required fields are marked *