October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Render and Select Marina Slips in React SVG

Render slips from marina-provided data as SVG shapes in React, track selection in state, and pair the map with accessible controls and clear status details.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build a marina slip map by drawing the supplied plan as SVG geometry, rendering each slip from data in React, and storing the selected slip in React state. Plain SVG is enough for this first version: React supports SVG elements directly, so the example needs no mapping SDK or diagramming package. The sample layout below is illustrative, not a surveyed marina plan, and its status values are not live availability.

What you need before drawing the map

Ask the marina or project owner for the authoritative plan, its coordinate system and scale, and how the plan is updated. You also need the slip inventory, stable identifiers, user-facing labels, and the meaning and source of any status shown. Those are project inputs, not values a generic code example can supply.

As an Amazon Associate I earn from qualifying purchases.

This tutorial models selection and inspection only. Booking, pricing, and operational availability require additional rules and a trustworthy data source; do not label a status as live unless the application has a real source and update path for it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Represent slips as data, not separate hand-drawn components

Keep the map’s geometry in SVG coordinates and the slip facts in application data. The following property names are an example schema, not a marina standard. Use marina-provided identifiers where possible.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
const slips = [
  { id: "A-01", label: "Slip A-01", x: 30, y: 40, width: 48, height: 18, status: "Available" },
  { id: "A-02", label: "Slip A-02", x: 30, y: 64, width: 48, height: 18, status: "Occupied" },
];

Choose coordinates from the supplied plan. The example numbers above exist only to make the code concrete; they do not describe real dimensions, scale, or inventory.

Render SVG geometry from the data in React

React’s built-in DOM components include SVG elements, so JSX can render a map without an SVG-specific React library. A viewBox establishes the drawing’s internal coordinate space. Confirm responsive sizing and aspect-ratio behavior in the actual layout rather than assuming a particular map scaling will suit every plan.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
function MarinaMap() {
  const [selectedSlipId, setSelectedSlipId] = React.useState(null);
  const selectedSlip = slips.find((slip) => slip.id === selectedSlipId);

  return (
    <div className="marina-map-layout">
      <svg viewBox="0 0 240 180" role="img" aria-label="Marina slip map">
        <rect x="0" y="0" width="240" height="180" fill="#d9edf2" />
        <path d="M 95 15 V 165" stroke="#98754b" strokeWidth="8" />
        {slips.map((slip) => {
          const isSelected = slip.id === selectedSlipId;
          return (
            <g key={slip.id} onClick={() => setSelectedSlipId(slip.id)}>
              <rect
                x={slip.x}
                y={slip.y}
                width={slip.width}
                height={slip.height}
                fill={isSelected ? "#f4c95d" : slip.status === "Occupied" ? "#e1a59e" : "#a9d6b2"}
                stroke={isSelected ? "#153b50" : "#405968"}
                strokeWidth={isSelected ? 2 : 1}
              />
              <text x={slip.x + 4} y={slip.y + 13} fontSize="8">{slip.label}</text>
            </g>
          );
        })}
      </svg>
      <section aria-live="polite">
        {selectedSlip ? (
          <>
            <h2>{selectedSlip.label}</h2>
            <p>Status: {selectedSlip.status}</p>
          </>
        ) : (
          <p>Select a slip to inspect its details.</p>
        )}
      </section>
    </div>
  );
}

Each slip becomes a sibling SVG group keyed by its stable ID. React’s list guidance explains that unique keys help it track items as a list changes: React Quick Start. The selected ID is state; the displayed details and selected styling are derived from that state rather than maintained as separate copies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pass a function to onClick as shown. React’s event guidance explains that event handlers are functions passed to JSX elements, while state holds information that changes over time: React: Responding to Events. React’s SVG support is documented in React DOM Components.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Make selecting a slip work beyond a mouse click

Provide a semantic companion control

The SVG map should not be the only way to find and choose a slip. A straightforward keyboard-accessible pattern is a companion list of real HTML buttons, synchronized with the same selected ID:

<ul>
  {slips.map((slip) => (
    <li key={slip.id}>
      <button type="button" onClick={() => setSelectedSlipId(slip.id)}>
        {slip.label} — {slip.status}
      </button>
    </li>
  ))}
</ul>

React recommends appropriate HTML elements for event handlers; its event guide notes that a semantic button provides built-in keyboard navigation: React: Responding to Events. Keep the detail panel and companion choices in step with map selection.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

If the SVG shapes themselves are controls

Plan focus order, keyboard activation, accessible names, and an obvious visible focus style deliberately, then test in your target browsers and assistive technologies. The W3C SVG 2 interactivity specification warns: “Authors should not rely on this behavior; all interactive elements should directly support keyboard interaction.” It cautions against assuming that elements with pointer or focus listeners will automatically be focusable: W3C: Scripting and Interactivity — SVG 2.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Design hit areas and status cues deliberately

SVG pointer hit-testing targets the topmost eligible graphic under the pointer. The pointer-events property affects which painted or geometric regions can receive pointer events: W3C: Scripting and Interactivity — SVG 2. Narrow outlines can be hard to select, so test the actual slip targets and ensure decorative shapes or overlays do not block them. If you add a larger interaction area, do not assume that making it visually unobtrusive makes it irrelevant to assistive technology; the W3C’s May 20, 2026 SVG accessibility mappings working draft discusses large invisible map and chart targets and their need to remain perceivable and interactive to assistive-technology users: W3C: SVG Accessibility API Mappings 1.0 Working Draft.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Do not encode available, occupied, selected, or unavailable status through color alone. Pair color with readable text or another clear visual distinction, and expose the slip label and status in the details region or companion list. Agree on the status vocabulary and its authority with the marina; the example labels are not operational data.

Validate the map against the real project

Before using the map operationally, check that its geometry corresponds to the authoritative plan and that each rendered slip matches the inventory. Also establish whether the interaction is inspection only or includes reservations or other actions, which system owns status, how fresh status must be, and which browsers, screen sizes, input modes, and assistive technologies must work.

If the plan is surveyed or maintained in CAD, decide how its geometry will be transformed into SVG coordinates and how updates will reach the application. If the map will support pan, zoom, or pointer-coordinate conversion, prototype and verify those behaviors against the chosen coordinate system; they are additional implementation work, not automatic consequences of using SVG.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.