⚠️ Early Stage Project: This library is not production-ready yet. Developers should use it with caution and expect breaking changes.

MiniMap

Add a minimap overview to help users understand their location context.

Installation

First, make sure you have the base map component installed:

npx shadcn@latest add https://terrae.vercel.app/maps/map.json

Then install the minimap component:

npx shadcn@latest add https://terrae.vercel.app/maps/mini-map.json

Custom Position

Position the minimap in any corner of the map using the position prop.

RoundedNew

Use the rounded prop to customize the border radius. Set to "full" for a circular minimap.

DraggableNew

Enable the draggable prop to let users move the minimap anywhere within the map.

Custom Styling

Customize the minimap size, zoom offset, and viewport box appearance to match your design.

Properties

PropTypeDescription
position"top-left" | "top-right" | "bottom-left" | "bottom-right"Corner position of the minimap.
widthnumberWidth in pixels.
heightnumberHeight in pixels.
zoomOffsetnumberZoom offset from main map (negative = zoomed out).
stylestringCustom Mapbox style URL. Overrides theme-based styles.
stylesNewMapThemeStylesTheme-aware styles object with light/dark variants. Automatically switches based on theme.
boxColorstringColor of the viewport box.
boxBorderWidthnumberBorder width of the viewport box.
roundedNewnumber | "full" | "none"Border radius in pixels, "full" for circular, or "none".
draggableNewbooleanAllow users to drag the minimap anywhere within the map.