import { Card } from '@automattic/components'; import { Fragment, Component } from 'react'; import DateRange from '../index.js'; /* * Date Range Demo */ class DateRangeExample extends Component { withCustomTrigger() { // Note: you must ensure you pass the `ref` prop down to the element const customTrigger = ( props ) => { return ( ); }; return ; } withCustomInputs() { // Note: you must ensure you pass the `ref` prop down to the element const customInputs = ( props ) => { return (

You selected { props.startDateValue } - { props.endDateValue }

); }; return ; } render() { const now = new Date(); return (

Defaults

Compact

Select only past dates

Select only future dates

Custom Trigger Component

{ this.withCustomTrigger() }

Custom Inputs Component

{ this.withCustomInputs() }

With Shortcuts Menu Displayed

With Arrow Navigation Enabled

With Overlay Enabled

🔒 Please upgrade to use the date range picker. } />

With Custom Title

); } } DateRangeExample.displayName = 'DateRange'; export default DateRangeExample;