Shared Components
API reference for the reusable building blocks under
src/components/shared/,src/components/atoms/andsrc/components/templates/— the parts a new page or a tenant fork composes instead of rebuilding. Placement rules live in Architecture.
Last audited against master on 2026-09-29 (covers everything added or
changed since the July 2026 docs rework). When you add a shared component or a
prop, add its row here; the next audit starts from this date.
Before building a new UI piece, search here and in components/shared/ first — a
component that “looks almost right” is meant to be reused and restyled in a tenant fork,
not copied.
Map chrome (@shared/Map)
| Export | What it is | Props / API |
|---|---|---|
MapControlsStack | The absolutely-positioned column the map buttons live in. A top-anchored stack clears the MapTitle bar only while the bar is visible (useMapTitleVisible). | position?, mobilePosition? (ControlsPosition, default from @configs/map controls), sx?. Also exports controlSize (36) and borderMargin (16) — the numbers every piece of map chrome aligns to. |
MapControlButton | One button of the stack, tooltip on the left. Colours come from @configs/map controls.colors. | title (tooltip + accessible name), active?, dimmed? (on but drawing nothing — below the layer’s render floor), activeBg? (a control’s own active fill, e.g. an overlay accent), loading? (dot over the icon while data loads), desktopOnly? (hidden below sm), plus any MUI ButtonProps. |
mapControlSx | The same chrome as an sx object, for a control that can’t be a MapControlButton (e.g. a menu trigger). | ({ active?, dimmed?, activeBg? }) |
MapLocateButton | GPS “locate me”: drops the address point pin at the device position and flies there (same setPoint + flyTo as picking an address). Hides itself once geolocation permission is denied. | none |
MapNavigation · MapStyleMenu | Zoom pair and base-style menu. | disabled? — e.g. while the map is still loading. |
SelectedLocations | The selected locations as removable chips (moved out of MapTitle/components). Chip body recenters the map, the X removes that location. | locations, wrap? (chips run onto further rows). |
SelectedLocationsBar | Mobile stand-in for the MapTitle bar: the same chips along the bottom edge, clearing the controls stack. Renders only below sm and only with a selection. | none |
HomeMap | Single-property map (PDP, buildings, location headers, parcel dialog). | New: bounds? (initial viewport, nothing drawn), boundsPadding? (px around bounds/boundary, default 10). marker is optional — omit it and no marker is drawn. |
OverlayLocationButton | Touch-only “Show listings here” / “Remove this location” action inside an overlay tooltip card — the tap counterpart of a desktop marker click. Renders nothing unless the tooltip was tap-opened and the overlay is selectable on this map. | none — tooltip cards place it where they want it. |
Marker element (markerElement.ts)
markerKind(size, price?)— atag-size marker gets a price pill only for a positive price;0/ scrubbed collapses to a dot, so no marker ever reads “$0”.createMarkerElement({ …, hitArea })—hitArea: trueadds a transparent 44×44 tap target under the shape, active on coarse pointers only (overlay markers set it).setMarkerHover(root, hover)/markerHover(mlsNumber)— lets something other than the marker (the parcel under it) drive the marker’s hover; resolves multi-unit markers throughdata-members.
Map hooks (@shared/Map/hooks)
| Hook | Does |
|---|---|
useMapTitleVisible() | true while the MapTitle bar shows (a title, a selected location, or a point). |
useOverlayPolygonGuard() | Keeps a search polygon and selectable overlays mutually exclusive: when a polygon appears (drawn or from the URL) it switches those overlays off. One-way. |
usePoint() | The search point: a radius-less point as a Signpost pin (click recenters), a point with a radius as a static circle through the shared polygon renderer. |
useMapListener(mapRef, attach) · useMapReady(mapRef) | mapRef.current is assigned without a re-render. useMapListener attaches listeners once the map exists; useMapReady is a flag that flips true then — the dependency for effects that need the map. Use these instead of polling mapRef.current by hand. |
useOverlayLocationToggle(overlays) | Toggles an overlay feature’s location in the selection — shared by marker clicks and OverlayLocationButton. |
useParcelGroups() · useParcelListings() | Parcels mode — see Map Overlays. |
Filters (@shared/Filters, advanced-filters dialog)
| Export | What it is | Props / API |
|---|---|---|
FilterChip | The filter-bar chip shell every popover filter renders: pre-hydration skeleton, chip with label + chevron, popover under it anchored at the chip’s unset width. A tenant restyles the chips by forking this one leaf. | label, size, open, onOpen, onClose, unset, disabled?, sx?, skeletonSx?, paperSx?, children (the popover content) |
PriceFilter · usePriceFilter({ changeAfterClose? }) | Price chip + its state. usePriceFilter owns only the price: value, label, buckets, open/close; the shell is FilterChip. | size |
fetchPriceBuckets(filters, area) · useSearchArea() | The price histogram both pickers draw (bar chip, advanced dialog), over the region resolved the way the results search resolves it (getSearchArea: boundary clip, selected locations, point radius, saved-search region). useSearchArea returns that region context. | returns the merged buckets, or null |
ListingTypePanel | Listing-type filter as a popover of icon tiles — the alternative to ListingTypeSelect’s dropdown, same value contract (allListings is the exclusive “all”). | size ('medium' | 'small'), value, onChange, multiSelect?, disabled?, sx? |
RangeChipFilter | Bar chip that opens the beds/baths button group from the advanced dialog in a popover. Reads/writes SearchProvider itself. | name ('minBedrooms' | 'minBaths'), size, disabled?, sx? |
useListingTypeLabel() | Listing-type key → label from MapFilters.listingTypes, humanized fallback. Shared by the type selectors and the estimate property-type picker. | returns (type) => string |
useUnsetWidthAnchor(ref, unset, open) | Popover origin for a chip that widens with its value, so the popover doesn’t drift once a value is set. | returns PopoverOrigin |
LotFrontageFilter | From/to lot-frontage inputs (advanced filters lotFrontage slot). | from?, to?, disabled?, onChange |
PricePicker | Histogram + range slider. Split into PriceSlider (rail/track/thumbs only — forkable) and PriceInputs (two editable fields, applied on blur/Enter). | showLabels was removed — the layout now follows @configs/filters priceInputs (true: inputs under the slider; false: value labels on the thumbs). |
SoldRangeSelect · ActiveRangeSelect | Advanced-filter range selects. | disabled? added; SoldRangeSelect label is now required. |
PatchedSelect (atom) | MUI Select with the focus/blur fixes. | onClear? — swaps the chevron for a cross that resets the value in place (SelectClearIcon). |
defaultRenderMultiValue (atom FilterSelect) | The multi-value label renderer, exported for components that mimic FilterSelect. | — |
SortModesSelect no longer takes disabled (it disables itself during an AI search) and
adds a “Recently sold” option when the sold status is selected.
Forms (@shared/Forms)
Which fields are required is tenant config, not code: @configs/forms lists
required fields and requiredAny groups (at least one member filled, e.g.
[['email', 'phone']]), globally or per form key (contact, requestInfo, tour,
meeting, jobApplication, subscribe). A form key under forms replaces the global
rules for that form; a tenant that declares forms replaces the whole map.
| Export | What it is | Props / API |
|---|---|---|
resolveRequirements(form, fields) | Config rules narrowed to the fields a form actually renders. A group with one rendered member becomes a plain required field. | returns ResolvedRequirements { required, groups } |
FormRequirements | Context provider for the resolved rules; wrap the fields in it. | requirements, children |
FormField | react-hook-form Controller + TextField + label. Asterisk from the requirements context; group members show none. | name (a FormFieldName), control, label?, containerSx?, formatter?(value, previous), plus TextFieldProps |
FieldWrapper | Caption label (+ *) above any control. Moved up from ContactForm/. | label?, required?, containerSx? |
RequiredAnyHint | The single “email or phone” message under an unmet requiredAny group. | control |
withGroupCheck(resolver, groups, message) | Wraps a Joi resolver with the “at least one of” check (Joi’s .or() can’t report on a field). | — |
ContactForm | Inline contact form. | New: mlsNumber? (posts a property enquiry instead of a general comment), tags? (FUB lead tags, forwarded as-is), labels? (captions above fields instead of placeholders). |
ContactFormFields | The name / email+phone / message field set, for a caller that owns the <form> (e.g. a dialog with the submit in DialogActions). | control, showMessage?, labels?, variant? |
useContactForm(options) | Form state + submit for the above. | New: tags?, form? (config key; defaults to requestInfo with an mlsNumber, else contact). Returns requirements for FormRequirements. |
useScheduleForm({ form, send, onSend }) · DateField | Name/email/phone + date + time forms (PDP tour, estimate meeting). The caller owns the payload via send. | DateField: name ('date' | 'time'), control, label |
LegalText | Consent/legal line under a submit. The default renders nothing — it’s a tenant fork slot. | centered?, variant?, action? |
Field formats (length caps, phone validity per @configs/i18n phoneNumberLocale,
future-only dates) live in fieldSchemas.ts and apply to every form.
useContactForm and useScheduleForm share useRequirementsForm (internal): config
requirements → Joi resolver with the group check → useForm, plus clearing a requiredAny
group’s error from every member once one member is filled. A new lead-form hook builds on
it rather than wiring the resolver again.
Dialogs (@shared/Dialogs)
| Export | Props / API |
|---|---|
BaseResponsiveDialog | New: maxHeight? (desktop paper cap, content scrolls), transition? ('zoom' | 'slide' desktop entrance; mobile always slides up), closeButton? (drop it when the content has its own), keepMounted? (keep state between openings), centered? / centeredContent? (mobile fullscreen vertical centering of the whole stack / the content only). |
ContactUsDialog (contact) | Options: mlsNumber? (makes the lead a property enquiry), tags? (FUB tags), message? (prefill). The old mode: 'requestInfo' option is gone — the presence of mlsNumber decides. |
ParcelDialog (parcel) | New. Public-record facts for a listing-less parcel: a HomeMap framed on the lot + ParcelFacts. Options { parcels, index } — the arrows step through the viewport’s listing-less parcels. |
Listing cards & galleries
| Component | Change |
|---|---|
ListingCard → Tags | Inside a CardSurface, the status badge follows @configs/badgeSurfaces (which statuses badge on map, search, carousel, locations, favorites, recent, gallery). Outside a surface it keeps the unconditional sold/pending pill. A scrubbed lastStatus never reads “Sold”. |
CardContainer | width / height accept any CSS length (numbers stay px). |
CardIconCounts | Placeholders are per field: a scrubbed bed/bath/sqft value shows its own placeholder; a genuine 0 still renders nothing. |
ListingCard | matchedImage (the photo an AI filter matched, set client-side by markMatchedImage) opens the card gallery on that photo and is carried into the PDP link. |
ListingCarousel | Desktop column count per card size from @configs/cards-grids desktopCarouselColumns. |
useCarousel (every Carousel) | Horizontal trackpad / wheel swipes page the carousel (hooks/useWheelNavigation). |
HeroGallery | children? — rendered at the end of the gallery stack, after the thumbnails. |
CMS
| Component | Change |
|---|---|
CmsContentRenderer | predefinedStyles → layout?: PageLayout. Predefined typography applies unless layout === 'custom' (self-styled pages). |
ContactWidget | New widget param tags (≤ 5 plain labels) — FUB tags for the leads it produces. |
Atoms & templates
| Export | Change |
|---|---|
LoadingContent | height? (default 220) — reserve the space the awaited content will take. |
ContentShadow | Exports contentShadowTop (64) for headers that must line up with it. |
ProfileAvatar | bgcolor? (override the name-hashed colour), initials? ('single' | 'full'). |
useListingError(error) (templates/utils.ts) | Status code + subtitle copy for Listing40XTemplate and its forks; replaces extractLastStatus. |
StaticPageTemplate | bannerUrl removed; the banner renders only when there is a title. |
Removed or moved
Tenant forks that still reference these will fail type-check:
| Was | Now |
|---|---|
shared/StickyBar | Removed. |
Dialogs/ContactUsDialog/ContactUsForm | Removed — the dialog composes ContactFormFields + useContactForm. |
Forms/ContactForm/FormField, Forms/ContactForm/FieldWrapper | Forms/FormField, Forms/FieldWrapper (exported from @shared/Forms). |
ContactForm/schema messageRequired | @configs/forms requirements. |
PricePicker/PriceSelect, PricePicker showLabels | PriceInputs / PriceSlider, @configs/filters priceInputs. |
Map/MapTitle/components/SelectedLocations | Map/SelectedLocations. |
useOverlayLayers/polygon.ts | addPolygonToMap / removePolygonFromMap in utils/map/polygons. |
ContactUsDialog option mode | mlsNumber presence. |
CmsContentRenderer predefinedStyles | layout. |
SubscribeForm title / subtitle, ReviewsCarousel loop, ContentCard footer, SortModesSelect disabled | Removed. |
Listing40XTemplate extractLastStatus | useListingError (templates/utils.ts). |
usePointMarker, usePointRadius | usePoint. |
Map/hooks/useOverlayLayers/useMapListener | Map/hooks/useMapListener (+ useMapReady). |
createContactFormSchema, createScheduleFormSchema | createFormSchema(t, requirements, contactFields | scheduleFields). |
usePriceFilter size param and anchorRef / clientSide / height returns | FilterChip owns the chip shell. |
Map/_movesmartly-com/MapStyleMenu fork | Promoted to the default MapStyleMenu (a MapControlButton + menu). |