# Plain HTML

Two pages: a search on the home page, and the booking on `/book/`. Any static host serves them.

`index.html`:

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Your Rental</title>
    <script type="module" src="https://mllw.is/widget/1/mellow.js"></script>
  </head>
  <body>
    <h1>Your Rental</h1>
    <mellow-search
      rental="your-rental"
      auth="pk_live_…"
      action="/book/"
      layout="row"
    ></mellow-search>
  </body>
</html>
```

`book/index.html`:

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Book</title>
    <script type="module" src="https://mllw.is/widget/1/mellow.js"></script>
  </head>
  <body>
    <h1>Book</h1>
    <mellow-booking rental="your-rental" auth="pk_live_…"></mellow-booking>
    <script>
      document.addEventListener("mellow-booked", (event) => {
        console.log("Booked", event.detail.reference);
      });
    </script>
  </body>
</html>
```

To try it on your own machine first, put the test key in both pages and serve the folder on localhost, such as with `python3 -m http.server 8000`. Then open http://localhost:8000.

For one page only, leave out `index.html` and put `<mellow-booking>` on the page you want.

**Tried:** on 2026-10-20, on localhost against a local Mellow with the test key: the search on the home page, then `/book/` from the car types to "Test booking", a refused test card and a second Pay included.
