Snackbar (Bootstrap 4, 5)

From NSB App Studio
Revision as of 23:03, 16 October 2018 by Ghenne (talk | contribs) (Created page with "NSB.Snackbar(message, actionText, action) File:Snackbar.png Snackbars contain a single line of text directly related to the operation performed. The message stays on the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

NSB.Snackbar(message, actionText, action)

Snackbars contain a single line of text directly related to the operation performed. The message stays on the screen for a few seconds, then fades away. Snackbars may contain a text action, but no icons. They originated in Google's Material Design.

The implementation is based on a sample by Mat Scales.

It is only available for Bootstrap 4.

message is the primary message of the Snackbar. It can be of any length: the Snackbar will expand to show multiple lines of text.

actionText is optional. It appears in a contrasting and invites the user to take action. It could be more information, or actions like "Save", "Cancel" or "Ignore".

action is required if you have an actionText argument. It's the name of a function to call.