Calendar

Date calendar with drill-down month/year navigation, range picking, date picker popover, and min/max constraints.

Default

A single-month calendar with today highlight. Click a day to select it. Click the title to drill down into month and year views for fast navigation.

<div class="sui-calendar" data-sui-calendar="single">
  <div class="sui-calendar-header">
    <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
    </button>
    <div class="sui-calendar-title"></div>
    <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
    </button>
  </div>
  <div class="sui-calendar-grid"></div>
  <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
</div>

Range Selection

Click two dates to select a range. The first click sets the start, the second sets the end.

<div class="sui-calendar" data-sui-calendar="range">
  <div class="sui-calendar-header">
    <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
    </button>
    <div class="sui-calendar-title"></div>
    <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
    </button>
  </div>
  <div class="sui-calendar-grid"></div>
  <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
</div>

Two Months

Display two months side by side for range selection across months. Click the title to drill down into month and year views.

<div class="sui-calendar" data-sui-calendar="range">
  <div class="sui-calendar-header">
    <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
    </button>
    <div class="sui-calendar-title"></div>
    <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
    </button>
  </div>
  <div class="sui-calendar-months">
    <div class="sui-calendar-month">
      <div class="sui-calendar-title"></div>
      <div class="sui-calendar-grid"></div>
    </div>
    <div class="sui-calendar-month">
      <div class="sui-calendar-title"></div>
      <div class="sui-calendar-grid"></div>
    </div>
  </div>
  <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
</div>

Date Picker

Click the input to open a calendar popover. Selecting a date closes the popover and updates the trigger. Use the clear button inside the calendar to reset.

<div class="sui-datepicker">
  <button class="sui-datepicker-trigger" type="button">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
    <span class="sui-datepicker-placeholder">Pick a date</span>
  </button>
  <div class="sui-datepicker-popover">
    <div class="sui-calendar" data-sui-calendar="single">
      <div class="sui-calendar-header">
        <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
        </button>
        <div class="sui-calendar-title"></div>
        <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
        </button>
      </div>
      <div class="sui-calendar-grid"></div>
      <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
    </div>
  </div>
</div>

Date Range Picker

A popover date picker in range mode. Select two dates to define a range.

<div class="sui-datepicker">
  <button class="sui-datepicker-trigger" type="button">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
    <span class="sui-datepicker-placeholder">Pick a date range</span>
  </button>
  <div class="sui-datepicker-popover">
    <div class="sui-calendar" data-sui-calendar="range">
      <div class="sui-calendar-header">
        <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
        </button>
        <div class="sui-calendar-title"></div>
        <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
        </button>
      </div>
      <div class="sui-calendar-grid"></div>
      <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
    </div>
  </div>
</div>

Date & Time Picker

Add data-sui-calendar-time for 12-hour format with AM/PM toggle, or data-sui-calendar-time="24h" for 24-hour format. Hour and minute inputs support arrow keys. The popover stays open after selecting a date so you can adjust the time.

<!-- 12-hour format (default) -->
<div class="sui-datepicker">
  <button class="sui-datepicker-trigger" type="button">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
    <span class="sui-datepicker-placeholder">Pick date & time</span>
  </button>
  <div class="sui-datepicker-popover">
    <div class="sui-calendar" data-sui-calendar="single" data-sui-calendar-time>
      <div class="sui-calendar-header">
        <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
        </button>
        <div class="sui-calendar-title"></div>
        <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
        </button>
      </div>
      <div class="sui-calendar-grid"></div>
      <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
    </div>
  </div>
</div>

<!-- 24-hour format — just change the attribute value -->
<div class="sui-calendar" data-sui-calendar="single" data-sui-calendar-time="24h">
  <!-- same structure as above -->
</div>

With Min & Max Dates

Constrain selectable dates with data-sui-min and data-sui-max. Accepts "today" or a date string like "2026-06-15" (YYYY-MM-DD). Dates outside the range are disabled.

<div class="sui-calendar" data-sui-calendar="single"
     data-sui-min="today"
     data-sui-max="2026-12-31">
  <div class="sui-calendar-header">
    <button class="sui-calendar-nav-btn" data-sui-calendar-prev type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
    </button>
    <div class="sui-calendar-title"></div>
    <button class="sui-calendar-nav-btn" data-sui-calendar-next type="button">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
    </button>
  </div>
  <div class="sui-calendar-grid"></div>
  <button class="sui-calendar-clear" data-sui-calendar-clear type="button">Clear</button>
</div>

<!-- Supported values for data-sui-min / data-sui-max:
     "today"        — relative to current date
     "2026-03-15"   — specific date (YYYY-MM-DD)

     You can also disable specific dates:
     data-sui-disabled="2026-03-25,2026-04-01"
-->

Time Picker

A standalone time picker without a calendar. Use data-sui-timepicker for 12-hour format or data-sui-timepicker="24h" for 24-hour. Arrow keys increment/decrement values. Fires a sui-time-change event.

12-hour

24-hour

<!-- 12-hour time picker -->
<div class="sui-timepicker" data-sui-timepicker></div>

<!-- 24-hour time picker -->
<div class="sui-timepicker" data-sui-timepicker="24h"></div>

<!-- Listen for changes -->
<script>
  document.querySelector('.sui-timepicker').addEventListener('sui-time-change', function(e) {
    console.log(e.detail); // { hour: 2, minute: 30, period: 'PM', is24h: false }
  });
</script>

Delete this item?

This action cannot be undone. This will permanently delete the item and remove all associated data.