RangeMonths
A server-rendered run of consecutive month grids for picking a stay's check-in and check-out, or a single date.
September 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1$132 | 2$132 | 3$132 | 4$168 | 5$168 | ||
| 6$132 | 7$132 | 8$132 | 9$132 | 10$132 | 11$168 | 12$168 |
| 13$132 | 14$132 | 15$132 | 16$132 | 17$132 | 18$168 | 19$168 |
| 20$132 | 21$132 | 22$132 | 23$132 | 24$132 | 25$168 | 26$168 |
| 27$132 | 28$132 | 29$132 | 30$132 |
October 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1$132 | 2$168 | 3$168 | ||||
| 4$132 | 5$132 | 6$132 | 7$132 | 8$132 | 9$168 | 10$168 |
| 11$132 | 12$132 | 13$132 | 14$132 | 15$132 | 16$168 | 17$168 |
| 18$132 | 19$132 | 20$132 | 21$132 | 22$132 | 23$168 | 24$168 |
| 25$132 | 26$132 | 27$132 | 28$132 | 29$132 | 30$168 | 31$168 |
View code
<RangeMonths
label="Stay dates"
labels={{ previous: "Previous month", next: "Next month", start: "check-in", end: "check-out" }}
locale="en-US"
month={query.month ?? "2026-09"}
start={query.checkIn}
end={query.checkOut}
today={today}
min={today}
isUnavailable={(date) => booked.has(date)}
dayNote={(date) => `$${nightlyPrice(date)}`}
href={({ start, end, month }) =>
`?${new URLSearchParams({ month, ...(start && { checkIn: start }), ...(end && { checkOut: end }) })}`
}
/>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Or copy it into your project to edit it:
sdxc ui add range-monthsUsage
import { RangeMonths } from "@sdxc/ui";Renders months month grids from month, each day a link to href's URL for the selection
a click makes: with no start, or both ends set, the day becomes a new start; with only a start,
a later day becomes the end and an earlier or equal one the new start. Single mode links each day
as { start: day }. Unavailable days, days outside min–max, and, while a start waits for its
end, days past the first unavailable day after it render as plain text.
Examples
<RangeMonths single months={1} label={t("jump")} labels={labels} month="2026-03" start={day} today={today} href={({ start, month }) => `/day/${start ?? month}`} />Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
month | string | Yes | First month shown, YYYY-MM. |
months | number | No | How many consecutive months to show, side by side while they fit and one per row below. Defaults to DEFAULT_MONTHS. |
start | string | No | Chosen start day (the picked day in single mode), YYYY-MM-DD. |
end | string | No | Chosen end day, YYYY-MM-DD; read in range mode only. |
single | boolean | No | Picks one day: a day link carries start alone and no band is drawn. |
today | string | No | Today, YYYY-MM-DD, passed in so the server and the browser draw the same marker. |
min | string | No | Earliest selectable day, YYYY-MM-DD; also hides the previous link before its month. |
max | string | No | Latest selectable day, YYYY-MM-DD; also hides the next link from its month on. |
isUnavailable | (date: string) => boolean | No | Days already taken: drawn struck through, never a link, and never crossed by a range. |
href | (next: Next) => string | Yes | Builds the URL of every day and month link from what that link selects. |
dayNote | (date: string) => RemixNode | No | A small line under each day's number, such as the nightly price or event dots. |
weekStartsOn | number | No | First weekday column, 0 for Sunday through 6 for Saturday. Defaults to DEFAULT_WEEK_STARTS_ON. |
locale | string | No | BCP 47 locale for the month, weekday and day names; pass it so server and browser agree. |
label | string | Yes | Names the whole calendar, e.g. "Stay dates". |
headingLevel | Heading.Level | No | Level of each month's heading; resolved from the surrounding heading scope when unset. |
labels | Labels | Yes | Words read to assistive technology. |
Also accepts everything in Omit<TagProps<"div">, "children">.