-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make PropsTable capable of accepting manual prop entries #360
Comments
This is more just a proof of concept. I didn't actually pull this down and it's clearly not been formatted with prettier.
@BoostIO funded this issue with $10. Visit this issue on Issuehunt |
@Ashikpaul has started working. Visit this issue on Issuehunt |
@Ashikpaul has stopped working. Visit this issue on Issuehunt |
@wsmd has started working. Visit this issue on Issuehunt |
I love the idea, @kentcdodds! I'm currently working on a project that doesn't use I started working on this idea, and made some very good progress! Here are the results of what I have so far... Given this markup: <PropsTable
props={[
{
property: "variant",
type: {
name: "enum",
value: [
{ value: "primary" },
{ value: "secondary" },
{ value: "outline" }
]
},
required: false,
defaultValue: {
value: "primary"
},
description: 'Can also specify "secondary"'
},
{
property: "disabled",
type: {
name: "boolean"
},
required: false,
defaultValue: {
value: "false"
}
}
]}
/> The following is rendered: It's worth mentioning that Docz has some expectations around the component's docgen info, so I started experimenting with some schema validation mechanism that I think would go hand in hand with this feature. This will:
For example, when defining a prop of type <PropsTable
props={[{
property: "variant",
type: {
name: "enum",
value: ['primary', 'secondary']
},
// ... In case it was entered, an error like this will be thrown : Another example: There's still a lot of work to be done here, but I thought I'd share my proof of concept as well! 😅 |
Here is the solution (called Practically speaking, it implements an interface that |
@dfee I'm happy to put together a PR with your solution or help you to get one up so we can get this merged in. I'm assuming this is something @pedronauck is keen to have built in the default theme. |
@rororofff has funded $2.00 to this issue.
|
I just published react-docgen-props-table which ports a previous version of the Docz |
React Docgen is... imperfect.
But the PropsTable looks great. I'd love to manually maintain a props listing for the docs using PropsTable like this:
Thoughts?
The text was updated successfully, but these errors were encountered: