Magoo Component UI logo Magoo Component UI
← Catalog

Map/List Toggle

map-list-toggle molecule experimental

A two-button segmented control that switches search results between a list view and a map view.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
Map

Props

NameTypeReq
view enum (list | map)
list_label string
map_label string

Related components

How to use

A vanilla-JS segmented control. The root carries data-state (list or map) and the active segment's styling comes from group-data-[state=...] utilities, so the correct tab looks active in screenshots without JS. behavior.js flips data-state on click, syncs aria-selected on both tabs, and fires view:change with the chosen { view } for the page to swap the results panel.

Use cases

togglenavigation WCAG AA SEO 10 dir: both ai-generated