Skip to content

shadcn.io is an independent project built on shadcn/ui

Beach Tide Finder Map Block for React

Seven Cornish beaches on a live map with a time slider over the tide curve: wave pills, sand that comes and goes, and the calmest beach with room named.

On this page5 sections

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Pick a beach for the hour you can get there, with this tide-aware beach map for React with Base UI. Shorewick, a surf and beach guide, follows seven real beaches round Newquay on Cornwall's north coast, from Mawgan Porth to Perran Beach, on a live Map that follows your theme. A card over the map holds the day's tide curve and a Slider from 06:00 to 20:00 in half hours: as the tide rises each beach loses sand at its own rate, and the swell reaches each one in its own share. Every beach is a pill with its wave height, dashed once it has less than 60 m of sand, and Shorewick's pick, the calmest water among the beaches with room, is the inverted pill, the named card and the row marked with a Badge. Choosing a beach, on the map or in the list, flies the camera there; the frame button shows all seven again. On tablets and phones the card docks under the map. Built from Map, Slider, Badge, Button and Guides. For surf schools, coastal tourism and any beach guide where the tide decides.

FAQ

How is the pick worked out?

readingOf gives each beach its sand, base minus drop for every metre of tide above low water, and its wave height, the open-sea swell times the beach's exposure. A beach counts once it has at least 60 m of sand (ROOM), and pickAt takes the calmest water among those, with more sand breaking a tie. At high water only the wide beaches keep room, so the pick moves along the coast as the hour changes.

Where do the tide and the swell come from?

TIDE and SWELL are typed series with one value for each hour from 06:00 to 20:00, read straight between hours for the half-hour steps. The curve in the card is drawn from the same TIDE, so it can't disagree with the figures. The beaches and their places are real; the tide, the swell, the sand and the amenities are invented sample data, and nothing is read from a tide gauge or a buoy.

What stays local, and how do I use my own coast?

Everything stays in the page: nothing is booked, saved or sent, and the only thing loaded is the map's tiles. Replace LINES with your beaches (name, longitude, latitude and the three numbers) and the two series with a tide table and a swell forecast for your coast; the camera frames whatever beaches you list.

Can I use it without a mouse?

Yes. The slider takes the arrow keys and speaks the time and the tide, every beach in the list is a button that flies the map there, and the zoom and frame buttons work from the keyboard. The pills on the map are a pointer shortcut to the same choice, and a polite message gives the hour, the beaches with room and the pick once the slider settles.

How does it look on a phone?

The map comes first, then the card that floats over it on wide screens: the hour, the tide curve, the slider and the pick, with the seven beaches beside them on a tablet and under them on a phone. Rows keep one height at every hour, so moving the slider never moves the page, and the page scrolls over the map unless you use two fingers.

Can I rely on it to decide where to swim?

No. It shows how a tide-aware guide could rank beaches, with invented figures, and the caption says so. Real conditions change with the wind, the rips and the season: swim at lifeguarded beaches, between the flags.