# Location Card

> Card for a single store or location with two layouts. A row-style `list` card for store directories, and a square `mapPopup` card for map markers. Wires phone, navigation, and detail actions.

## Playground

An interactive playground for LocationCard is embedded above. Open the canonical story on Storybook: [https://storybook.laioutr.cloud/?path=/story/ui-blocks-locationcard--list-variant](https://storybook.laioutr.cloud/?path=/story/ui-blocks-locationcard--list-variant)

## Overview

`LocationCard` is the card for a single physical location. It carries the store name, image, a single-line address, a pre-formatted distance string, an [`OpeningStatus`](/laioutr-ui/ui-kit/general/opening-status) summary, up to a handful of feature pills (drive-through, accessibility, parking), and up to three action buttons: Navigate, Call, and Details.

The `variant` prop picks the layout:

- `list` is the row layout for store directories and list panels alongside a map. The card body wraps in an anchor pointing at `detailsUrl` (so tapping anywhere on the body opens the detail page), and the action buttons stay outside the wrapping anchor to keep the HTML valid. Set `bodyAsLink={false}` to keep the body clickable for selection only without making it a link.
- `mapPopup` is the square popup that sits inside a map marker's info window. The image renders at a fixed `1/1` aspect ratio and the action buttons stretch to the popup's width.

Every interactive action emits the location's `id` so the parent map or list view can correlate the click without re-deriving identity from props.

## Key Business & UX Benefits

- Two variants from one component keep map popups and list rows visually consistent, so shoppers see the same store information whether they tap a marker or scan the list.
- Tap-anywhere navigation on the `list` body (when `detailsUrl` is set) reduces the tap target precision a shopper needs on mobile, lifting click-through to the detail page.
- Wiring Navigate, Call, and Details directly as anchors (with `tel:` for phone and `target="_blank"` for maps) means iOS and Android handle the actions natively instead of going through JavaScript handlers that can break on slow networks.
- Stable `id` on every event lets the parent map view sync selection state without re-deriving identity from the address string.

## Feature List

<features :items="["Two layouts (`list`, `mapPopup`) cover store directories and map popups from one component","Composes `OpeningStatus` so each card carries the current open/closed state and next state-change time","Up to three action buttons (Navigate, Call, Details) wired as anchors so iOS and Android handle them natively","`bodyAsLink` opts the `list` card out of body-wide linking when the parent only wants to handle selection","Up to three feature pills via `FeaturePillList` for callouts like drive-through, accessibility, or parking","Every action emits the location `id`, so the parent map or list view can correlate clicks without prop-derived identity","Image falls back to a flat placeholder when absent, so missing-image stores don't break the row alignment"]">



</features>

## API Reference

#### Props

```json
{"type":"object","properties":{"id":{"description":"Stable identifier — emitted with all events; used by parent for selection.","type":"string"},"variant":{"description":"Layout variant.","enum":["list","mapPopup"],"type":"string"},"name":{"description":"Display name.","type":"string"},"image":{"description":"Location image. Falls back to Media's built-in placeholder when absent.","type":"object","properties":{"type":{},"sources":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","description":"Image provider to be used with NuxtImage.\n\nIf you know the provider, e.g. `cloudinary`, `directus`, `sanity`, etc., you can use it here for optimal image-serving.\nOtherwise, the `raw` provider is a good fallback for plain URLs.\n\nAlternatively you can create a custom provider and use that here."},"src":{"type":"string"},"origin":{"type":"object","properties":{"libraryId":{"type":"string","description":"Producing library's id (the `.mediaLibrary()` registration id, default `meta.app`)."},"externalId":{"type":"string","description":"The asset's stable id within that library (Shopify gid, Shopware media UUID), when the backend has one."}},"additionalProperties":false,"required":["libraryId"],"description":"Origin of this source (producing library + stable external id)."},"width":{"type":"number"},"height":{"type":["number","undefined"]},"responsive":{"enum":["static","mobile","desktop"],"type":"string","description":"The responsiveness-mode of this source.\n- `static`: Source can be used for all viewport-sizes.\n- `mobile`: Source is a mobile-optimized version of the image.\n- `desktop`: Source is a desktop-optimized version of the image.\n\nIf not given, `static` can be assumed."},"focalPoint":{"description":"Optional focal point of the image, as fraction of the width and height of the image.\nIn form [x, y], e.g. [0.5, 0.5] for center.\n\nIf not given, center can be assumed."}},"additionalProperties":false,"required":["provider","src"]},"description":"Each source is a different version of the same image. Differences may be:\n- mobile or desktop version\n- different file-formats"},"placeholder":{"description":"Optional placeholder for the image.\n\nIf not given, the image will be loaded as is. Otherwise, the placeholder will be displayed while the image is loading."},"alt":{"type":["string","undefined"]},"meta":{},"aiDisclosure":{"enum":["generated","modified"],"type":"string","description":"AI disclosure for this asset, when the producing backend told us one.\nAbsent means no disclosure is known — there is nothing to disclose. It is\nnot an assertion that the asset is human-made.\n\nSet it only from an authoritative backend signal; never infer it from a\nfilename or guess. Omission is the correct answer for an unknown asset.\n\nDescribes the depicted content, so it is identical across every responsive\nvariant and format — which is why it lives here and not on the sources. A\nvideo's `poster` and an audio's `cover` are themselves images and carry\ntheir own, independent disclosure."}},"additionalProperties":false,"required":["type","sources"]},"address":{"description":"Pre-formatted single-line address. Locale formatting is the consumer's concern.","type":"string"},"distance":{"description":"Pre-formatted distance string (e.g. '1,2 km').","type":"string"},"openingHours":{"description":"Schedule + IANA timezone — drives the OpeningStatus child.","type":"object","properties":{"timeZone":{"type":"string","description":"IANA time zone (e.g. 'Europe/Berlin'). Schedule HH:mm values are wall-clock\ntimes in this zone. When absent, schedule times are interpreted in the\nbrowser's local zone."},"schedule":{"description":"Weekly schedule. Missing key (or empty array) means closed that day."},"exceptions":{"description":"One-off overrides keyed by 'YYYY-MM-DD'. Empty array means closed."}},"additionalProperties":false,"required":["schedule"]},"features":{"description":"Up to ~3 inline feature pills (e.g. drive-through, accessibility).","type":"array","items":{"type":"object","properties":{"icon":{"anyOf":[{"enum":["actions/login-1","actions/logout-1","actions/login-2","actions/logout-2","actions/upload","actions/download","actions/delete-1","actions/delete-2","actions/backspace","actions/zoom-in","actions/zoom-out","actions/sort","actions/filter","communication/send","communication/copy","communication/edit","communication/refresh","arrows/arrow-left","arrows/arrow-right","arrows/arrow-up","arrows/arrow-down","arrows/chevron-left","arrows/chevron-right","arrows/chevron-up","arrows/chevron-down","arrows/maximize","arrows/minimize","communication/customer-service","communication/phone","communication/chat","communication/chat-bubbles","communication/mail","communication/mail-open","communication/go-to","communication/go-to-duotone","essentials/menu","essentials/maps","essentials/maps-square","essentials/check","essentials/check-circle-linear","essentials/check-circle-filled","essentials/minus-bold","essentials/add-bold","essentials/close-x","essentials/plus","essentials/minus","essentials/home","essentials/heart-outline","essentials/heart-filled","essentials/star-outline","essentials/star-filled","essentials/search","essentials/menu-dots","essentials/bookmark","essentials/user","essentials/user-loged-in","essentials/settings-1","essentials/settings-2","essentials/alert","essentials/info","essentials/question","essentials/wishlist","essentials/clock","essentials/calendar","essentials/lock","essentials/list-1","essentials/list-2","essentials/eye-open","essentials/eye-closed","essentials/color","essentials/size","essentials/wallet","essentials/directions","media/image","media/video","media/play","media/play-filled","media/pause","media/pause-filled","media/stop","media/stop-filled","media/forward","media/forward-filled","media/rewind","media/rewind-filled","media/skip-next","media/skip-next-filled","media/skip-previous","media/skip-previous-filled","media/sound-on","media/sound-off","shopping/bill","shopping/delivery","shopping/delivery-2","shopping/bag","shopping/bag-add","shopping/bag-check","shopping/bag-x","shopping/bag-heart","shopping/cart","shopping/cart-check","shopping/cart-add","shopping/cart-x","shopping/cart-heart","shopping/box","shopping/return","shopping/store","shopping/discount-1","shopping/discount-3","misc/rocket","misc/folder-files","misc/moon","misc/moon-filled","misc/shield-check","misc/accessible","misc/circle-linear","misc/circle-filled","misc/components","misc/hosting","misc/cloud","misc/sun","misc/webhook","misc/infinity","misc/apps"]},{"allOf":[{"type":"string"},{"type":"object","additionalProperties":false}]}]},"label":{"type":"string"}},"additionalProperties":false,"required":["icon","label"]}},"navigateUrl":{"description":"When set, renders the Navigate button as an anchor pointing here.","type":"string"},"phone":{"description":"When set, renders the Call button as a `tel:` anchor.","type":"string"},"detailsUrl":{"description":"When set, renders the Details button as an anchor.\nFor `variant='list'`, the card body (image + content) becomes a tap-anywhere\nlink. The action buttons stay outside the wrapping anchor to keep the DOM\nvalid — nested anchors are forbidden by HTML5.","type":"string"},"bodyAsLink":{"description":"When false, the card body never renders as an anchor — even when\n`detailsUrl` is set — so clicking the body only triggers `select`.\nThe Details action button still renders normally.","type":"boolean"}},"required":["id","variant","name"]}
```

#### Events

```json
[{"name":"select","description":"","tags":[],"type":"[id: string]","signature":"(event: \"select\", id: string): void","schema":["string"]},{"name":"details","description":"","tags":[],"type":"[id: string]","signature":"(event: \"details\", id: string): void","schema":["string"]},{"name":"navigate","description":"","tags":[],"type":"[id: string]","signature":"(event: \"navigate\", id: string): void","schema":["string"]},{"name":"call","description":"","tags":[],"type":"[id: string]","signature":"(event: \"call\", id: string): void","schema":["string"]}]
```

## Related

- [`OpeningStatus`](/laioutr-ui/ui-kit/general/opening-status): the open/closed summary rendered inside each card.
- [`TableOpeningHours`](/laioutr-ui/location/table-opening-hours): the full weekly schedule for the detail page this card links to.
- [`OpeningHours` type](/frontend/api-reference/common-types/opening-hours): the shape the `openingHours` prop expects.
- [`Media` type](/frontend/api-reference/common-types/media): the shape the `image` prop expects.
