DatePicker
An interface for selecting a date from a calendar.
Dark | Light |
---|---|
This is a controlled component, which means you should pass in an initial date to the Date
prop and a callback value to the OnChanged
prop which gets called with the new date when
the user selects one. For example:
local function MyComponent()
local date, setDate = React.useState(DateTime.now())
return React.createElement(StudioComponents.DatePicker, {
Date = date,
OnChanged = setDate,
})
end
In most cases the desired behavior would be to close the interface once a selection is made,
in which case you can use the OnChanged
prop as a trigger for this.
The default size of this component is exposed in Constants.DefaultDatePickerSize. To keep all inputs accessible, it is recommended not to use a smaller size than this.
This component is not a modal or dialog box (this should be implemented separately).