Calendar

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

This component requires softui.js for interactive behavior.

Default

Click a day to select it, or the title to jump by month and year.

<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 a start date, then an end date.

<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

Two months side by side for ranges that span months.

<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" style="justify-content:center;margin-bottom:8px;font-size:13px;font-weight:600;color:var(--sui-text);"></div>
      <div class="sui-calendar-grid"></div>
    </div>
    <div class="sui-calendar-month">
      <div class="sui-calendar-title" style="justify-content:center;margin-bottom:8px;font-size:13px;font-weight:600;color:var(--sui-text);"></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

A calendar in a popover that closes on selection.

<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.

<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 time or data-sui-calendar-time="24h" for 24-hour.

<!-- 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 &amp; time (12h)</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 -->
<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 &amp; time (24h)</span>
  </button>
  <div class="sui-datepicker-popover">
    <div class="sui-calendar" data-sui-calendar="single" data-sui-calendar-time="24h">
      <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>

With Min & Max Dates

Constrain dates with data-sui-min / data-sui-max.

<div class="sui-calendar" data-sui-calendar="single"
     data-sui-min="today"
     data-sui-max="2030-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.

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>

Reference

Attribute / EventDescription
data-sui-calendar="single|range"Turns the element into a calendar. Click the title to drill into month and year views.
data-sui-calendar-timeAdds hour and minute inputs (12-hour with AM/PM; "24h" for 24-hour). Arrow keys step the values, and a popover stays open after picking a date.
data-sui-min / data-sui-max"today" or a YYYY-MM-DD date. Dates outside the range are disabled.
data-sui-disabledComma-separated YYYY-MM-DD dates to disable.
sui-datepickerWraps a trigger and a popover calendar. Picking a date (or a full range) closes the popover and fills the trigger.
data-sui-timepickerStandalone time picker (12-hour; "24h" for 24-hour). Arrow keys step the values.
sui-date-selectFires on the calendar with detail.date (plus hour, minute, period, is24h when time is on), or detail.start / end in range mode.
sui-date-clearFires on the calendar when Clear is pressed.
sui-time-changeFires on change with detail.hour, minute, period, is24h; bubbles.

Delete this item?

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