Skip to content

Commit 3e581dc

Browse files
guilbillAijeyomah
authored andcommitted
doc: reorder props
1 parent f12cf20 commit 3e581dc

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

docs/EditInDialogButton.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ const CompanyShow = () => (
7171

7272
| Prop | Required | Type | Default | Description |
7373
| ------------------ | -------- | ----------------- | ------- | --------------------------------------------------------------------------------------- |
74-
| `children` | Required | `ReactNode` | | The content of the dialog |
7574
| `ButtonProps` | Optional | `object` | | Object containing props to pass to Material UI's `<Button>` |
75+
| `children` | Required | `ReactNode` | | The content of the dialog |
76+
| `emptyWhileLoading`| Optional | `boolean` | `false` | Set to `true` to return `null` while the list is loading |
7677
| `fullWidth` | Optional | `boolean` | `false` | If `true`, the dialog stretches to the full width of the screen |
7778
| `icon` | Optional | `ReactElement` | | Allows to override the default icon |
7879
| `id` | Optional | `string | number` | | The record id. If not provided, it will be deduced from the record context |
@@ -84,7 +85,25 @@ const CompanyShow = () => (
8485
| `resource` | Optional | `string` | | The resource name, e.g. `posts` |
8586
| `sx` | Optional | `object` | | Override the styles applied to the dialog component |
8687
| `title` | Optional | `ReactNode` | | The title of the dialog |
87-
| `emptyWhileLoading`| Optional | `boolean` | `false` | Set to `true` to return `null` while the list is loading |
88+
89+
90+
## `ButtonProps`
91+
92+
The `ButtonProps` prop allows you to pass props to the MUI `<Button>` component. For instance, to change the color and size of the button:
93+
94+
{% raw %}
95+
96+
```jsx
97+
const EditButton = () => (
98+
<EditInDialogButton ButtonProps={{ color: 'primary', fullWidth: true }}>
99+
<SimpleForm>
100+
...
101+
</SimpleForm>
102+
</EditInDialogButton>
103+
);
104+
```
105+
106+
{% endraw %}
88107

89108
## `children`
90109

@@ -134,24 +153,6 @@ const EditButton = () => (
134153
);
135154
```
136155

137-
## `ButtonProps`
138-
139-
The `ButtonProps` prop allows you to pass props to the MUI `<Button>` component. For instance, to change the color and size of the button:
140-
141-
{% raw %}
142-
143-
```jsx
144-
const EditButton = () => (
145-
<EditInDialogButton ButtonProps={{ color: 'primary', fullWidth: true }}>
146-
<SimpleForm>
147-
...
148-
</SimpleForm>
149-
</EditInDialogButton>
150-
);
151-
```
152-
153-
{% endraw %}
154-
155156
## `fullWidth`
156157

157158
By default, `<EditInDialogButton>` renders a [Material UI `<Dialog>`](https://mui.com/material-ui/react-dialog/#full-screen-dialogs) component that takes the width of its content.

0 commit comments

Comments
 (0)