Skip to content

NoticeBubble

NoticeBubbleManager

js
import { noticeBubbleDefaultManager } from '@semcore/ui/notice-bubble';

Manager is a storage of all notice instances, it is able to add, delete and update notices by calling the appropriate methods.

NoticeBubbleManagerClass

NameTypeDescription
add(props: | ) => Creates and shows a notice.
update(uid: number, props: Partial<> | Partial<>) => booleanDeprecated Updates notice by uid.
remove(uid: number) => boolean Removes notice by uid.
replace(uid: number, props: | ) => void Replace notice by uid.
replaceLast(props: | ) => void Replace last notice (if it is existing)

NoticeBubbleContainer

js
import { NoticeBubbleContainer } from '@semcore/ui/notice-bubble';

Container is a div created in the body using React.Portal. It is inserted once in any part of the application and subscribes to Manager updates (NoticeBubbleManager). Later, notices will be rendered to it.

NoticeBubbleContainerProps

& & {...}
NameTypeDescription
containerNode Ref or element to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer()
manager Manager copy
localestring Specifies the locale for i18n support

Released under the MIT License.

Released under the MIT License.