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
_For details on how to build Custom Views, see [Building Custom Views](#building-custom-views)._
44
+
Your Custom Root Views can optionally use one of the templates that Payload provides. The most common of these is the Default Template which provides the basic layout and navigation. Here is an example of what that might look like:
|**`locale`**| The current [Locale](../configuration/localization) of the [Admin Panel](./overview). |
317
-
|**`navGroups`**| The grouped navigation items according to `admin.group` in your [Collection Config](../collections/overview) or [Global Config](../globals/overview). |
318
-
|**`params`**| An object containing the [Dynamic Route Parameters](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes). |
319
-
|**`permissions`**| The permissions of the currently logged in user. |
320
-
|**`searchParams`**| An object containing the [Search Parameters](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL#parameters). |
321
-
|**`visibleEntities`**| The current user's visible entities according to your [Access Control](../access-control/overview). |
351
+
|**`initPageResult`**| An object containing `req`, `payload`, `permissions`, etc. |
352
+
|**`clientConfig`**| The Client Config object. [More details](../components#accessing-the-payload-config). |
353
+
|**`importMap`**| The import map object. |
354
+
|**`params`**| An object containing the [Dynamic Route Parameters](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes). |
355
+
|**`searchParams`**| An object containing the [Search Parameters](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL#parameters). |
Copy file name to clipboardExpand all lines: docs/examples/overview.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Payload provides a vast array of examples to help you get started with your proj
11
11
Examples are changing every day, so be sure to check back often to see what new examples have been added. If you have a specific example you would like to see, please feel free to start a new [Discussion](https://github.com/payloadcms/payload/discussions) or open a new [PR](https://github.com/payloadcms/payload/pulls) to add it yourself.
This example demonstrates how to use Custom Components in [Payload](https://github.com/payloadcms/payload) Admin Panel. This example includes custom components for every field type available in Payload, including both server and client components. It also includes custom views, custom nav links, and more.
4
+
5
+
## Quick Start
6
+
7
+
To spin up this example locally, follow these steps:
8
+
9
+
1. Clone this repo
10
+
1.`cd` into this directory and run `pnpm i --ignore-workspace`\*, `yarn`, or `npm install`
11
+
12
+
> \*If you are running using pnpm within the Payload Monorepo, the `--ignore-workspace` flag is needed so that pnpm generates a lockfile in this example's directory despite the fact that one exists in root.
13
+
14
+
1.`pnpm dev`, `yarn dev` or `npm run dev` to start the server
15
+
- Press `y` when prompted to seed the database
16
+
1.`open http://localhost:3000` to access the home page
17
+
1.`open http://localhost:3000/admin` to access the admin panel
18
+
- Login with email `demo@payloadcms.com` and password `demo`
19
+
20
+
## How it works
21
+
22
+
### Collections
23
+
24
+
See the [Collections](https://payloadcms.com/docs/configuration/collections) docs for details on how to extend any of this functionality.
25
+
26
+
-#### Users
27
+
28
+
The `users` collection is auth-enabled which provides access to the admin panel.
29
+
30
+
For additional help with authentication, see the official [Auth Example](https://github.com/payloadcms/payload/tree/main/examples/auth/cms#readme) or the [Authentication](https://payloadcms.com/docs/authentication/overview#authentication-overview) docs.
31
+
32
+
-#### Fields
33
+
34
+
The `fields` collection contains every field type available in Payload, each with custom components filled in every available "slot", i.e. `admin.components.Field`, `admin.components.Label`, etc. There are two of every field, one for server components, and the other for client components. This pattern shows how to use custom components in both environments, no matter which field type you are using.
35
+
36
+
-#### Views
37
+
38
+
The `views` collection demonstrates how to add collection-level views, including the default view and custom tabs.
39
+
40
+
-#### Root Views
41
+
42
+
The `root-views` collection demonstrates how to add a root document-level view to the admin panel.
43
+
44
+
## Questions
45
+
46
+
If you have any issues or questions, reach out to us on [Discord](https://discord.com/invite/payload) or start a [GitHub discussion](https://github.com/payloadcms/payload/discussions).
0 commit comments