Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@contentful/f36-notification
Advanced tools
Notification
gives an immediate feedback about an action triggered or experienced by an user.
By default, Notification
will dismiss after 6 seconds, or after being clicked.
import { Notification } from '@contentful/f36-components';
// or
import { Notification } from '@contentful/f36-notification';
The Notification
component can be configured in a number of different ways. Here is a guide to when to use certain variations.
If you want to disabled auto-closing behavior, you can pass 0
as duration of the notification.
id
If you want to make sure that the same notification appears only once at any given time, you can specify a custom notification id.
You call append an additional call to action to all notificataion by using cta
property.
The common use case is undo
button.
All main intent functions (success
, error
, and warning
) have the following type declaration:
type NotificationAction = (
text: string,
settings?: {
// you can specify a custom notification duration
// tip: use 0 to make your notification sticky
duration?: number;
// whether notification has close button or not
withClose?: boolean;
// custom id, by default the unique id is generated automatically
// by specifying custom id, you can make sure
// that the specific notification is present only once at any given moment
id?: string;
// Additional header title of the notification
title?: string;
// Call to action properties
// For example, your notification can have `Undo` button
cta?: Partial<{
label: string;
textLinkProps: Partial<TextLinkProps>;
}>;
},
) => Notification;
By default, the notification closes after 6s, but when the user hovers (mouse overs) the notification it will stop the countdown timer and the toast will stay alive as long as the toast is being hovered.
// closing one notification
const notification = await Notification.success('hello');
Notification.close(notification.id);
// In some situations toasts might become outdated before they expire.
// In those situations you can use `Notification.closeAll()` to close all open toasts.
Notification.closeAll();
// change placement for all notifications
// (default is bottom and offset is 20)
Notification.setPlacement('top', { offset: 100 });
Notification.setPlacement('bottom', { offset: 0 });
// change duration of expiration change placement for all notifications
// (default is 6000ms)
Notification.setDuration(1000); // 1 second
Notification.setDuration(100000); // 100 seconds
Notification
with Note
, which persist in the UI and do not dismissFAQs
Forma 36: Notification component
We found that @contentful/f36-notification demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.