UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

47 lines (46 loc) 1.28 kB
import React from "react"; import { MonthPickerInput } from "../Date.Input"; import { MonthPickerProps } from "./MonthPicker.types"; import { MonthPickerStandalone } from "./parts/MonthPicker.Standalone"; interface MonthPickerComponent extends React.ForwardRefExoticComponent<MonthPickerProps> { /** * @example * ```jsx * <MonthPicker.Standalone * dropdownCaption * fromDate={new Date("1 Oct 2022")} * toDate={new Date("1 Oct 2026")} * /> * ``` */ Standalone: typeof MonthPickerStandalone; /** * Custom TextField for MonthPicker * @see 🏷️ {@link DateInputProps} */ Input: typeof MonthPickerInput; } /** * A component that displays a month picker. * * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/monthpicker) * @see 🏷️ {@link MonthPickerProps} * * @example * ```jsx * const { inputProps, monthpickerProps } = useMonthpicker({ * onMonthChange: console.log, * }); * * return ( * <MonthPicker {...monthpickerProps} dropdownCaption> * <MonthPicker.Input * {...inputProps} * label="Velg måned" * /> * </MonthPicker> * ); * ``` */ export declare const MonthPicker: MonthPickerComponent; export default MonthPicker;