Skip to content

Advanced References

If you got here it’s because you want to further customize BellJs or at least know how it works, well this is the complete guide to all the fields in the library I hope you find them useful.

Instance parameters

Let’s first look at the parameters needed to create an alert using BellJs.

First parameter (texts)

The first parameter is an Object that places the texts in the alert and has the following properties:

Property nameDescriptionValue
titlePrimary text or alert titleString
descriptionSecondary text or description of the alertString

Second parameter (types)

The second parameter is a String that defines the type of alert:

The second parameter is a String that indicates the type of alert, it is governed by these possible values:

TypeDescription
infoShows an information style in the alert
warningShows a danger style in the alert
errorShows an error style in the alert
successShows that something went well in the alert
promiseShows a loading style in the alert
noneDoes not show styles but also no icons

Third parameter (customization)

The third parameter is an Object that serves as a configuration parameter:

Property nameDescriptionValue
animateDefines whether the alert will have animations, by default trueBoolean
isColoredDefines whether the alert will have coloring, by default trueBoolean
transitionDurationDefines the time of the transitionsNumber
positionDefines the position, by default bottom-rightbottom-left - bottom-left - bottom-right - top-left - top-left - top-right
typeAnimationAlert animation typefade-in - fade-in-out - bound - bound-2
screenTimeAlert screen timeNumber
expandDefault expand effect `falseBoolean
themeDefault alert theme defaultcolors- light - String
customClassSets a CSS class to the alertString
customStylesSets styles to the alertObject
customStyles.container *Sets styles to the alert container (any css property)Object
customStyles.title *Sets styles to the alert title (any css property)Object
customStyles.description *Set styles to the alert description (any css property)Object
customStyles.icon *Set styles to the alert icon (any css property)Object
customIconChange the alert iconSvg
customHTMLChange the alert htmlHTML
distanceDistance of the alerts relative to the default screen to the default screen 30Object
distance.xDistance on the x axis depending on the chosen position if right or leftNumber
distance.yDistance on the y axis depending on the chosen position if top or bottomNumber
gapDefault gap between alerts 15Number
timelineSets a timeline for the alertBoolean
removeOnDefines how to remove the alertbutton - click

Bell Methods

Different instance methods:

Method NameDescriptionParameters
new Bell()Instances a Bell(Object,String,Object)
launch()Launches the alert and displays it on the screennone
dismiss()Removes the alertnone
promise()Uses a promise(Promise,State)