logo
DocsAPI Reference

API Reference

This page documents the public API shape used throughout the examples. Adjust the final names to match your package exports if needed.

Props

NameTypeRequiredDescription
valueNepaliDateValueNoControlled selected value.
defaultValueNepaliDateValueNoInitial selected value.
onChange(value: NepaliDateValue) => voidNoFired after selecting a date.
minDatestringNoMinimum selectable date in BS format.
maxDatestringNoMaximum selectable date in BS format.
disabledbooleanNoDisables the component.
classNamestringNoAdds custom CSS classes.
locale'en' | 'ne'NoControls display language.

Methods

MethodParametersReturnsDescription
onChangevaluevoidCalled when selection changes.
onMonthChangemonthvoidCalled when visible month changes.
onYearChangeyearvoidCalled when visible year changes.

Types

export type NepaliDateValue =
  | string
  | Date
  | {
      year: number
      month: number
      day: number
    }
 
export type CalendarProps = {
  value?: NepaliDateValue
  defaultValue?: NepaliDateValue
  onChange?: (value: NepaliDateValue) => void
  minDate?: string
  maxDate?: string
  disabled?: boolean
  className?: string
  locale?: 'en' | 'ne'
}

Import patterns

import { Calendar, DatePicker } from 'nepali-bs-calendar-react'