Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide way to document complex props, types, or add examples for React components #659

Open
joshblack opened this issue Nov 8, 2023 · 4 comments

Comments

@joshblack
Copy link
Member

For DataTable, there are certain props where it would be great to provide additional documentation for them as the type itself may be too complicated to show inline. For example, columns is currently only represented as Array<Column<Data>> and it would be helpful to document the interior type, Column, along with its descriptions of fields. For an overview of this type, visit the code here.

One alternative could be to allow for extension of the specific prop sections in order to further document a component and it's props. This shows up in sites like:

Or it could show up as a popup similar to sites like:

Finally, additional information could live in the description for the prop (however this would mean descriptions would be longer as in: https://mui.com/material-ui/api/pagination/)

@lesliecdubs
Copy link
Member

lesliecdubs commented Nov 10, 2023

👋 @joshblack am I correct in assuming this is a feature request for https://primer.style? If so, does it seem reasonable to assume the first step would be seeking design input on how to represent complex props/types there?

Trying to figure out the best place to triage this to 🤔

@joshblack
Copy link
Member Author

@lesliecdubs definitely! Seems reasonable to me 👍

@tallys
Copy link
Contributor

tallys commented Nov 16, 2023

@mperrotti could you take a look at this and connect with @joshblack or would you like to bring this to Primer Patterns?

@mperrotti
Copy link
Contributor

mperrotti commented Nov 21, 2023

@tallys - I'm already in touch with @joshblack about this. I don't think it needs a Primer patterns session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants