Location, branches
betaOne card per branch: a map or a photo, the address and a landmark, today's hours and open now, and call and directions links.
npx rasengan-ui add location-branches
Find us
Two kitchens, the same recipes. Both deliver in their part of town.
- Rue Joss, AkwaDoualaTwo streets from the Akwa post office, the green door.
Akwa
- Carrefour KottoBonamoussadi, DoualaAbove the Total station, first floor
Bonamoussadi
- Use it
- A business with two to six places: a restaurant group, a chain of salons, shops in several districts.
- Avoid it
- One place: location-map shows it larger, with an optional embedded map.
- Pairs with
- Hours, weekContact, links
Installation
It installs into components/blocks/location-branches/, with what it uses (Badge, Button) and lib/blocks.ts.
Usage
Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):
Give each branch its openingHours to show today's hours and an "open now" badge, read in timeZone (the business's, not the visitor's) once the page has loaded. A branch without hours shows its address and links only.
Content
| Field | Type | Limits | Guidance |
|---|---|---|---|
title | string | 2–48 chars | 'Find us', 'Our shops'. |
sublineoptional | string | ≤ 160 chars | |
branches | object[] | 2–6 items | One card each. With opening hours, a card says today's hours and whether it is open now. |
branches[].name | string | 1–48 chars | Which one: 'Akwa', 'Bonamoussadi'. |
branches[].address | object | ||
branches[].address.lines | string[] | 1–4 items | |
branches[].address.landmarkoptional | string | ≤ 80 chars | How locals find it: 'opposite the central market'. |
branches[].address.coordinatesoptional | object | ||
branches[].address.coordinates.lat | number | -90–90 | |
branches[].address.coordinates.lng | number | -180–180 | |
branches[].address.mapUrloptional | string | uri | A link to directions. |
branches[].openingHoursoptional | object | ||
branches[].openingHours.days | object[] | 1–7 items | |
branches[].openingHours.days[].day | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" | ||
branches[].openingHours.days[].slots | object[] | ≤ 3 items | Empty for a closed day. |
branches[].openingHours.days[].slots[].open | string | 24-hour 'HH:MM'. | |
branches[].openingHours.days[].slots[].close | string | 24-hour 'HH:MM'. | |
branches[].openingHours.noteoptional | string | ≤ 120 chars | Holidays, exceptions. |
branches[].phoneoptional | string | ≤ 24 chars | In international form: '+237 6 99 00 00 00'. |
branches[].imageoptional | object | A static map or a photo of the front. | |
branches[].image.src | string | A local path ('/images/terrace.jpg') or the project's asset URL. | |
branches[].image.alt | string | ≤ 140 chars | What the image shows, for people who cannot see it. Empty only if purely decorative. |
branches[].image.width | integer | ||
branches[].image.height | integer | ||
timeZone | string | ≥ 3 chars | The business's IANA time zone, for 'open now': 'Africa/Douala'. |
localeoptional | string | A BCP 47 locale for times ('en-CM'); the page's language when left out. | |
labels | object | Today's line and the badge appear once the page has read the clock. | |
labels.today | string | 1–16 chars | 'Today' |
labels.closedToday | string | 1–24 chars | 'Closed today' |
labels.openNow | string | 1–24 chars | 'Open now' |
labels.closedNow | string | 1–24 chars | 'Closed now' |
labels.directions | string | 1–24 chars | 'Directions' |
labels.call | string | 1–16 chars | 'Call' |
Props
| Prop | Notes |
|---|---|
content | LocationBranchesContent; the example when left out |
id | the section's id, for anchor links; "locations" by default |
headingLevel | 1, 2 or 3: the heading's tag; 2 by default |
className | on the <section>, for spacing |
Accessibility
- The address is an
addresselement. - The phone number is written on the call button.