Skip to content

Inline Calendar Datepicker

Always-visible Bootstrap 6 inline Datepicker for booking a consultation, with closed weekends, fully booked days, a preselected date and time slots for the chosen day.

Also known as: inline calendar, always visible calendar, appointment booking calendar, consultation scheduler, calendar with time slots

Inline Calendar Datepicker live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

An always-visible Bootstrap 6 Datepicker for a consultation booking page. The inline calendar marks a preselected day, closed weekends and fully booked dates in three distinct styles. Picking a day fills a panel of start times beside it. It suits appointment, clinic and demo-call booking pages.

How it works

The calendar is a plain <div class="icd-cal" data-bs-toggle="datepicker" data-bs-inline="true">. script.js imports Datepicker from the Bootstrap 6 bundle and creates the inline instance itself, so it can pass Vanilla Calendar Pro options through vcpOptions:

  • disableDatesPast and dateMin (tomorrow) block today and earlier. dateMax comes from data-icd-max-days.
  • disableWeekdays uses CLOSED_WEEKDAYS (Saturday and Sunday).
  • disableDates lists the fully booked days. They are built from the day offsets in data-icd-booked, so the sample never shows stale dates.
  • onCreateDateEls adds .icd-booked to those cells, so CSS can draw them in pink with a strikethrough, while closed weekends get a grey tile.
  • styles.calendar is set to vc icd-cal, because Vanilla Calendar Pro replaces the class list of the element it renders into.

selectedDates preselects the first open, not fully booked weekday from two days ahead. The change.bs.datepicker event passes the chosen date to renderTimes(). It writes the ISO date into the hidden .icd-date-value input (kept outside the calendar, which replaces its own HTML), prints the date in .icd-day and builds .btn-check radios from TIMES. Times returned by takenTimes() are disabled. Clicking the selected day again deselects it and shows the .icd-empty hint. Confirming simulates a request, marks that time as taken and shows the .icd-done alert.

Customization

  • data-icd-booked on .icd-root: comma-separated day offsets from today that are fully booked, e.g. 1,4,8,11.
  • data-icd-max-days on .icd-root: how far ahead visitors can book (60 days by default).
  • CLOSED_WEEKDAYS and TIMES in script.js: opening days and the start times offered.
  • Replace takenTimes() with data from your API, and the setTimeout in the submit handler with a fetch() POST.
  • --icd-plum, --icd-booked and --icd-blush on .icd-root: accent, booked-day and background colors. The calendar reads them through --bs-datepicker-day-selected-bg and the other variables on .icd-cal.

Use cases

  • Consultation booking: an always-visible calendar shows available days with weekends closed
  • Service and clinic sites: fully booked days are disabled and a preselected date saves a click
  • Scheduling pages: time slots for the chosen day appear next to the calendar
  • Sales and demo requests: visitors pick a day and a slot without opening a popup

Accessibility

Vanilla Calendar Pro renders date cells as a grid with role="gridcell", aria-selected and aria-current="date", and disabled days cannot be focused. The calendar wrapper is a labelled group, and the legend explains the colors in text, so color is not the only cue. Booked days also use a strikethrough. Time choices are native radio buttons in a fieldset with a hidden legend, so arrow keys move between them, and taken times are disabled. The selected day heading and the success alert are live regions.

Bootstrap 6 notes

Bootstrap 5 had no calendar, so this needed a plugin. Bootstrap 6 adds Datepicker with an inline mode (data-bs-inline="true") and passes extra calendar options through vcpOptions. Radio buttons styled as buttons are <label class="btn-check btn-outline theme-primary"> with the input inside, avatars use the new .avatar class, and alerts are alert theme-success. Built on 6.0.0-alpha.1, so the Datepicker API may still change. Icons come from Bootstrap Icons.

Inline Calendar Datepicker 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
Category
Date Pickers
License
Free for personal and commercial use

Questions about this template

Can I use the Inline Calendar Datepicker 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.

Inline Calendar Datepicker – free Bootstrap 6 date picker template
Inline Calendar Datepicker · free Bootstrap 6 date picker template

More Date Pickers

Booking Form with Datepicker – free Bootstrap 6 date picker template

Booking Form with Datepicker

Bootstrap 6 restaurant booking form with an inline Datepicker limited to the next 60 days, a guest stepper, a time select with booked slots and a live summary.

Date Range Picker – free Bootstrap 6 date picker template

Date Range Picker

Dark Bootstrap 6 Datepicker in range mode for cabin bookings: a two-month calendar fills check-in and check-out, counts nights, adds guests and totals the price.

Datepicker Input – free Bootstrap 6 date picker template

Datepicker Input

Bootstrap 6 Datepicker on a delivery form input with min and max dates relative to today, closed Sundays, a time-window picker, validation and a simulated booking.

Date Picker Dropdown – free Tailwind CSS date picker template

Date Picker Dropdown

Accessible Tailwind CSS date picker: a text input with a calendar popup, keyboard grid navigation, locale-aware labels and min/max dates.