Skip to content

Date Picker

Last updated 24 Nov 2026

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>

Typing a date ​

A typed date is read in the field order of the locale, the same order the field displays dates in. With locale="en-GB", 05/12/2024 is 5 December. With locale="en-US", it is 12 May. Day, month and year can be separated by /, ., - or spaces, and the year needs four digits. An ISO date (2024-12-05) is accepted in any locale, and so is a date that starts with a four-digit year.

Nothing is emitted until the text is a complete date that exists on the calendar, so the field is never rewritten while someone is still typing. 31/02/2024 emits nothing. Clearing the field emits null.

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 ​

Four sizes matching the rest of the design system, fields and buttons alike: xs (24px), sm (32px), md (40px, default), and lg (48px). The calendar button is an NbButton of the same size.

vue
<NbDatePicker v-model="date" label="Extra small" size="xs" />
<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, where the placeholder would be while it is empty, and steps it up and smaller once there is a date or focus, the same behaviour as the fluid NbTextInput. Validation feedback appears as an icon on the value line (hover it for the full message). The field keeps the height of its size (xs is drawn at sm).

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"
/>

In an Input Group ​

Inside an NbInputGroup the picker is one member of the row. It takes the group's size, disabled state and error or warning, points at the group's message, and renders no label or message of its own, so its box lines up with the buttons beside it. Give the label and the message to the group.

vue
<template>
  <NbInputGroup label="Due date" :error="dueError">
    <template #default="{ size }">
      <NbDatePicker v-model="due" />
      <NbButton variant="primary" :size="size" @click="save">Set</NbButton>
    </template>
  </NbInputGroup>
</template>

Week Starting on Sunday ​

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

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'xs' | 'sm' | 'md' | 'lg''md'Field height: 24px, 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, the format hint and typed date order
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