-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
CLI: Add HTML components and stories #12286
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
Conversation
Looks good @tooppaaa ! My only concern is that all of the examples use JS functions with DOM methods and there are no plain "return a string of HTML" examples, which I think is a common case. Do you think this is an issue for first time users? To me it makes |
Opinion shared. What do you think of adding a comment ? |
}, | ||
}; | ||
|
||
const Template = (args) => createButton(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const Template = ({label, ...args}) => {
// You can either use a function to create DOM elements or use a plain html string!
// return `<div>${label}</div>`;
return createButton({label, ...args});
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One more time, good job @tooppaaa! 👏
For the HTML string concern, I have no idea if @storybook/html
is widely used, if not a comment may be enough.
Issue: #12173
What I did
Create html components and stories.
Not sure this is the perfect way to go but that does the job
How to test