Reputation: 57
I am using ReactJS + MaterialUI components. I want to highlight to the user and show '!' mark when there is an error in a tab. I am looking to put an error mark on the tab name so that the user can click to see more.
Is there any way to show this?
Upvotes: 0
Views: 97
Reputation: 405
https://codesandbox.io/embed/material-demo-ioxsf?fontsize=14&hidenavigation=1&theme=dark
Add import ErrorIcon from "@material-ui/icons/Error"
to import error icon.
{showOrNotToShow && (
<div
style={{ marginTop: "15px", cursor: "pointer" }}
onClick={() => {
alert("something");
}}
>
<ErrorIcon />
</div>
)}
Conditional render if error then show error icon.
Upvotes: 1