Generate an alert on custom panel

Hi I’m developing a reactjs panel and I would like to add alerting to it. Is there a way to generate an alert?

Thanks!