Skip to Content
Technical GuideShared Components

Shared Components

API reference for the reusable building blocks under src/components/shared/, src/components/atoms/ and src/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)

ExportWhat it isProps / API
MapControlsStackThe 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.
MapControlButtonOne 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.
mapControlSxThe same chrome as an sx object, for a control that can’t be a MapControlButton (e.g. a menu trigger).({ active?, dimmed?, activeBg? })
MapLocateButtonGPS “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 · MapStyleMenuZoom pair and base-style menu.disabled? — e.g. while the map is still loading.
SelectedLocationsThe 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).
SelectedLocationsBarMobile 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
HomeMapSingle-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.
OverlayLocationButtonTouch-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?) — a tag-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: true adds 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 through data-members.

Map hooks (@shared/Map/hooks)

HookDoes
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)

ExportWhat it isProps / API
FilterChipThe 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
ListingTypePanelListing-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?
RangeChipFilterBar 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
LotFrontageFilterFrom/to lot-frontage inputs (advanced filters lotFrontage slot).from?, to?, disabled?, onChange
PricePickerHistogram + 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 · ActiveRangeSelectAdvanced-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.

ExportWhat it isProps / 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 }
FormRequirementsContext provider for the resolved rules; wrap the fields in it.requirements, children
FormFieldreact-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
FieldWrapperCaption label (+ *) above any control. Moved up from ContactForm/.label?, required?, containerSx?
RequiredAnyHintThe 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).—
ContactFormInline 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).
ContactFormFieldsThe 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 }) · DateFieldName/email/phone + date + time forms (PDP tour, estimate meeting). The caller owns the payload via send.DateField: name ('date' | 'time'), control, label
LegalTextConsent/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)

ExportProps / API
BaseResponsiveDialogNew: 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

ComponentChange
ListingCard → TagsInside 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”.
CardContainerwidth / height accept any CSS length (numbers stay px).
CardIconCountsPlaceholders are per field: a scrubbed bed/bath/sqft value shows its own placeholder; a genuine 0 still renders nothing.
ListingCardmatchedImage (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.
ListingCarouselDesktop column count per card size from @configs/cards-grids desktopCarouselColumns.
useCarousel (every Carousel)Horizontal trackpad / wheel swipes page the carousel (hooks/useWheelNavigation).
HeroGallerychildren? — rendered at the end of the gallery stack, after the thumbnails.

CMS

ComponentChange
CmsContentRendererpredefinedStyles → layout?: PageLayout. Predefined typography applies unless layout === 'custom' (self-styled pages).
ContactWidgetNew widget param tags (≤ 5 plain labels) — FUB tags for the leads it produces.

Atoms & templates

ExportChange
LoadingContentheight? (default 220) — reserve the space the awaited content will take.
ContentShadowExports contentShadowTop (64) for headers that must line up with it.
ProfileAvatarbgcolor? (override the name-hashed colour), initials? ('single' | 'full').
useListingError(error) (templates/utils.ts)Status code + subtitle copy for Listing40XTemplate and its forks; replaces extractLastStatus.
StaticPageTemplatebannerUrl removed; the banner renders only when there is a title.

Removed or moved

Tenant forks that still reference these will fail type-check:

WasNow
shared/StickyBarRemoved.
Dialogs/ContactUsDialog/ContactUsFormRemoved — the dialog composes ContactFormFields + useContactForm.
Forms/ContactForm/FormField, Forms/ContactForm/FieldWrapperForms/FormField, Forms/FieldWrapper (exported from @shared/Forms).
ContactForm/schema messageRequired@configs/forms requirements.
PricePicker/PriceSelect, PricePicker showLabelsPriceInputs / PriceSlider, @configs/filters priceInputs.
Map/MapTitle/components/SelectedLocationsMap/SelectedLocations.
useOverlayLayers/polygon.tsaddPolygonToMap / removePolygonFromMap in utils/map/polygons.
ContactUsDialog option modemlsNumber presence.
CmsContentRenderer predefinedStyleslayout.
SubscribeForm title / subtitle, ReviewsCarousel loop, ContentCard footer, SortModesSelect disabledRemoved.
Listing40XTemplate extractLastStatususeListingError (templates/utils.ts).
usePointMarker, usePointRadiususePoint.
Map/hooks/useOverlayLayers/useMapListenerMap/hooks/useMapListener (+ useMapReady).
createContactFormSchema, createScheduleFormSchemacreateFormSchema(t, requirements, contactFields | scheduleFields).
usePriceFilter size param and anchorRef / clientSide / height returnsFilterChip owns the chip shell.
Map/_movesmartly-com/MapStyleMenu forkPromoted to the default MapStyleMenu (a MapControlButton + menu).
Last updated on