Office Locations
ProNewA firm's offices in columns that fill the width: address, a phone number that dials, hours, directions and a button that copies the address.
Installation
pnpm dlx shadcn@latest add @viewport/office-locations
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| offices* | Office[] | — |
| selected | string | nullThe id of the highlighted office, e.g. the one shown on a map beside the list. | — |
| onSelectedChange | (id: string) => void | — |
| directions | (office: Office) => stringBuilds the link for directions. Defaults to a maps search for the address. | maps |
| className | string | — |
Accessibility
- Addresses use the address element.
- Directions say they open in a new tab; copy is named per office and announced.
- Hovering or focusing an office can highlight it on a map beside the list.