UNPKG

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