SwipeUI

Seat map

A cabin from your layout data with passenger assignments, deck switching and a pinchable viewport.

npx @swipeui/cli add seat-map
Variant
Preset
Material
Scheme
Feel
Interactive web demo. Native materials, gestures and system presentation differ on device.

When to use it

  • Assign places to several travellers from a supplied layout.

When not to use it

  • A generic editable floor plan.

Installation

Installs with a Pro licence

Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.

Usage

import { SeatMap, buildCabin } from '@/components/swipeui/special/seat-map';

const layout = {
  decks: [
    {
      id: 'main',
      label: 'Main',
      sections: [buildCabin({ rows: [1, 30], pattern: 'ABC DEF', exitRows: [12] })],
    },
  ],
};
<SeatMap layout={layout} passengers={[{ id: 'p1', name: 'Alex' }]} />;

Examples

The single-aisle, twin-aisle and two-decks boards all assign seats to two travellers.

SeatMap settings

PropDoesDefault
layoutDecks containing labelled sections, numbered rows and seat, aisle, gap or facility cellsRequired
passengersID, name and optional initials per travellerRequired
value, defaultValue, onValueChangePassenger ID → seat ID, controlled or uncontrolled{}
activePassenger, onActivePassengerChangeActive travellerFirst
autoAdvanceAdvance to another unassigned traveller after assignmenttrue
deck, defaultDeck, onDeckChangeActive deck; assignments survive switchingFirst
zoomPinch, two-axis pan, double tap and icon buttons on the cabintrue
miniMapAircraft overview with viewport rectangle, on the cabintrue
legendFive seat-state swatches with marks and labelstrue
detailsPrice, status and amenities in a popover by the seat, a dock below, or nonepopover
detailsTimeoutMilliseconds the popover stays after a press or long press; 0 keeps it2400
totalSeparate subtotals per currencytrue
localePrice formatting localeen-US
onSeatPressReports all seat presses, including refusals—
disabledPrevent interactionfalse
hapticsselect, blocked, deck, or all offtrue
revealSpeedRow reveal: slow, normal, fast or milliseconds per rowslow
messagesBuilt-in labels, amenities, seat and assignment formattersEnglish
motionShared motion overrideApp feel
className, style, testIDRoot and part hooks—

Composition and behaviour

buildCabin returns a section. Compose any number of sections and decks; use idPrefix when decks reuse row numbers. A facility cell supports kind and span. Price amounts are integer minor units with an ISO currency code. Zero- and three-decimal currencies are formatted correctly; unlike currencies stay separate. Moving a traveller frees their old seat. Choosing their current seat removes it. Occupied, blocked and other travellers' seats refuse assignment.

The cabin is drawn as an aircraft. Rows flagged wing place the wings, and a deck without them has none. Seat colour shows availability (green available, grey occupied, red blocked, primary selected) and every state keeps a mark. Hover a seat with a pointer, hold it, or press it for a popover with its price, status and amenities; pass priceFor to buildCabin to price a cabin by rule.

The nose and physical seat order stay fixed in RTL. Each seat is a named button with amenities, price, state and its traveller. Zoom buttons give a gesture alternative. At fitted zoom dense seats are smaller: zoom in for full targets. Chrome stays outside the transform. Rows window after the gesture settles with overscan; use the zoom buttons to bring other rows into view with a screen reader. Wrap the component in a pan-owning region when embedding it in a scrolling screen. Reduce Motion shows every row immediately and keeps direct manipulation.

Native accessibility, device motion checks and recordings remain pending.

Behavior and gestures

  • Tap a place to assign the active traveller; unavailable places keep their marks.
  • Pinch, pan in both directions or double tap the cabin; use the equivalent zoom buttons.
  • Change decks without losing assignments.

Accessibility

  • Each place is a named button with amenities, state and price.
  • Physical seat order remains left to right in RTL.

Motion

  • Uses the drag and toggle motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • The cabin follows the fingers, settling on drag.
  • Rows reveal at a readable pace set by revealSpeed; toggle fades the seats. Reduce Motion shows the final state.

Performance

  • Static cabin art is memoised; gestures transform one layer.

Notes for AI

  • Prices use integer minor units and an ISO currency. Mixed currencies get separate totals.
  • Wrap the canvas in a pan-owning region on a scrolling showcase.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items