Add online appointment booking to a React or Next.js site with the EasyWeek booking widget: a floating "Book now" button, a "Book" button next to every service, a booking form inside a page, or a full booking page. One file, no dependencies besides React, typed for TypeScript.
- The component: components/easyweek.tsx, copy it into your project
- Working Next.js example: this repository (
npm install && npm run dev) - Plain HTML, WordPress, Wix and other site builders: easyweek/widget-example-integration
- Reference, every option, method and link format: Booking widget for developers
- Copy components/easyweek.tsx into your project.
- Wrap your app or root layout once:
import { EasyWeekProvider } from './components/easyweek'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<EasyWeekProvider
url="https://booking.easyweek.io/your-company"
button={{ text: 'Book now', showText: true }}
>
{children}
</EasyWeekProvider>
</body>
</html>
)
}A round "Book now" button appears in the corner of every page. A click opens the booking form on top of the page, and the client books without leaving your site.
Replace your-company with your own booking link: it is in your EasyWeek account under Integrations and Apps › Booking Widget. The component loads widget.js from the host of that link, once per page.
'use client'
import { useEasyWeek } from './components/easyweek'
export function BookButton() {
const easyweek = useEasyWeek()
return <button onClick={() => easyweek.open()}>Book online</button>
}
export function ServiceButton({ serviceId, locationId }) {
const easyweek = useEasyWeek()
return <button onClick={() => easyweek.openService(serviceId, locationId)}>Book</button>
}Leave out button on the provider when you only want your own buttons.
| Method | Opens |
|---|---|
open() / close() |
The booking form |
openStart() |
The start page of your company |
openLocation(locationId) |
One location |
openService(serviceId, locationId, staffId?) |
One service, optionally with a specialist |
openSpecialist(staffId, locationId) |
One specialist |
openGiftCard(giftCardId, locationId) |
One gift card |
openMembership(membershipId, locationId) |
One membership |
The ids stand in the address of the page in your booking form, for example https://booking.easyweek.io/your-company/{locationId}/{serviceId}. A call made before the widget has loaded waits and runs when it is ready.
import { EasyWeekEmbed } from './components/easyweek'
<EasyWeekEmbed url="https://booking.easyweek.io/your-company" title="Online booking" />A separate booking page that fills the screen:
<EasyWeekEmbed url="https://booking.easyweek.io/your-company" title="Online booking" fullPage />url can point deeper: a location, a service or a specialist. title is the accessible name of the frame, in the language of your page.
| Prop | What it does |
|---|---|
url |
Your booking link, required |
button |
The floating button: text, showText, position ('left' or 'right'), background, color, textColor, textBackground. Leave it out for no floating button |
colors |
Your palette for the booking form: primary, onPrimary, surface, onSurface, background, all five as #rrggbb |
trigger |
A CSS selector of your own elements that open the form |
logo, logoBackground |
The loading screen |
<EasyWeekProvider
url="https://booking.easyweek.io/your-company"
button={{ text: 'Book now', showText: true, background: '#168aad' }}
colors={{
primary: '#168aad',
onPrimary: '#ffffff',
surface: '#ffffff',
onSurface: '#222222',
background: '#f1f8dc'
}}
>EasyWeekProviderloadswidget.jsonce, creates the widget after mount and destroys it on unmount. React Strict Mode and route changes leave exactly one button on the page.- Everything runs in the browser only (
'use client'), so server rendering in Next.js works as usual. EasyWeekEmbedloads the same script next to the frame: it takes the client to the payment page or to your thank-you page when the form asks for it.
npm install
npm run devOpen http://localhost:3000. The example uses the EasyWeek demo company; put your own link into app/booking-config.ts.
| Page | Shows |
|---|---|
| app/page.tsx | Floating button from the layout and a "Book" button for every service |
| app/embed/page.tsx | The booking form inside a page |
| app/booking/page.tsx | A full booking page |
Coding agents in Claude Code, Cursor, Codex and GitHub Copilot read AGENTS.md. You can also ask your assistant:
Add EasyWeek online booking to this React app. Copy components/easyweek.tsx from
https://github.com/easyweek/booking-widget-react into the project, wrap the root layout in
<EasyWeekProvider url="https://booking.easyweek.io/your-company" button={{ text: 'Book now', showText: true }}>
and check that one "Book now" button shows on every page and opens the booking form.
EasyWeek is online booking and business management software for service businesses: beauty salons, barbershops, clinics, fitness and yoga studios, schools and rentals. More than 50,000 users run their bookings, clients, payments and reminders in it. Online booking is part of every plan, the free one included. All features: github.com/easyweek and easyweek.io/business/features.
- easyweek/widget-example-integration: every way to install the widget, with a live demo
- easyweek/wordpress-booking-plugin: WordPress plugin
- easyweek/easyweek-mcp: connect EasyWeek to Claude, ChatGPT and Cursor
- easyweek/agent-skills: skills for Claude Code, Cursor and Codex
MIT. EasyWeek is a registered trademark of EasyWeek GmbH.