
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@spark-web/alert
Advanced tools
--- title: Alert storybookPath: feedback-overlays-alert--info isExperimentalPackage: true ---
Alert displays a short and concise message to draw a users' attention without interrupting their current task.
The component offers several levels of tonal severity.
<Stack gap="large">
<Alert tone="caution" heading="This is a caution alert">
Caution message
</Alert>
<Alert tone="positive" heading="This is a positive alert">
Positive message
</Alert>
<Alert tone="info" heading="This is an info alert">
Info message
</Alert>
<Alert tone="critical" heading="This is a critical alert">
Critical message
</Alert>
</Stack>
You can also set an onClose
prop callback function which will render a close
icon button on the alert. The callback function will be called upon the button
being pressed.
const [isOpen, setIsOpen] = React.useState(true);
React.useEffect(() => {
const timeout = setTimeout(() => {
if (!isOpen) {
setIsOpen(true);
}
}, 2000);
return () => clearTimeout(timeout);
}, [isOpen]);
if (!isOpen) {
return null;
}
return (
<Alert
tone="caution"
heading="This is a caution alert"
onClose={() => setIsOpen(false)}
>
Click the button on the right to dismiss this notification
</Alert>
);
In rare cases, you may need to provide a custom icon. To do so, we expose an
icon
prop. You can pass it any icon from the Icon package.
<Alert heading="This an info alert" icon={LightBulbIcon}>
Did you know that Alert components can have custom icons?
</Alert>
FAQs
--- title: Alert storybookPath: feedback-overlays-alert--info isExperimentalPackage: true ---
We found that @spark-web/alert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.