`, and never set a property on the overlay element itself. See [How a part rule works](/reference/styling/#how-a-part-rule-works).
7. **Write real fallback text inside every live element.** `
from €95` shows your text until the live value arrives, and again whenever there is no value for the stay it asks for: the answer on its way, a failed request, a room that cannot be sold.
8. **Never write the state attributes yourself** — `data-pms-ready`, `data-pms-filled`, `data-pms-loading`, `data-pms-open`, `data-pms-has-dates`, `data-pms-nights`, `data-pms-item`, `data-pms-available`, `data-pms-bound`, `data-pms-field`. The script sets them; your CSS reads them.
9. **Dates are `YYYY-MM-DD`; check-out is the day of departure.** A fixed date in markup goes stale — prefer `data-stay="weekend"` or `data-stay="tomorrow"` unless the task gives dates. A party with children is `data-adults` plus `data-child-ages="6,9"` (ages, comma-separated), wherever `data-adults` is accepted; a child is priced by its real age, so never invent ages. A list counts only whole: one entry that is not an age, or one child older than the property books as a child, drops every child and the price is for the adults alone, with no warning — see [Children](/reference/attributes/#children). Ask the human for the property’s highest child age if the task names children.
10. **In a framework (React, Next.js, Vue, Astro):** load the script once in the document head, not inside a component. Boxes and `data-pms-*` elements added later are picked up by themselves. Room cards: prefer `pmsBooking.rooms()` drawn in the framework’s own components. A `
` rendered by a framework is read too, but its cards are added as siblings the framework did not create, so use one only where the framework will not draw that part of the page again; in JSX write the braces as text, `{'{{name}}'}` — see [From JavaScript](/components/offer-prices/#from-javascript). Code that calls `window.pmsBooking` waits for it — see [When it is ready](/reference/javascript/#when-it-is-ready).
11. **Use only what these docs name.** An attribute, field, method, event or variable that is not in the reference does not exist. Do not guess one from a similar name.
12. **Leave the promo-code field out of a ready search form** with `data-promo="off"`: it is not wired to anything yet.
13. **A price beside a search form follows it.** On a page that has a search form, a price, a room card or a book link that should answer the guest’s dates carries `data-stay="search"`. It is priced only for a complete search — both dates, an age for every child — so its fallback text must read well before that: “pick your dates”, not a number. A price that is about a fixed offer keeps its own `data-stay` or dates.
14. **A line that shows only when rooms are free starts `hidden`.** `data-pms-if` outside a template sets and removes `hidden`, and only on a definite answer: write `hidden` on what should appear on a yes, so nothing is claimed while the answer is on its way or after an error. Make sure no rule of the site sets `display` on that element, or add `[hidden] { display: none !important; }` to the stylesheet. Inside a `` it is the opposite: the element is removed, so do not write `hidden` there. The comparison is written without quotes: `data-pms-if="reasonKind=min-stay"`.
15. **Never compute a price.** `price` is the total the booking page charges; `vatAdded` and `cityTax` are already inside it — never add them to it. Do not subtract `deposit` to print a balance, do not divide by the guests or convert the currency, and do not build “from” prices out of `calendar()`. Print the fields; what the script does not give is listed under [What is not available](/start/prices-and-availability/#what-is-not-available).
16. **Say why a room cannot be booked with `reason`,** the booking window’s own sentence, not with words of your own; use `reasonKind` for CSS and for `data-pms-if`.
## The order of work
1. Read [Install the script](/start/install/), [How it is drawn](/start/how-it-works/) and [Prices and availability](/start/prices-and-availability/).
2. Add the script tag to the site’s shared head.
3. Create the booking page and the account page.
4. Put a search form on the home page — the site’s own form with our pickers: [Search form](/components/search-form/#with-your-own-html).
5. Wire the site’s existing “Book” buttons and room pages: [Book button](/components/book-button/#with-your-own-html), [Offer prices](/components/offer-prices/#with-your-own-html).
6. Wherever the site states a price or says that rooms are free, make it live: [Prices and availability](/start/prices-and-availability/). Next to a search form, let it follow the form (rule 13); a “rooms free” line starts `hidden` (rule 14).
7. Match the site’s look with a short block of variables: [Styling](/reference/styling/). Read the site’s own colours, corners and fonts and map them; start from a [recipe](/reference/styling/#recipes).
8. If the site has a dark mode or more than one language, connect them: [Theme icon](/components/theme-icon/), [Language icon](/components/language-icon/).
9. If the site tracks conversions, listen for `pms-booking-step` and `pms-booking-purchase` — see [Events](/reference/javascript/#events). Add both listeners in a script before our script tag, on the booking page itself: the events are not fired again for a late listener — see [The booking window’s events, in practice](/reference/javascript/#the-booking-windows-events-in-practice).
10. If the site sends a Content Security Policy, enforces Trusted Types or has a consent banner, see [What your site must allow](/start/how-it-works/#what-your-site-must-allow) and [Consent](/reference/javascript/#consent).
## Definition of done
Check each one in a browser, not from the code.
* [ ] The console shows no warning from the script.
* [ ] `` carries `data-pms-ready`, and `window.pmsBooking` is an object.
* [ ] The home page’s search opens the calendar with prices; picking two dates and pressing Search lands on the booking page with `check_in` and `check_out` in the address and a list of rooms.
* [ ] A book link on a room page opens the booking page with that room chosen.
* [ ] The booking page shows the booking window at the site’s full content width, under the site’s own header.
* [ ] The account page shows the sign-in.
* [ ] The components wear the site’s colours, corners and fonts — in the frames too.
* [ ] Every live element still reads sensibly with the script blocked.
* [ ] A price that follows the search form shows its fallback before dates are picked, and a price after; changing the dates changes it.
* [ ] A line with `data-pms-if` is not visible when the page loads, and not visible with the script blocked, unless it was meant to be.
* [ ] On a phone-width screen nothing overflows.
If requests fail with a CORS error, stop and tell the human: the site’s address is not on the hotel’s allowed origins.
## What to tell the human when you finish
* Which pages carry the script, the booking window and the guest area.
* That the hotel should set the account page’s address in Tape Chart Link (Booking engine → Configuration) so that sign-in links in emails open on the site.
* That the production address must be on the allowed origins before going live.
* Anything you could not verify.
# Install the script
> The script tag, the two pages your site needs, and what the hotel must do first.
## Before you start
Ask the hotel for two things. Both are in Tape Chart Link, under **Booking engine**.
* **The property number** — nine digits. It is public: it goes into the script tag.
* **Your site’s address on the list of allowed origins** (Booking engine → Firewall), written like `https://www.yourhotel.com`. Add `http://localhost:3000` there too while you develop. On a site that is not listed the script loads, but the browser refuses its requests.
Tip
Open any page of these docs with `?property=` and the hotel’s number — `/start/install/?property=123456789` — and every snippet is written with that number, ready to copy. It is remembered until you close the tab.
## The steps
1. **Put the script on every page that shows a component**, inside ``.
```html
```
2. **Make a booking page** at `/booking` and put the booking window on it. The search form, the book buttons and every booking link lead here.
```html
```
3. **Make an account page** at `/account` and put the guest area on it. Sign-in links in the hotel’s emails open here once the hotel has set this page as its account page (Booking engine → Configuration).
```html
```
4. **Put a search form on the home page** — the [ready one](/components/search-form/), or [your own form](/components/search-form/#with-your-own-html) with our calendar.
```html
```
That is a working booking engine. Everything after this is choice: [more components](/components/book-button/), [your own markup](/components/offer-prices/#with-your-own-html), [your own look](/reference/styling/).
## Other paths
If your booking or account page lives somewhere else, say so on the script tag:
```html
```
## The script tag’s attributes
| Attribute | Goes on | Values | What it does |
| ------------------- | -------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `data-property` | the script tag | `9 digits` | Required. The property's public number. Without it the script draws nothing and logs a warning. |
| `data-booking-path` | the script tag | `a path — default "/booking"` | The page of your site that carries the booking window. The search form, the book button, every `data-pms-book` link and `bookUrl()` lead there. |
| `data-account-path` | the script tag | `a path — default "/account"` | The page of your site that carries the guest area. The account circle and the menu link there. |
| `data-theme` | the script tag | `"light" \| "dark" \| "auto" \| "page"` | The look the components start in. light or dark: that one. auto: the visitor's device. page: your site's own switch, followed live. Left out: light, unless the property's branding is dark. Except under page, a guest's pick on our theme icon wins. |
| `data-locale` | the script tag | `"en" \| "bg"` | The language of the components. Left out, they follow the page's own lang attribute, live. A guest's pick on our language icon wins over both. |
| `data-consent` | the script tag | `"granted" \| "denied"` | Your site's decision about marketing tags, for a page with no consent-manager script. `window.pmsBookingConsent` wins over it. |
| `data-analytics` | the script tag | `"off"` | off: measure nothing at all on this site — no session, no events, no tags. |
| `data-assets-url` | the script tag | `a URL` | Where the room photographs are loaded from. Normally left out: the property says where. |
| `data-base-url` | the script tag | `a URL on the script's own origin` | Where the script calls our API. Honoured only when it is the origin the script itself was loaded from; anything else is ignored with a warning. Normally left out. |
## Check that it works
* The browser console shows no warning from the script. A missing or wrong `data-property` logs one and nothing is drawn.
* `` carries `data-pms-ready` once the script has bound the page.
* `window.pmsBooking` exists — see [JavaScript](/reference/javascript/).
# How it is drawn
> What runs on your page, what runs in our frames, and what that means for your CSS and your CSP.
The script draws in two ways. Knowing which part is which explains every limit in these docs.
## On your page
Almost everything is drawn by the script inside your own page: the search form, the calendar, the guests panel, the book button, the offer table, the header icons, anything you build with [your own HTML](/components/search-form/#with-your-own-html) — and, in the booking window, the room list, the rates, the extras, the step bar and the summary.
* The ready components sit in a shadow root. Your site’s CSS does not leak into them and theirs does not leak out. You restyle them with the `--pms-*` [CSS variables](/reference/styling/), not with selectors — except the calendar and the guests panel, whose pieces also have `::part()` names.
* What a component opens over your page — the calendar, the guests panel, a dropdown list, the room dialog, the photo viewer — is drawn in one element of ours at the end of your ``, `[data-pms-booking-overlay]`, not inside the component’s box. That is why the variables go on `:root`, and why every `::part()` rule names that element: see [How a part rule works](/reference/styling/#how-a-part-rule-works).
* Your own HTML stays your own. The script fills in values and sets [state attributes](/reference/attributes/#state-hooks); it never adds, removes or reorders an element of yours.
* Live values are filled in the visitor’s browser. A search engine reads the text you wrote, not the live value — so write a sensible fallback inside every element.
## In our frames
Two parts are frames of ours inside your page:
* **the details-and-payment step of the booking window** — the guest’s name, email and phone, the card fields, Pay and the confirmation. The rest of the booking window around it is on your page;
* **the guest area** — sign-in, bookings, profile.
What that means:
* The guest stays on your page and your address bar; a frame is as wide as its place and as tall as its content.
* No guest detail, card field or session ever exists in your page’s DOM, storage or address. Your scripts cannot read into a frame, and you do not need to handle personal data or card data.
* Your `--pms-*` variables are read on your page and handed to the frames, [within limits](/reference/styling/#values-and-what-happens-to-a-wrong-one): a value that works on your page can be left out in a frame. No other CSS of yours reaches them.
* The search travels in your page’s address — `check_in`, `check_out`, `adults`, `child_ages` — so Back, Forward and a shared link all work.
## Payment
The card payment happens inside our frame, with the hotel’s own payment account. Your site needs no payment code and no keys.
## Languages
The components speak English and Bulgarian. They follow your page’s `lang` attribute unless the script tag says otherwise — see [Language icon](/components/language-icon/).
## What your site must allow
* **Allowed origins.** The hotel lists your site’s address in Tape Chart Link. Without it the browser refuses the script’s requests, and our frames refuse to be shown on your page.
* **Globals.** The script adds two names to `window`: `pmsBooking` and `__pmsBookingWidget`. It uses `window.dataLayer` only if your site already has one.
* **A Content Security Policy and Trusted Types,** if your site sends them: the next two sections.
### Content Security Policy
What the script does on your page, by directive. `https://link.tape-chart.com` stands for the address your script tag loads from.
| Directive | What to allow | Why |
| ------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `script-src` | `https://link.tape-chart.com` | The script tag loads a small loader, and the loader adds a second script from the same address: the build itself, with an integrity hash. A `nonce` on your script tag is copied to that second script. |
| `connect-src` | `https://link.tape-chart.com` | Every request the script makes goes to the address it was loaded from: the property’s configuration, availability, calendar prices, and its own measurement. |
| `frame-src` | `https://link.tape-chart.com` | The details-and-payment step and the guest area. The frames’ address is named by the property’s configuration; when it names none it is the script’s own address. If the console reports a blocked frame on another address, allow that one. |
| `img-src` | The address of the hotel’s photographs | Room photographs are plain `
` elements on your page. Their address comes from the property’s configuration, not from the script, so it is not written here: read it from a room photograph’s `src`, or from the console. |
| `font-src` | Nothing for us | The script requests no font file on your page. The components name a font family; the font shows if your page loads it or the device has it. |
| `style-src` | See below | |
* **The payment provider needs nothing from your policy.** Its card fields are frames inside our frame, and its script runs there. A nested frame is governed by the policy of the frame around it, ours, not by your page’s. Your page loads no payment script.
* **The hotel’s own tags.** If the hotel has configured Google Analytics, Google Tag Manager or a Meta Pixel for its booking engine, and the visitor’s [consent](/reference/javascript/#consent) allows marketing tags, the script adds their scripts from `https://www.googletagmanager.com` and `https://connect.facebook.net`. What those scripts then load is theirs to document. Ask the hotel whether it uses them; `data-analytics="off"` on the script tag switches all of it off.
* **Styles.** The components’ styles are stylesheets the script builds and attaches to its own shadow roots. They are not `