UNPKG

1.13 kBTypeScriptView Raw
1import React from "react";
2import type { ClassNames, CustomComponents } from "../types/index.js";
3/** An option to use in the dropdown. Maps to the `<option>` HTML element. */
4export type DropdownOption = {
5 /** The value of the option. */
6 value: number;
7 /** The label of the option. */
8 label: string;
9 /**
10 * The dropdown option is disabled when it cannot be selected because out of
11 * the calendar range.
12 */
13 disabled: boolean;
14};
15/**
16 * Render a dropdown component to use in the navigation bar.
17 *
18 * @group Components
19 * @see https://daypicker.dev/guides/custom-components
20 */
21export declare function Dropdown(props: {
22 /**
23 * @deprecated Use{@link useDayPicker} hook to get the list of internal
24 * components.
25 */
26 components: CustomComponents;
27 /**
28 * @deprecated Use {@link useDayPicker} hook to get the list of internal
29 * class names.
30 */
31 classNames: ClassNames;
32 options?: DropdownOption[] | undefined;
33} & Omit<JSX.IntrinsicElements["select"], "children">): React.JSX.Element;
34export type DropdownProps = Parameters<typeof Dropdown>[0];