Book button
A link into your booking page, for a banner, a room page or an offer.
- Box
data-pms-booking="book-button"- Goes on
- Any page
- Drawn
- On your page, in a shadow root
- Own HTML instead
- Yes — recommended
The ready component
One line to paste. It wears the property’s branding from the PMS until your site’s stylesheet says otherwise.
- Place the script once, on every page that shows a component — see Install the script.
- Paste the component where it should appear.
<div data-pms-booking="book-button"></div>Live preview on a sample hotel — invented rooms and prices, placeholder pictures. Open in a new tab
The live preview runs only when these docs are opened on a developer's own machine.
<div data-pms-booking="book-button"></div>Settings
What the component shows and where it leads — attributes on its box.
| Attribute | Values | What it does |
|---|---|---|
data-label | text, up to 60 characters | The button's words. Left out: Book now, in the page's language. |
data-room | room type id | Opens the booking on this room's rates instead of the room list. |
data-plan | rate plan id | Together with data-room: opens the booking with this rate plan chosen. |
data-stay | "tomorrow" | "weekend" | A stay counted from the visitor's today. tomorrow: one night from tomorrow. weekend: the coming Friday to Sunday — on a Saturday, that Saturday to Sunday. |
data-check-in, data-check-out | YYYY-MM-DD | Exactly these dates; check-out is the day of departure. Both are needed, in order. They win over data-stay. |
data-adults | 1–20 — default 2 | The number of adults the booking opens with. |
data-child-ages | ages 0–17, comma-separated | The children the booking opens with, one age per child. The list counts only whole: with an entry that is not a whole number from 0 to 17, with more than eight ages, or with a child the property books as an adult, it is ignored and the party is the adults alone. |
How it looks — colours, corners, fonts — is not an attribute. Your site’s stylesheet sets it with CSS variables: see Styling.
With your own HTML
Recommended. Any link or button of yours becomes a way into the booking: the script fills in the address.
A link or a button
data-pms-book on any element of yours. A link gets its address when the page loads; any other element goes there on click, with the dates counted at that moment. A named stay — tomorrow, weekend — is counted from the visitor’s today, so it never goes stale. With data-stay="search" the link carries the dates and the party of the search form on the page, and its address follows every pick; while the search is not complete it carries no dates — see Prices that follow your search form. Keep an href of your own as the fallback.
<a class="book-now" href="/booking" data-pms-book data-stay="weekend">Book this weekend</a>
<a class="book-now" href="/booking" data-pms-book data-room="00000000-0000-0000-0000-000000000000" data-check-in="2026-12-24" data-check-out="2026-12-27" data-adults="2" data-child-ages="6,9"> Christmas in this room, two adults and two children</a>
<button class="book-now" data-pms-book data-room="00000000-0000-0000-0000-000000000000">Book this room</button>.book-now { display: inline-block; padding: 12px 24px; border: 0; background: #1d3b36; color: #fff; font: inherit; text-decoration: none; cursor: pointer;}.book-now:hover { background: #2a5149;}| Attribute | Values | What it does |
|---|---|---|
data-pms-book | no value | Makes the element a way into the booking. An <a> gets its href; any other element goes there on click. |
data-stay | "tomorrow" | "weekend" | "search" | A stay counted from the visitor's today. tomorrow: one night from tomorrow. weekend: the coming Friday to Sunday — on a Saturday, that Saturday to Sunday. search: the dates and the party of the search form on the page — the form the link is inside, else the page's first form with a data-pms-dates or data-pms-guests button, else its first ready search form. The address follows every pick; while the search is not complete it carries no dates. |
data-check-in, data-check-out | YYYY-MM-DD | Exactly these dates; check-out is the day of departure. Both are needed, in order. They win over data-stay — except with data-stay="search", where they stand only until the search is complete. |
data-adults | 1–20 — default 2 | The number of adults the booking opens with. |
data-child-ages | ages 0–17, comma-separated | The children the booking opens with, one age per child. The list counts only whole: with an entry that is not a whole number from 0 to 17, with more than eight ages, or with a child the property books as an adult, it is ignored and the party is the adults alone. |
data-room | room type id | Opens the booking on this room's rates. |
data-plan | rate plan id | Together with data-room: with this rate plan chosen. |
With no stay the link opens your booking page as it is. data-plan is used only together with data-room.
With fixed dates, no attribute at all
A plain link to your booking page with the search in its address lands searched.
<a class="book-now" href="/booking?check_in=2026-12-24&check_out=2026-12-27&adults=2">Book Christmas</a>Room type and rate plan ids
data-room, data-rooms and data-plan take the property’s own ids. An id does not change when a name does. The hotel finds them in Tape Chart Link, under Booking engine → Components, on this component’s page; the snippets here show 00000000-0000-0000-0000-000000000000 in their place.
Every attribute, method and variable: Attributes · JavaScript · Styling.