Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Office Locations

ProNew

A 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

PropTypeDefault
offices*Office[]—
selectedstring | null

The id of the highlighted office, e.g. the one shown on a map beside the list.

—
onSelectedChange(id: string) => void—
directions(office: Office) => string

Builds the link for directions. Defaults to a maps search for the address.

maps
classNamestring—

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.