MCPcopy Create free account
hub / github.com/adobe/react-spectrum / RangeCalendar

Function RangeCalendar

starters/docs/src/RangeCalendar.tsx:21–51  ·  view source on GitHub ↗
({
  errorMessage,
  ...props
}: RangeCalendarProps<T>)

Source from the content-addressed store, hash-verified

19}
20
21export function RangeCalendar<T extends DateValue>({
22 errorMessage,
23 ...props
24}: RangeCalendarProps<T>) {
25 let months = props.visibleDuration?.months || 1;
26 return (
27 <AriaRangeCalendar {...props}>
28 <div className="months">
29 {Array.from({length: months}, (_, i) => (
30 <div key={i} className="month">
31 <header>
32 {i === 0 && (
33 <Button slot="previous" variant="quiet">
34 <ChevronLeft />
35 </Button>
36 )}
37 <CalendarHeading offset={{months: i}} />
38 {i === months - 1 && (
39 <Button slot="next" variant="quiet">
40 <ChevronRight />
41 </Button>
42 )}
43 </header>
44 <CalendarGrid offset={{months: i}}>{date => <CalendarCell date={date} />}</CalendarGrid>
45 </div>
46 ))}
47 </div>
48 {errorMessage && <Text slot="errorMessage">{errorMessage}</Text>}
49 </AriaRangeCalendar>
50 );
51}
52
53export {CalendarGrid};
54export function CalendarCell(props: CalendarCellProps) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected