docs: add documentation for Payload UI components #11469
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After using the Payload UI components quite a bit in plugins and custom components, I, as well as other found it would be great to have a better documentation for the UI library
#9489
How?
Right now, the files I've added are very limited, but I wanted to open this PR as soon as possible, to give others the opportunity to also start contributing without doing the same work twice or more.
Probably the best workflow is to look at https://github.com/payloadcms/payload/tree/main/packages/ui and use the types as a guide for the docs.
I've added very basic docs for the
<Button />component based on these types: https://github.com/payloadcms/payload/blob/main/packages/ui/src/elements/Button/types.tsThe Overview Structure is still all over the place, and I'm not sure if it's correct and complete. I will probably go back to the
uipackage in this repo and create a better structure.