Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Start and end

Hold the range as two ISO date strings, start and end, and read them from the form on submit.

A controlled range field
start-name and end-name are the form field names the start and end dates post under. The control keeps a hidden input for each, so a plain form submits both without any JavaScript.
Show code
<app-date-range-picker label="Stay dates" start-name="stayStart" end-name="stayEnd"></app-date-range-picker>

Min and max

Constrain the selectable window with min and max so days outside it cannot be picked as either end.

Restrict to a valid window
Show code
<app-date-range-picker start-name="repStart" end-name="repEnd" start="2026-07-05" end="2026-07-18" min="2026-07-01" max="2026-07-31"></app-date-range-picker>

Quick ranges

Offer common periods as one-click presets, such as this month, so people skip the calendar.

Named presets, resolved in IST
Show code
<app-date-range-picker label="Invoice date" start-name="prStart" end-name="prEnd" presets="today,last7Days,thisMonth,lastMonth,thisFinancialYear"></app-date-range-picker>

Sizes

Match the range field height to the inputs beside it, using sm in dense toolbars.

Height tiers
Show code
<app-date-range-picker label="Small" size="ControlSize.Sm"></app-date-range-picker>
<app-date-range-picker label="Medium"></app-date-range-picker>
<app-date-range-picker label="Large" size="ControlSize.Lg"></app-date-range-picker>

Every option

Every value of every prop, one cell each.

start and end

start="2026-07-10" end="2026-07-14"
(empty)

onChange

onChange: React only, the form posts start-name and end-name instead

startName and endName

start-name="stayStart" end-name="stayEnd"

min and max

min="2026-07-01" (no max)
max="2026-07-31" (no min)
min + max: both bounds

placeholder

(default) "Start to End"
placeholder="Pick a range"

disabled, readOnly and loading

(default) disabled="false"
disabled="true"
(default) read-only="false"
read-only="true"
(default) loading="false"
loading="true"

defaultStart and defaultEnd

defaultStart and defaultEnd: React only, Razor seeds with start and end

help and helpLabel

help="Check-in and check-out dates"
help-label="About these dates"

size

size="sm"
(default) size="md"
size="lg"

firstDay: every weekday

first-day="0"
(default) first-day="1"
first-day="2"
first-day="3"
first-day="4"
first-day="5"
first-day="6"

presets

(default) no presets
presets="today,last7Days,thisMonth,lastMonth,thisFinancialYear"
presets='[{ "label": "Festival week", "start": "2026-11-05", "end": "2026-11-12" }]'

id and ariaLabel

id="stayRangeDemo"
aria-label="Trip dates" (no visible label)

label

label="Stay dates"

required and optional

(default) required="false"
required="true"
(default) optional="false"
optional="true"

optionalLabel

(default) optional-label="(optional)"
optional-label="Not needed"

helperText

helper-text="Check-in to check-out"
Check-in to check-out

error

(default) no error
error="Pick a range"
Pick a range

className

input-class="fw-semibold" (React className)

fieldClassName

class="mb-3" (React fieldClassName)

timeZone

(default) time-zone unset, Asia/Kolkata
time-zone="America/New_York"

financialYearStart

(default) financial-year-start="4"
financial-year-start="1"

Guidance

What to do, and what to avoid.

Use it when

  • Capturing a start-and-end date range: a stay, a booking window, a report period.
  • You want one control for the whole range rather than two separate date fields.
  • Restricting the range to a valid window with min / max.

Reach for something else when

  • You only need a single date. → AppDatePicker
  • You need a date and a time of day. → a date-time control
  • The two dates are unrelated fields. → two AppDatePicker fields

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

0 1 2 3 4 5 6
sm md lg
none today,last7Days,thisMonth,lastMonth,thisFinancialYear today,thisMonth
React, generated from the controls
<AppDateRangePicker label="Stay dates" start="2026-07-05" end="2026-07-12" startName="pgStart" endName="pgEnd" onChange={setRange} />
Razor, the same props
<app-date-range-picker label="Stay dates" start="2026-07-05" end="2026-07-12" start-name="pgStart" end-name="pgEnd" />

26 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
labeldefault - string - The field label, shown above the control and used as its accessible name.
start-namedefault - string - Form field name the start date posts under.
end-namedefault - string - Form field name the end date posts under.
startdefault - string - Range start as an ISO date string (YYYY-MM-DD).
enddefault - string - Range end as an ISO date string (YYYY-MM-DD).

Less common 21 props

PropTypeDefaultDescription
mindefault - string - The earliest selectable date, as an ISO date string.
maxdefault - string - The latest selectable date, as an ISO date string.
time-zonedefault - string - IANA time zone the quick ranges are resolved in, for example Asia/Kolkata or America/New_York. Unset, it is India Standard Time (Asia/Kolkata).
placeholderdefault Start to End string Start to End Text shown in the field while no range is chosen.
requireddefault false bool false Marks the field required, with the required mark on the label.
optionaldefault false bool false Ends the label with (optional) when the field is not required. Required wins when both are set.
optional-labeldefault (optional) string (optional) Replaces the built-in English text, for other languages.
helper-textdefault - string - Helper text shown under the control.
errordefault - string - An error message shown under the control.
disableddefault - bool - Disables the control.
read-onlydefault false bool false Shows the value but blocks editing. The value still posts.
loadingdefault false bool false Shows a busy state and blocks input while data loads.
helpdefault - string - Info-tip content shown beside the label.
help-labeldefault More information string More information The accessible name of the info-tip button.
sizedefault md sm | md | lg md Control height tier, matching AppInput.
first-daydefault theme (1) 0 | 1 | 2 | 3 | 4 | 5 | 6 theme (1) First weekday of the calendar, 0 Sunday to 6 Saturday. Unset, it follows the theme's --wui-first-day token, which is 1 (Monday) unless the product sets it.
presetsdefault - string - Quick ranges beside the calendar (above it on a phone): a comma list of today, last7Days, thisMonth, lastMonth, thisFinancialYear (resolved against today in IST), or a JSON array of names and { "label", "start", "end" } objects with ISO dates. One outside min/max is disabled.
financial-year-startdefault - int? - The month number, 1 to 12, the financial year starts in; it sets the thisFinancialYear quick range. Unset, it is 4 (April).
aria-labeldefault - string - Accessible name when there is no visible label.
iddefault - string - The id of the control; a unique one is made when left out.
input-classdefault - string - Extra classes on the control itself. The plain class attribute merges onto the field wrapper instead.

Screen reader

3 notes
  • The field label names the control through aria-label when it is a string, and ariaLabel overrides it.
  • Helper text or error text is linked to the control with aria-describedby, and an error sets aria-invalid.
  • Required and disabled are set as native attributes on the control.