Skip to content

NbDatePicker lets users select a date via a text input and an optional calendar dropdown. It comes in three types: simple (text only), single (with calendar), and range (start and end dates with calendar).

Simple Date Picker ​

A text-only field for manually entering dates without a calendar dropdown. Useful for memorable dates like birthdays or expiration dates.

Always communicate the expected date format with the label or helper prop. Placeholder text disappears as soon as the user starts typing, so never rely on it alone.

vue
<template>
  <NbDatePicker
    v-model="date"
    type="simple"
    label="Date of birth"
    placeholder="dd/mm/yyyy"
  />
</template>

<script setup lang="ts">
import { ref } from 'vue'

const date = ref<string | null>(null)
</script>

Single Date Picker ​

Combines a text input with a calendar dropdown. Users can type a date or select one from the calendar.

vue
<template>
  <NbDatePicker v-model="date" label="Start date" placeholder="dd/mm/yyyy" />
</template>

<script setup lang="ts">
import { ref } from 'vue'

const date = ref<string | null>(null)
</script>

Date Range Picker ​

Two inputs for selecting a start and end date. Selecting the start date automatically moves focus to the end date input.

vue
<template>
  <NbDatePicker
    v-model="start"
    v-model:end-value="end"
    type="range"
    label="Date range"
    placeholder="Start date"
    end-placeholder="End date"
  />
</template>

<script setup lang="ts">
import { ref } from 'vue'

const start = ref<string | null>(null)
const end = ref<string | null>(null)
</script>

Per-field labels ​

Give each range field its own label with endLabel. When set, label sits above the start field and endLabel above the end field, so screen readers announce each input unambiguously.

vue
<NbDatePicker
  v-model="start"
  v-model:end-value="end"
  type="range"
  label="Start date"
  end-label="End date"
/>

Min and Max Dates ​

Constrain the selectable date range. Dates outside the bounds are visually dimmed in the calendar and cannot be selected, and dates typed into the field are rejected when they fall outside the bounds.

vue
<NbDatePicker
  v-model="date"
  label="Appointment"
  min="2026-04-10"
  max="2026-04-25"
/>

Disabled Dates ​

Beyond min/max, individual dates can be blocked with disabledDates: either an array of ISO strings or a predicate function. Use it for holidays, weekends, or fully booked days. Disabled dates stay keyboard-focusable so their labels remain discoverable, but they cannot be selected.

vue
<template>
  <NbDatePicker
    v-model="date"
    label="Delivery date"
    helper="Weekends are unavailable"
    :disabled-dates="isWeekend"
  />
</template>

<script setup lang="ts">
import { ref } from 'vue'

const date = ref<string | null>(null)

function isWeekend(iso: string): boolean {
  const day = new Date(iso + 'T00:00:00').getDay()
  return day === 0 || day === 6
}
</script>

Validation States ​

Use error or warning props to display validation feedback below the field. error takes precedence over warning, which takes precedence over helper.

vue
<NbDatePicker
  v-model="date"
  label="Departure"
  error="A valid date is required"
/>
<NbDatePicker
  v-model="date"
  label="Return"
  warning="This date falls on a holiday"
/>

Per-field validation (range) ​

In a range picker each field validates independently, so users can see exactly which field needs correction. error/warning mark only the start field; endError/endWarning mark only the end field.

vue
<NbDatePicker
  v-model="start"
  v-model:end-value="end"
  type="range"
  label="Start date"
  end-label="End date"
  end-error="End date must be after the start date"
/>

Helper Text ​

vue
<NbDatePicker v-model="date" label="Invoice date" helper="Format: dd/mm/yyyy" />

Sizes ​

Three sizes matching the rest of the design system: sm (32px), md (40px, default), and lg (48px).

vue
<NbDatePicker v-model="date" label="Small" size="sm" />
<NbDatePicker v-model="date" label="Medium" size="md" />
<NbDatePicker v-model="date" label="Large" size="lg" />

Disabled and Read-only ​

A disabled field cannot be interacted with at all. A read-only field remains focusable and its value can be copied, but it cannot be edited and the calendar does not open.

vue
<NbDatePicker v-model="date" label="Disabled" disabled />
<NbDatePicker v-model="date" label="Read-only" readonly />

Fluid Variant ​

The fluid variant places the label inside the field, matching other fluid-style form controls. Validation feedback appears as an icon in the field header (hover it for the full message), the same behaviour as the fluid NbTextInput.

vue
<NbDatePicker
  v-model="date"
  variant="fluid"
  label="Delivery date"
  placeholder="dd/mm/yyyy"
/>
<NbDatePicker
  v-model="date"
  variant="fluid"
  label="Delivery date"
  error="A valid date is required"
/>

Week Starting on Sunday ​

vue
<NbDatePicker v-model="date" label="Date" :week-start="0" />

Keyboard Navigation ​

The calendar dropdown follows the WAI-ARIA Date Picker Dialog pattern for full keyboard accessibility.

Input field:

KeyAction
EnterOpens the calendar and focuses the selected or current date
ArrowDownOpens the calendar and focuses the selected or current date
EscapeCloses the calendar

Calendar grid:

KeyAction
ArrowRightMove to the next day
ArrowLeftMove to the previous day
ArrowDownMove to the same day in the next week
ArrowUpMove to the same day in the previous week
HomeMove to the first day of the current week
EndMove to the last day of the current week
PageUpMove to the same date in the previous month
PageDownMove to the same date in the next month
Shift+PageUpMove to the same date in the previous year
Shift+PageDownMove to the same date in the next year
Enter / SpaceSelect the focused date and close the calendar
EscapeClose the calendar without selecting
TabClose the calendar and return focus to the input

The calendar header also provides clickable previous/next month (single caret) and previous/next year (double caret) buttons.

Props ​

PropTypeDefaultDescription
modelValuestring | nullnullSelected date as ISO string (YYYY-MM-DD)
type'simple' | 'single' | 'range''single'Picker variant
endValuestring | nullnullEnd date for range type (v-model:end-value)
labelstring''Label text
placeholderstringlocale hintPlaceholder text (defaults to locale date format hint)
endPlaceholderstring''Placeholder for the end date input (range only)
endLabelstring''Label for the end field (range only); when set, label and endLabel render above their own fields
variant'default' | 'fluid''default'Presentation variant
size'sm' | 'md' | 'lg''md'Field height: 32px, 40px, or 48px
minstringundefinedMinimum selectable date (ISO YYYY-MM-DD)
maxstringundefinedMaximum selectable date (ISO YYYY-MM-DD)
disabledDatesstring[] | (date: string) => booleanundefinedIndividual unselectable dates: ISO string array or predicate
weekStart0 | 11First day of the week: 0 = Sunday, 1 = Monday
localestringbrowser localeBCP 47 locale tag for month/weekday labels and format hint
helperstring''Helper text below the field
errorstring''Error message for the start field (takes precedence over warning and helper)
warningstring''Warning message for the start field (shown when no error)
endErrorstring''Error message for the end field (range only)
endWarningstring''Warning message for the end field (range only, shown when no endError)
disabledbooleanfalseDisables the input and calendar
readonlybooleanfalseRead-only: focusable and copyable, but not editable and the calendar does not open
requiredbooleanfalseMarks the field as required
namestring''HTML name attribute
idstringauto-generatedExplicit element id

Events ​

EventPayloadDescription
update:modelValuestring | nullSelected date changed
update:endValuestring | nullEnd date changed (range type only)
changestring | nullEmitted alongside modelValue updates

Exposed Methods ​

MethodDescription
openOpens the calendar dropdown
closeCloses the calendar dropdown
focusFocuses the start date input