daterly

Sizes

DatePicker and DateRangePicker have a size prop with three presets: s, m, l. The default is m.

Pick a preset — on the right you'll instantly see how the height, font, and padding change.

Date
tsx
<DatePicker size="m" label="Date" />

DateRangePicker accepts the same prop:

<DateRangePicker size="s" label="Period" />

What changes

A size is a set of CSS tokens swapped in by the .daterly--s / .daterly--l modifier class (for m the base values stay in place):

Tokensm (default)l
--daterly-height32px40px56px
--daterly-font-size14px16px16px
--daterly-padding-h12px12px16px
--daterly-input-padding-top—20px24px
--daterly-label-top-filled—4px8px

In size s the floating label isn't used — it sits fixed above the field (fitting it inside 32px isn't possible without a visual compromise).

Customization

If you want a size "in between", override the tokens for the scope you need:

.compact .daterly {
  --daterly-height: 36px;
  --daterly-font-size: 15px;
  --daterly-padding-h: 10px;
}

This works on top of any size and doesn't require forking the modifier class.

Width

The component takes up 100% of the container width — control the width via a wrapper:

<div style={{ width: 240 }}>
  <DatePicker label="Date" />
</div>

The minimum width can be overridden via CSS tokens:

:root {
  --daterly-field-min-width: 180px;  /* DatePicker, default 220px */
  --daterly-range-min-width: 320px;  /* DateRangePicker, default 280px */
}

Calendar popover

The size also affects the popover class — .daterly__popover--s, .daterly__popover--m, .daterly__popover--l. By default these popovers look identical; the modifier exists in case you want to adjust the padding or day size to match the input height:

.daterly__popover--s {
  --rdp-day-width: 32px;
  --rdp-day-height: 32px;
}

On this page