Skip to content
  • No data uploaded
  • Instant results

Bootstrap 5 Contact Form for Vanilla JS — Glassmorphism

A production-ready glassmorphism contact form: a contact card with name, email, a topic selector, a message textarea and a submit button. Pick your brand color, toggle dark mode and corner radius — the live preview and the Vanilla JS code update instantly in your browser.

Live component editor

Library
Framework
Style
Theme
Corner radius
Live preview
<!-- Requires Bootstrap 5.3 CSS + theme.css:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="theme.css"> -->
<div class="w-100 mw-lg p-5 glass shadow-lg rounded-3">
  <h2 class="fs-4 fw-bold text-body-emphasis">Get in touch</h2>
  <p class="mt-1 mb-4 small text-body-secondary">We usually reply within one business day.</p>
  <form class="d-flex flex-column gap-3">
    <div class="row row-cols-1 row-cols-md-2 g-2">
      <div class="col">
        <label for="cf-name" class="form-label small fw-medium">Name</label>
        <input id="cf-name" type="text" autocomplete="name" class="form-control rounded-2" required>
      </div>
      <div class="col">
        <label for="cf-email" class="form-label small fw-medium">Email</label>
        <input id="cf-email" type="email" autocomplete="email" class="form-control rounded-2" required>
      </div>
    </div>
    <div>
      <label for="cf-topic" class="form-label small fw-medium">Topic</label>
      <select id="cf-topic" class="form-control rounded-2">
        <option>General question</option>
        <option>Sales</option>
        <option>Support</option>
      </select>
    </div>
    <div>
      <label for="cf-message" class="form-label small fw-medium">Message</label>
      <textarea id="cf-message" rows="4" class="form-control rounded-2" placeholder="How can we help?" required></textarea>
    </div>
    <button type="submit" class="btn btn-brand fw-semibold rounded-2">Send message</button>
  </form>
</div>
All components →

Free Bootstrap 5 Contact Form for Vanilla JS — Glassmorphism by pGento

Install Bootstrap 5 for Vanilla JS

Include Bootstrap 5.3 from the CDN (or npm install bootstrap) and the generated theme.css:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="theme.css">

Use the contact form in Vanilla JS

Paste the markup where the component should appear. It is pure HTML/CSS — no JavaScript required.

Accessibility & customization

All controls have explicit labels, the <select> has a meaningful default option, and required fields use the native required attribute for built-in validation messages.

Every color, radius and dark-mode choice is baked into plain Bootstrap classes plus a tiny CSS-variable theme file, so the copied code has no runtime dependency on this site. The glass style relies on backdrop-filter, supported in all current browsers; place it over a colorful background for the best effect.

Compatibility

ItemDetails
CSS frameworkBootstrap 5.3+ (CSS only)
LibraryPlain HTML + optional vanilla JS
Interactive stateNone (static markup)
Dark modeYes — toggle in the editor
StyleGlassmorphism (backdrop blur)

Frequently asked questions

How do I install this Bootstrap contact form in Vanilla JS?
Create a web page, install Bootstrap 5 as shown in the installation section, then paste the generated code. Also save the generated theme.css file.
Can I change the color of the contact form?
Yes. Use the brand color picker or type any hex code — the preview and code update instantly, and the color is written directly into the classes you copy.
Does the contact form support dark mode?
Yes. Toggle “Dark mode” in the editor to generate a dark palette version of the same component.
Is the contact form accessible?
All controls have explicit labels, the <select> has a meaningful default option, and required fields use the native required attribute for built-in validation messages.
Is this component free for commercial use?
Yes. The generated code is yours to use in personal and commercial projects without attribution.
Bootstrap 5 Contact Form for Vanilla JS — Glassmorphism

Embed this tool on your site

Paste this code into any web page. It stays free, fast and ad-free inside your site.

Print or save as PDF

Prints just this tool and its result. Choose “Save as PDF” as the printer to get a file. Branding is stored only in this browser.