Skip to content

Feedback Form with Rating

Dark Bootstrap 6 feedback form with an accessible 5-star rating, tag chips, a comment with character counter, an optional contact switch and a thank-you state.

Also known as: feedback form, star rating form, customer feedback form, review form with rating, rating and comment form

Bootstrap 6 Contact Forms Responsive Dark #dark #feedback #form #rating #stars

Feedback Form with Rating live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A dark feedback form built with Bootstrap 6, for post-purchase surveys, support tickets or in-app "rate your experience" prompts. It has a five-star rating, quick tag chips, a comment box with a live character counter, an optional "contact me" switch, and a thank-you state after sending.

How it works

The root .fbr-root is pinned to data-bs-theme="dark", so Bootstrap's form controls use their dark tokens in every OS mode. The form uses data-bs-validate and novalidate, so Bootstrap shows .invalid-feedback through :user-invalid without extra CSS.

The rating is a <fieldset class="fbr-rating"> with five real radio inputs (.fbr-star-input), each followed by a <label class="fbr-star"> that draws an inline SVG star. CSS alone fills the stars up to the checked one (.fbr-star-input:checked + .fbr-star ~ .fbr-star) and previews the hovered star with :has(.fbr-star:hover). The script only updates the .fbr-word text ("Good", "Excellent") from the WORDS array.

A rating of LOW_RATING (2) or lower makes the comment required. The script sets setCustomValidity() on .fbr-comment until it has 10 characters and changes the placeholder to ask what went wrong. The counter .fbr-count follows maxlength and turns amber after 90 percent.

The "What stood out?" tags are Bootstrap 6 .chip buttons. A click toggles .active and aria-pressed. The .switch reveals .fbr-email, makes the email required and focuses it.

On submit the script calls preventDefault(), checks the rating and the form, then simulates sending with a spinner. It hides the form and shows .fbr-thanks with a summary. "Edit my answer" brings the form back with the answers still in place. "Not now" shows a short message instead.

Customization

  • --fbr-violet and the --bs-primary-* overrides on .fbr-root: change the button, switch, chip and focus color.
  • --fbr-star and --fbr-star-off: color the filled and empty stars.
  • --fbr-bg, --fbr-card and --fbr-line: adjust the page, card and border colors.
  • The WORDS array in script.js: rename the rating labels or translate them.
  • LOW_RATING in script.js: set the rating at or below which a comment becomes required.
  • data-fbr-tag on each .chip: sets the tag value sent with the form. Add or remove chips freely.
  • Replace the setTimeout in the submit handler with a fetch('/api/feedback', ...) call that posts payload.

Use cases

  • Product and app feedback: an accessible 5-star rating gathers a quick score
  • Customer support follow-ups: tag chips let users label what the feedback is about
  • Post-purchase surveys: a comment box with a character counter collects details
  • Privacy-friendly forms: an optional contact switch asks permission before a reply, then a thank-you state shows

Accessibility

The stars are native radios in a <fieldset> with a <legend>, so arrow keys change the rating and screen readers announce "4 stars, good" from the visually hidden label text. The focused star shows an outline. .fbr-word is a polite live region. Chips use aria-pressed, the switch uses role="switch" with aria-expanded, and errors are linked with aria-describedby. The thank-you panel receives focus. Star animations are turned off under prefers-reduced-motion.

Bootstrap 6 notes

form-check and form-switch are replaced by <div class="switch"> with an <input switch> inside a .form-field. Tags use the new .chip component, buttons use btn-solid theme-primary and btn-text theme-secondary, and data-bs-validate replaces needs-validation. Built on Bootstrap 6.0.0-alpha.1, so APIs can still change. Icons come from Bootstrap Icons.

Feedback Form with Rating at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Contact Forms
License
Free for personal and commercial use

Questions about this template

Can I use the Feedback Form with Rating code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Feedback Form with Rating – free Bootstrap 6 contact form template
Feedback Form with Rating · free Bootstrap 6 contact form template

More Contact Forms

Quote Request Form – free Bootstrap 6 contact form template

Quote Request Form

Bootstrap 6 quote request form with service select, a budget Range with currency bubble, timeline cards, drag-and-drop file upload and CSS validation.

Contact Form with Map and Details – free Bootstrap 6 contact form template

Contact Form with Map and Details

Dark Bootstrap 6 contact section with an OpenStreetMap embed, address, phone, email and live opening hours, plus a validated form and Toast confirmation.

Contact Form with Validation – free Bootstrap 6 contact form template

Contact Form with Validation

Bootstrap 6 contact form with floating labels, CSS-only validation via data-bs-validate, a character counter, consent check and a simulated send with success alert.

Contact Form Card – free Tailwind CSS contact form template

Contact Form Card

Tailwind CSS contact form card with a topic select, live character counter and meter, inline validation and a simulated sending state.

Contact Form with Validation – free Bootstrap 5 contact form template

Contact Form with Validation

Bootstrap 5 contact form with floating labels, client-side validation, a character counter, a success message and a contact details panel.