Custom Footer

Build a completely custom footer with your own buttons and layout, or remove parts entirely for a minimal picker.

Rearrange footer buttons or add new ones like TodayButton. The DateTimePicker compound component includes a TimeSection with TimePanel for time selection, and the Footer acts as a container for action buttons.

import { useState } from "react";
import { DateTimePicker } from "react-date-range-picker-styled";
import "react-date-range-picker-styled/rdrp-styles.css";
function CompoundCustomFooter() {
const [value, setValue] = useState<Date | null>(null);
return (
<DateTimePicker.Root value={value} onChange={setValue}>
<DateTimePicker.Trigger />
<DateTimePicker.Content>
<DateTimePicker.Header>
<DateTimePicker.PrevButton />
<DateTimePicker.Title />
<DateTimePicker.NextButton />
</DateTimePicker.Header>
<DateTimePicker.Grid />
<DateTimePicker.TimeSection>
<DateTimePicker.TimePanel target="single" />
</DateTimePicker.TimeSection>
<DateTimePicker.Footer>
<DateTimePicker.TodayButton />
<div style={{ flex: 1 }} />
<DateTimePicker.CancelButton />
<DateTimePicker.ConfirmButton />
</DateTimePicker.Footer>
</DateTimePicker.Content>
</DateTimePicker.Root>
);
}

You can also skip the built-in action buttons entirely and use your own elements inside Footer:

<DatePicker.Footer>
<button onClick={() => setValue(new Date())}>Set Today</button>
<button onClick={() => setValue(null)}>Clear</button>
</DatePicker.Footer>

Minimal Layout

Omit any parts you don’t need. For example, a header-less inline calendar with no footer or trigger:

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-styled";
import "react-date-range-picker-styled/rdrp-styles.css";
function CompoundNoFooter() {
const [value, setValue] = useState<Date | null>(null);
return (
<DatePicker.Root value={value} onChange={setValue}>
<DatePicker.Trigger />
<DatePicker.Content>
<DatePicker.Header>
<DatePicker.PrevButton />
<DatePicker.Title />
<DatePicker.NextButton />
</DatePicker.Header>
<DatePicker.Grid />
</DatePicker.Content>
</DatePicker.Root>
);
}

Or a picker without the footer:

<DatePicker.Root value={value} onChange={setValue}>
<DatePicker.Trigger />
<DatePicker.Content>
<DatePicker.Header>
<DatePicker.PrevButton />
<DatePicker.Title />
<DatePicker.NextButton />
</DatePicker.Header>
<DatePicker.Grid />
</DatePicker.Content>
</DatePicker.Root>

Adding Custom Class Names

Every compound part accepts a className prop that merges with the default styled CSS classes:

<DatePicker.Root value={value} onChange={setValue} className="my-picker">
<DatePicker.Trigger className="my-trigger" />
<DatePicker.Content className="my-content">
<DatePicker.Header className="my-header">
<DatePicker.PrevButton className="my-nav" />
<DatePicker.Title className="my-title" />
<DatePicker.NextButton className="my-nav" />
</DatePicker.Header>
<DatePicker.Grid className="my-grid" />
</DatePicker.Content>
</DatePicker.Root>