-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87542d7
commit 0470967
Showing
2 changed files
with
108 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,112 @@ | ||
--- | ||
productId: x-date-pickers | ||
title: DX - Pickers | ||
title: DX - Picker | ||
--- | ||
|
||
# Fields | ||
# Picker | ||
|
||
<p class="description">This page describes how people can use picker with Material UI and how they can build custom pickers.</p> | ||
|
||
:::success | ||
This page extends the initial proposal made in [#14718](https://github.com/mui/mui-x/issues/14718) | ||
::: | ||
|
||
## With Material UI | ||
## Basic usage | ||
|
||
### Basic usage | ||
### With Material UI | ||
|
||
TODO | ||
|
||
### Override part of the UI | ||
### Without Material UI | ||
|
||
TODO | ||
```tsx | ||
function CustomDatePicker(props) { | ||
const manager = useDateManager(); | ||
|
||
## Without Material UI | ||
return ( | ||
<Popover.Root> | ||
<Picker.Root manager={manager} {...props}> | ||
<PickerField.Root> | ||
<PickerField.Root> | ||
{/** See field documentation */} | ||
<Popover.Trigger>📅</Popover.Trigger> | ||
</PickerField.Root> | ||
</PickerField.Root> | ||
<Popover.Backdrop /> | ||
<Popover.Positioner> | ||
<Popover.Popup> | ||
<Picker.Views></Picker.Views> | ||
</Popover.Popup> | ||
</Popover.Positioner> | ||
</Picker.Root> | ||
</Popover.Root> | ||
); | ||
} | ||
``` | ||
|
||
### Basic usage | ||
## Add an action bar | ||
|
||
TODO | ||
### Without Material UI | ||
|
||
```tsx | ||
<Picker.Layout> | ||
<Picker.Views>{/** See demo above */}</Picker.Views> | ||
<div> | ||
<Picker.Clear>Clear</Picker.Clear> | ||
<Popover.Close>Close</Popover.Close> | ||
</div> | ||
</Picker.Layout> | ||
``` | ||
|
||
## Add a toolbar | ||
|
||
### Without Material UI | ||
|
||
```tsx | ||
<Picker.Layout> | ||
<Picker.Toolbar.Root> | ||
<Picker.Toolbar.Label /> | ||
</Picker.Toolbar.Root> | ||
<Picker.Views>{/** See demo above */}</Picker.Views> | ||
</Picker.Layout> | ||
``` | ||
|
||
```tsx | ||
<Picker.Layout> | ||
<Picker.Toolbar.Root> | ||
<Picker.SetView target="year"> | ||
<Picker.Toolbar.Label format="YYYY" /> | ||
</Picker.SetView> | ||
<Picker.SetView target="day"> | ||
<Picker.Toolbar.Label format="DD MMMM" /> | ||
</Picker.SetView> | ||
</Picker.Toolbar.Root> | ||
<Picker.Views>{/** See demo above */}</Picker.Views> | ||
</Picker.Layout> | ||
``` | ||
|
||
## Add tabs | ||
|
||
### Without Material UI | ||
|
||
## Anatomy of `Picker.*` | ||
|
||
### `Picker.Root` | ||
|
||
### `Picker.Clear` | ||
|
||
### `Picker.SetValue` | ||
|
||
### `Picker.SetView` | ||
|
||
### `Picker.Layout` | ||
|
||
### `Picker.Toolbar.Root` | ||
|
||
### `Picker.Toolbar.Label` | ||
|
||
### `Picker.Toolbar.Label` | ||
|
||
### `Picker.Shortcuts.Root` | ||
|
||
### `Picker.Shortcut.Item` |