Skip to content

Commit

Permalink
Update RAC Calendar docs: change visibleDuration months from 2 to 3 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
reidbarber committed Jun 26, 2023
1 parent 3c46c32 commit 7186d21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/react-aria-components/docs/Calendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ The error message element within a `Calendar` can be targeted with the `[slot=er
Multiple `CalendarGrid` elements can be rendered to show multiple months at once. The `visibleDuration` prop should be provided to the `Calendar` component to specify how many months are visible, and each `CalendarGrid` accepts an `offset` prop to specify its starting date relative to the first visible date.

```tsx example
<Calendar aria-label="Appointment date" visibleDuration={{months: 2}}>
<Calendar aria-label="Appointment date" visibleDuration={{months: 3}}>
<header>
<Button slot="previous">◀</Button>
<Heading />
Expand All @@ -435,6 +435,9 @@ Multiple `CalendarGrid` elements can be rendered to show multiple months at once
<CalendarGrid offset={{months: 1}}>
{date => <CalendarCell date={date} />}
</CalendarGrid>
<CalendarGrid offset={{months: 2}}>
{date => <CalendarCell date={date} />}
</CalendarGrid>
</div>
</Calendar>
```
Expand Down
5 changes: 4 additions & 1 deletion packages/react-aria-components/docs/RangeCalendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ The error message element within a `RangeCalendar` can be targeted with the `[sl
Multiple `CalendarGrid` elements can be rendered to show multiple months at once. The `visibleDuration` prop should be provided to the `RangeCalendar` component to specify how many months are visible, and each `CalendarGrid` accepts an `offset` prop to specify its starting date relative to the first visible date.

```tsx example
<RangeCalendar aria-label="Trip dates" visibleDuration={{months: 2}}>
<RangeCalendar aria-label="Trip dates" visibleDuration={{months: 3}}>
<header>
<Button slot="previous">◀</Button>
<Heading />
Expand All @@ -457,6 +457,9 @@ Multiple `CalendarGrid` elements can be rendered to show multiple months at once
<CalendarGrid offset={{months: 1}}>
{date => <CalendarCell date={date} />}
</CalendarGrid>
<CalendarGrid offset={{months: 2}}>
{date => <CalendarCell date={date} />}
</CalendarGrid>
</div>
</RangeCalendar>
```
Expand Down

1 comment on commit 7186d21

@rspbot
Copy link

@rspbot rspbot commented on 7186d21 Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.