You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**`avatar`**| Set account profile picture. Options: `gravatar`, `default` or a custom React component. |
99
-
|**`autoLogin`**| Used to automate log-in for dev and demonstration convenience. [More details](../authentication/overview). |
100
-
|**`components`**| Component overrides that affect the entirety of the Admin Panel. [More details](../custom-components/overview). |
101
-
|**`custom`**| Any custom properties you wish to pass to the Admin Panel. |
102
-
|**`dateFormat`**| The date format that will be used for all dates within the Admin Panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used. |
103
-
|**`livePreview`**| Enable real-time editing for instant visual feedback of your front-end application. [More details](../live-preview/overview). |
104
-
|**`meta`**| Base metadata to use for the Admin Panel. [More details](./metadata). |
105
-
|**`routes`**| Replace built-in Admin Panel routes with your own custom routes. [More details](#customizing-routes). |
106
-
|**`suppressHydrationWarning`**| If set to `true`, suppresses React hydration mismatch warnings during the hydration of the root `<html>` tag. Defaults to `false`. |
107
-
|**`theme`**| Restrict the Admin Panel theme to use only one of your choice. Default is `all`. |
108
-
|**`timezones`**| Configure the timezone settings for the admin panel. [More details](#timezones)|
109
-
|**`user`**| The `slug` of the Collection that you want to allow to login to the Admin Panel. [More details](#the-admin-user-collection). |
|`avatar`| Set account profile picture. Options: `gravatar`, `default` or a custom React component. |
100
+
|`autoLogin`| Used to automate log-in for dev and demonstration convenience. [More details](../authentication/overview). |
101
+
|`components`| Component overrides that affect the entirety of the Admin Panel. [More details](../custom-components/overview). |
102
+
|`custom`| Any custom properties you wish to pass to the Admin Panel. |
103
+
|`dateFormat`| The date format that will be used for all dates within the Admin Panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used. |
104
+
|`livePreview`| Enable real-time editing for instant visual feedback of your front-end application. [More details](../live-preview/overview). |
105
+
|`meta`| Base metadata to use for the Admin Panel. [More details](./metadata). |
106
+
|`routes`| Replace built-in Admin Panel routes with your own custom routes. [More details](#customizing-routes). |
107
+
|`suppressHydrationWarning`| If set to `true`, suppresses React hydration mismatch warnings during the hydration of the root `<html>` tag. Defaults to `false`. |
108
+
|`theme`| Restrict the Admin Panel theme to use only one of your choice. Default is `all`. |
109
+
|`timezones`| Configure the timezone settings for the admin panel. [More details](#timezones)|
110
+
|`user`| The `slug` of the Collection that you want to allow to login to the Admin Panel. [More details](#the-admin-user-collection). |
110
111
111
112
<Bannertype="success">
112
113
**Reminder:** These are the _root-level_ options for the Admin Panel. You can
@@ -186,6 +187,12 @@ The following options are available:
186
187
|`graphQL`|`/graphql`| The [GraphQL API](../graphql/overview) base path. |
187
188
|`graphQLPlayground`|`/graphql-playground`| The GraphQL Playground. |
188
189
190
+
<Bannertype="warning">
191
+
**Important:** Changing Root-level Routes also requires a change to [Project
192
+
Structure](#project-structure) to match the new route. [More
193
+
details](#customizing-root-level-routes).
194
+
</Banner>
195
+
189
196
<Bannertype="success">
190
197
**Tip:** You can easily add _new_ routes to the Admin Panel through [Custom
191
198
Endpoints](../rest-api/overview#custom-endpoints) and [Custom
@@ -196,13 +203,29 @@ The following options are available:
196
203
197
204
You can change the Root-level Routes as needed, such as to mount the Admin Panel at the root of your application.
198
205
199
-
Changing Root-level Routes also requires a change to [Project Structure](#project-structure) to match the new route. For example, if you set `routes.admin` to `/`, you would need to completely remove the `admin` directory from the project structure:
206
+
This change, however, also requires a change to your [Project Structure](#project-structure) to match the new route.
207
+
208
+
For example, if you set `routes.admin` to `/`:
209
+
210
+
```ts
211
+
import { buildConfig } from'payload'
212
+
213
+
const config =buildConfig({
214
+
// ...
215
+
routes: {
216
+
admin: '/', // highlight-line
217
+
},
218
+
})
219
+
```
220
+
221
+
Then you would need to completely remove the `admin` directory from the project structure:
|`Component`\*| Pass in the component path that should be rendered when a user navigates to this route. |
54
-
|`path`\*| Any valid URL path or array of paths that [`path-to-regexp`](https://www.npmjs.com/package/path-to-regex) understands. |
54
+
|`path`\*| Any valid URL path or array of paths that [`path-to-regexp`](https://www.npmjs.com/package/path-to-regex) understands. Must begin with a forward slash (`/`).|
55
55
|`exact`| Boolean. When true, will only match if the path matches the `usePathname()` exactly. |
56
56
|`strict`| When true, a path that has a trailing slash will only match a `location.pathname` with a trailing slash. This has no effect when there are additional URL segments in the pathname. |
57
57
|`sensitive`| When true, will match if the path is case sensitive. |
Copy file name to clipboardExpand all lines: packages/payload/src/admin/views/index.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,10 @@ export type AdminViewConfig = {
23
23
/** Whether the path should be matched exactly or as a prefix */
24
24
exact?: boolean
25
25
meta?: MetaConfig
26
-
path?: string
26
+
/**
27
+
* Any valid URL path or array of paths that [`path-to-regexp`](https://www.npmjs.com/package/path-to-regex) understands. Must begin with a forward slash (`/`).
0 commit comments