Components from @lockii/site-sdk follow the site theme. Use them for type, buttons, cards, forms, checklists, and chrome. The host still owns checkout, calendars, and overlay open and close.
Page content
SiteContainer sets the shared content width.
<SiteContainer>
<SiteHeading level={2}>{headline}</SiteHeading>
</SiteContainer>SiteHeading renders h1 through h5. level is the heading rank. size changes the visual size. color is a palette key (lightest, light, accent, dark, darkest) or empty to inherit the theme.
SiteText is theme body copy. variant is 1 to 4. maxWidth is narrow, normal, or none. color uses the same palette keys.
SiteRichText renders HTML from fields.richText.
SiteButton follows a SiteAction. variant is primary or outline. size is sm, md, or lg. backgroundColor and textColor override the theme button colors with a palette key.
<SiteButton action={cta} variant="primary">{cta.label}</SiteButton>SiteImage loads a catalog image by id. Pair it with an image field.
<SiteImage
alt="Fleet"
imageId={siteImageSrc(photo)}
overlay={siteImageOverlay(photo)}
/>SiteIcon draws an icon from fields.icon. SiteCard is a themed surface. SiteAvailabilityBadge prints a product or location availability label.
<SiteAvailabilityBadge availability={product.availability} />On a product card, a hire that cannot be taken at the selected location but can be taken at a nearby location shows Available nearby. The kind stays unavailable, so checkout at this location stays blocked. With up to five other sites, every other site counts as nearby. With more sites, Lockii checks the closest quarter of all sites, and at least five.
Forms
SiteForm is a complete form: fields, validation, the thank-you state, and the submit button. Answers go to the staff inbox. Name, email, and phone link or create a customer. Date, date range, product, and location answers are what staff use when they create a draft booking from the submission.
Do not render <form>, <input>, <select>, or <textarea>. Those tags are blocked in custom sections.
<SiteForm
formId="quote-request"
formName="Quote request"
fields={[
{ type: "text", label: "Name", required: true },
{ type: "email", label: "Email", required: true },
{ type: "date_range", label: "Dates" },
{ type: "product", label: "What would you like to hire?" },
{ type: "textarea", label: "Anything else?" },
]}
submitLabel="Get a quote"
/>Field type is text, email, phone, textarea, date, date_range, product, location, select, or checkbox. A dropdown's choices are options, one per line.
For your own layout, wrap the pieces in SiteFormRoot and use SiteFormField, SiteFormFields, SiteFormSubmit, and SiteFormStatus. useSiteForm reads state.status (idle, submitting, success, error) and the setValue, submit, and reset actions.
defaultContactFormFields() and defaultNewsletterFormFields() are the same starting fields as the Contact form and Mailing list signup sections. formChild(...) puts a form block in a section default.
Checklists, tabs, and print
A custom file cannot attach click handlers or read browser storage. These components keep that state for you. The editor preview shows a static version. On the live site, the visitor can use them.
SiteChecklist is a list of boxes a visitor can tick. A ticked row is crossed out. Pass items as { id, label }. id is optional. When you set it, reordering the list keeps the right boxes ticked.
storageKey remembers the ticks in that browser for that page. Use a different key for each checklist on the page. Leave it off and the ticks reset on reload.
<SiteChecklist
storageKey="pre-trip"
items={[
{ id: "lights", label: "Lights work" },
{ id: "tyres", label: "Tyres look right" },
]}
/>SiteTabs shows one panel at a time. Arrow keys move between tabs. The editor shows the first tab.
<SiteTabs
tabs={[
{ label: "Hourly", content: <p>From $25 an hour.</p> },
{ label: "Daily", content: <p>From $80 a day.</p> },
]}
/>SitePrintButton opens the browser print dialog. The label defaults to Print this page.
<SitePrintButton label="Print this page" />Catalog
SiteProductCard renders one SiteProduct with the theme card: photo, name, price, and booking button.
<SiteProductCard product={product} />SiteProductCards lays out a list of products. SiteProductCheckout is the product booking panel. SiteLocationCard is one location. SiteLocationSearch and SiteRentalSearch are the location and hire search bars. SiteCollectionCards lists collections. SiteReviews prints company reviews. SiteFilterBar is the catalog filter row.
These read the theme and the open page. Pass catalog rows from the hooks in Catalog data.
Cart
Use these inside a cart.drawer part. Checkout math and the Stripe handoff stay in Lockii.
Component | Renders |
|---|---|
| Title, lines, and footer in the default order |
| Drawer title |
| Date and location filters |
| Lines with photo, quantity, and price |
| Empty-cart message |
| Subtotal row |
| Checkout button |
| Header control that opens the cart |
<CartDrawerContents />Header, menu, and dates
SiteHeaderLayout places brand, nav, search, account, and cart on a header part.
SiteNavLinks renders the site nav. Closing the menu stays with the host.
SiteMenuContents is the mobile-menu title, links, and call to action.
SiteDateTriggerLabel is the label and selected range inside the date button.
<SiteHeaderLayout />