-
-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add MonthsDropdown and YearsDropdown custom components (#2454)
* feat: add `MonthsDropdown` and `YearsDropdown` custom components * Update docs * Update docs
- Loading branch information
Showing
8 changed files
with
123 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
|
||
import { useDayPicker } from "../useDayPicker.js"; | ||
|
||
import { DropdownProps } from "./Dropdown.js"; | ||
|
||
/** | ||
* Render the dropdown to navigate between months. | ||
* | ||
* @group Components | ||
* @see https://daypicker.dev/guides/custom-components | ||
*/ | ||
export function MonthsDropdown(props: DropdownProps) { | ||
const { components } = useDayPicker(); | ||
return <components.Dropdown {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
|
||
import { useDayPicker } from "../useDayPicker.js"; | ||
|
||
import { DropdownProps } from "./Dropdown.js"; | ||
|
||
/** | ||
* Render the dropdown to navigate between years. | ||
* | ||
* @group Components | ||
* @see https://daypicker.dev/guides/custom-components | ||
*/ | ||
export function YearsDropdown(props: DropdownProps) { | ||
const { components } = useDayPicker(); | ||
return <components.Dropdown {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters