---
title: "DatePicker"
description: "Date picker with v-model support. Wraps the Polaris <s-date-picker> web component."
canonical_url: "https://shopify.yan.ad/components/forms/date-picker"
---
# DatePicker

> Date picker with v-model support. Wraps the Polaris <s-date-picker> web component.

## Live preview

<polaris-preview example="date-picker">



</polaris-preview>

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        modelValue
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Bound value (use with <code>
        v-model
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        'single' | 'range'
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Selection type
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        defaultView
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Default calendar view
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        view
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Current calendar view
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        allow
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Allowed date range
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        disallow
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Disallowed date range
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        allowDays
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Allowed days of week
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        disallowDays
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Disallowed days of week
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        defaultValue
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Default value (uncontrolled)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Form field name
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Payload
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        update:modelValue
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Emitted when value changes (v-model)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        change
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Native change event
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        input
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Native input event
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        focus
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Emitted on focus
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        blur
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Emitted on blur
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        viewchange
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Emitted when the calendar view changes
    </td>
  </tr>
</tbody>
</table>

## Slots

<table>
<thead>
  <tr>
    <th>
      Slot
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      Additional content
    </td>
  </tr>
</tbody>
</table>

## Polaris Element

Renders as `<s-date-picker>`. See [Polaris DatePicker docs](https://shopify.dev/docs/api/app-home/web-components/forms/date-picker).


## Sitemap

See the full [sitemap](https://shopify.yan.ad/sitemap.md) for all pages.
