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
[Alert][joy] Add Alert
component
#33859
Conversation
@mui/joy: parsed: +1.13% , gzip: +0.61% |
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.
Looking great, Benny! Thanks for kick-starting this out!
Refined the component a bit and added a couple of other sections there to the docs. Looking forward to knowing what you two think about it!
Lastly, a quick question: will we support something similar to the AlertTitle
component?
It looks much much nicer! I see that you've changed the default variant to
I will let @siriwatknp answer this. |
@hbjORbj Thanks for the hard work Here are things I think can be improved: HTML structureLet's keep the rendered HTML simple. I am not sure why Material UI produces many div but I think this is simpler: <Alert>...</Alert>
// The result should be just 1 div
<div role="alert" class="JoyAlert-root">...</div>
// not this
<div role="alert" class="JoyAlert-root">
<div class="JoyAlert-message">...</div>
</div> SizeIt should have DecoratorThe alert should accept You can remove the The usage should be like this: <Alert startDecorator={<Icon />} endDecorator={<IconButton><Close /></IconButton>}>
<Typography fontWeight="lg" mb={1}>Alert title</Typography>
<Typography level="body2">Description</Typography>
</Alert> CSS variablesIt should have:
You can take a look at the AlertTitleI don't see a need for the Common examplesCan you add some of these to the common examples section: |
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.
Looks great, Benny! Nice work 👌
@hbjORbj The implementation looks good to me. What's left are:
|
Done:
|
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.
👍 Awesome @hbjORbj
Done:
color
,variant
,onClose
,closeText
, etc; To be more discussed with Jun and DaniloUPDATE:
Preview: https://deploy-preview-33859--material-ui.netlify.app/joy-ui/react-alert/