UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

48 lines (47 loc) 1.39 kB
import React from "react"; import { DatePickerInput } from "../Date.Input"; import { ConditionalModeProps, DatePickerDefaultProps } from "./DatePicker.types"; import DatePickerStandalone from "./parts/DatePicker.Standalone"; export type DatePickerProps = DatePickerDefaultProps & ConditionalModeProps; interface DatePickerComponent extends React.ForwardRefExoticComponent<DatePickerProps> { /** * @example * ```jsx * <DatePicker.Standalone * dropdownCaption * fromDate={new Date("2022-10-01")} * toDate={new Date("2026-10-01")} * /> * ``` */ Standalone: typeof DatePickerStandalone; /** * Custom TextField for DatePicker * @see 🏷️ {@link DateInputProps} */ Input: typeof DatePickerInput; } /** * A component that allows users to select a date from a calendar. * * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/datepicker) * @see 🏷️ {@link DatePickerProps} * * @example * ```jsx * const { inputProps, datepickerProps } = useMonthpicker({ * onMonthChange: console.log, * }); * * return ( * <DatePicker {...datepickerProps} dropdownCaption> * <DatePicker.Input * {...inputProps} * label="Velg dato" * /> * </DatePicker> * ); * ``` */ export declare const DatePicker: DatePickerComponent; export default DatePicker;