Skip to content

Notifications

SnackBar

Bit.BlazorUIToast

Snackbars provide brief notifications. The component is also known as a toast. One host, placed once in the layout and captured by reference, shows every notification of the page: each Show call stacks a new item in the chosen corner and hands back the handle to close, update, pause or resume it. Items carry their own color, icon, lifetime, actions and content; each is announced through a live region the host has kept in the page from its first render, with the politeness its color implies; the auto-dismiss countdown holds while the pointer or the keyboard focus is inside an item; and a cap on how many fit at once decides whether the extras wait their turn, replace the oldest, or are dropped.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

A snack bar host renders nothing until something is shown in it, so it is placed once - normally in the layout - and captured with @ref. Each of the Info, Success, Warning, SevereWarning and Error shortcuts shows a new item in the matching color and returns it, and the plain Show takes any color. The item stays until it is dismissed, since auto-dismiss is opt-in.

Position & Offset

The Position parameter pins the stack to one of the six corners and edges of the screen (default is BottomEnd). The start/end naming follows the text direction, so a snack bar keeps to the same side of the reading order in both LTR and RTL, and the enter animation always slides out of the edge the stack is pinned to. Offset takes any CSS length and moves the whole stack away from those edges, which is how a snack bar is kept clear of the chrome the app already has there - a bottom app bar, a cookie banner, the safe area of a phone.

Position

Offset

Auto dismiss

AutoDismiss starts a countdown for each item, AutoDismissTime sets how long it runs (default is 3 seconds), and a bar along the bottom edge draws it out - HideProgress takes that bar away and ReverseProgress makes it drain from full to empty rather than fill. Give anything the user has to read or act on at least five seconds. The countdown holds while the pointer or the keyboard focus is inside the item, which is what keeps a notification from being taken away from someone who is still reading it or reaching for its action, and is how the countdown meets WCAG 2.2.1 without a longer timeout; set PauseOnHover to false to opt out. PauseOnPageHidden holds it while the page sits in a background tab, so a notification is not spent before the tab is looked at again, and PauseOnWindowBlur does the same while the window is merely covered by another one - which the page visibility API says nothing about. Both need AddBitBlazorUIServices; without it they turn themselves off rather than fail.







A single item can also ask for a lifetime of its own, which is how a short confirmation and a long report can share one host:

Persistent

Persistent removes the dismiss button and keeps the item out of the countdown and out of the Escape key, so it stays until the code that opened it closes it through Close - which is what a snack bar reporting a job still in progress needs. The same is available per item through BitSnackBarItem.Persistent (or the persistent argument of the shortcuts), so one host can mix items that go away on their own with items that do not.





HideDismiss only takes the button away: the item still counts down, still answers Escape and still takes part in DismissOnClick. It is for the notification that carries its own way out - an action button, or a countdown short enough that a second way out would only be noise.

Swipe to dismiss

SwipeToDismiss lets an item be dragged out of the way with the pointer, in either inline direction, which is how a notification is thrown away on a touch screen where the dismiss button is a small target and the pointer is a thumb. SwipeThreshold is how far the drag has to go before it counts (default is 50 pixels); anything short of that springs the item back. A persistent item does not follow the pointer at all, for the same reason it has no dismiss button, and a dismissal this way reports itself as BitSnackBarDismissReason.Swipe.



Last dismissal:

Stacking

MaxItems caps how many items are on screen at once, so a burst of notifications cannot grow into a wall that covers the page, and OverflowBehavior decides what happens to the one that does not fit: DismissOldest (the default) keeps the newest news on screen, Queue holds the item back until a slot frees up so that none of them is missed - PendingItems is what is still waiting - and Skip drops it. NewestOnTop puts the newest item at the head of the stack instead of the tail, and PreventDuplicates skips an item whose title, body and color match one that is already showing, returning that one instead, starting its countdown over and counting the repeat in BitSnackBarItem.DuplicateCount - which is what a template shows the repeat with, so suppressing it hides the noise without hiding that the thing happened again.

Overflow behavior




Showing:   Waiting:   Repeats suppressed:

Icon

ShowIcon puts a leading glyph in each item, chosen from its color, which makes the severity of a notification readable at a glance instead of from the fill alone. IconName replaces that glyph for every item, BitSnackBarItem.IconName for a single one, and BitSnackBarItem.HideIcon drops it from one item while the rest keep theirs. The glyph is decorative, so it is hidden from screen readers - the text is what they announce.





Actions

An action is the point of a notification that reports something the user can still do about it - "Undo", "Retry", "View". ActionsTemplate renders that content under the body of every item and receives the item, so one template can act on whichever notification it was rendered for; a single item can carry its own BitSnackBarItem.Actions instead. Keep the countdown long enough (or the item persistent) for the action to be reachable - the pause on hover and focus already holds it while the button is being aimed at.



Last action: -

Multiline

By default the title and the body are kept to a single line and cut off with an ellipsis, with the full text in a tooltip, which keeps the stack the same size no matter what is shown in it. Multiline lets both wrap instead, for the notifications whose whole text has to be read. Neither shows until the item has a width to run out of: an item is only as wide as its longest line needs, so the same message sits on one line either way until MaxWidth caps it - at that measure the default truncates and a multiline one wraps.





Templates

TitleTemplate and BodyTemplate replace the text of the header and of the body, each receiving the string it stands in for, while Template takes over the whole item - header, body and actions - and receives the item itself. A template that takes over the item is responsible for whatever of it should still be there, including a way to dismiss it; the countdown bar is still drawn underneath.





Events

OnShow and OnDismiss report the item that arrived or left, and BitSnackBarItem.DismissReason tells which of them took it away - the button, the Escape key, a click, a swipe, the countdown, a Close call, Clear, or the host making room for a newer item - so a callback can tell a notification the user threw away from one that simply ran out of time. OnItemClick reports a click anywhere inside an item, and DismissOnClick makes that click dismiss it as well, which is the usual way a notification that links somewhere gets out of the way once it is followed; a clickable item carries a tab stop of its own and answers Enter and Space, so it is reachable without a pointer. Each item can also carry its own OnClick and OnDismiss callbacks, which run first, and its own BitSnackBarItem.Data - a payload the component never reads, so a shared callback can find the entity or the correlation id the notification was about without a lookup table.



Log:

    Programmatic control

    The item a Show call returns is the handle to the notification: change its title, body or color and hand it to Update to turn it into the report of whatever it was waiting for, restarting its countdown and announcing it again. Pause and Resume hold and release that countdown from code - a hold of its own, which the pointer wandering over the item and away again does not let go - Clear closes everything at once, and Items is the list of what is showing right now. ClearOnNavigation does that last one for you the moment the app routes somewhere else, so a notification about the page it was raised on does not outlive that page.





    Showing:

    Accessibility

    A notification nobody can see has to be heard. An element that arrives with its text already inside it is silent in most screen readers, so the host keeps two live regions in the page from its first render and puts the text of an arriving item into whichever matches how loudly it asked to be heard: the colors that report a problem interrupt as an alert, the rest wait for a pause as a status. Role (or BitSnackBarItem.Role) overrides that choice, and a role that is not a live one leaves the item unannounced. BitSnackBarItem.AnnounceText replaces what is said, for an item whose text on screen is not what should be read out - an abbreviation, or a Template whose content lives elsewhere.

    The rest is the same care in the other places: AriaLabel names the region a screen reader user jumps to, DismissAriaLabel names the dismiss button (which is last in the DOM although it is drawn first from the end, so the notification is read before the button that throws it away), Escape closes the item the focus is inside and hands the focus on to the next one, and the countdown holds while the item is being read.



    A notification sits at the end of the document and takes itself away again, so without a shortcut a keyboard user has no reliable way to reach one before it is gone. Hotkey is that shortcut: a list of KeyboardEvent.code values (the modifiers written as altKey, ctrlKey, shiftKey, metaKey) that moves the focus to the notification region, from where the next Tab walks into the dismiss buttons and the actions. Name it in AriaLabel so it can be found, and use FocusAsync instead where the app has a shortcut registry of its own.

    Customization

    Everything the snack bar offers, in one place: pick a color, a position, a direction and a lifetime, type a title and a body, then show it. TransitionDuration is how long the enter and exit animations run (default 200ms) - a dismissed item is kept in the DOM for that long so its exit can play, and zero takes it away at once with no animation at all.



    Color
    Position

    Direction
    Variant

    Size






    Color

    The color of an item comes from the general BitColor palette, either through one of the named shortcuts or through the color argument of Show. It decides the fill and the foreground, the default leading icon, and how the item is announced: the colors that report a problem (Warning, SevereWarning, Error) interrupt the screen reader as an alert, the rest wait for a pause as a status. Variant switches all of them between the filled, outlined and text looks.

    Variant

    External Icons

    Use icons from external libraries like FontAwesome and Bootstrap Icons with the DismissIcon and Icon parameters. BitIconInfo.Fa, BitIconInfo.Bi and BitIconInfo.Css build the class list for a library, and a bare string of CSS classes converts to one implicitly.


    FontAwesome:









    Bootstrap:



    Size

    Size scales the padding, the gaps and the type of the items between Small, Medium (the default) and Large, so a snack bar can sit alongside the density of the rest of the app.





    Style & Class

    A single item takes a cssStyle and a cssClass of its own through Show, which is how one notification is made to stand out from the rest of the host. Styles and Classes reach every part of every item - root, container, header, icon, title, body, actions, dismiss button and progress bar.

    Item's Style & Class:







    Styles & Classes:



    RTL

    Set Dir to BitDir.Rtl to lay a snack bar out right-to-left. The positions are named after the reading order rather than the screen, so a BottomStart stack sits at the bottom right here, the leading icon comes first from the right, and the dismiss button keeps to the inline end.

    API

    Every parameter, public member, sub-class and enum this component exposes.

    BitSnackBar parameters

    Name Type Default value Description
    ActionsTemplate RenderFragment<BitSnackBarItem>? null The content of the action area of every snack bar item, rendered under its body. An item that carries its own Actions renders that instead.
    AutoDismiss bool false Whether or not automatically dismiss the snack bar. The countdown of an item is paused while the pointer or the keyboard focus is inside it, and a persistent item never takes part in it at all.
    AutoDismissTime TimeSpan? null How long does it take to automatically dismiss the snack bar (default is 3 seconds). A single item can ask for a lifetime of its own through BitSnackBarItem.AutoDismissTime, and a value of zero or less turns the countdown off.
    BodyTemplate RenderFragment<string>? null Used to customize how the content inside the body is rendered.
    Classes BitSnackBarClassStyles? null Custom CSS classes for different parts of the snack bar.
    ClearOnNavigation bool false Closes every snack bar item as soon as the app navigates somewhere else, so a notification about the page it was raised on does not outlive that page.
    DismissAriaLabel string? null The accessible label of the dismiss button (default is "Close"). The button holds nothing but an icon, so without a label of its own a screen reader has nothing to announce it by.
    DismissIcon BitIconInfo? null Gets or sets the icon of the dismiss button using custom CSS classes for external icon libraries. Takes precedence over DismissIconName when both are set.
    DismissIconName string? null The icon name of the dismiss button from the built-in Fluent UI icons. If unset, default will be the Fluent UI Cancel icon.
    DismissOnClick bool false Dismisses a snack bar item when anywhere inside it is clicked. Leave this off while the item holds interactive content the user is still filling in.
    HideDismiss bool false Prevents rendering the dismiss button of every snack bar item. Unlike Persistent this only takes the button away: the items still count down, still answer the Escape key and still take part in DismissOnClick.
    HideProgress bool false Prevents rendering the countdown progress bar of the auto-dismissing snack bars.
    Hotkey string[]? null The keyboard shortcut that moves the focus to the snack bar region, as a list of KeyboardEvent.code values (the modifiers written as their property names, so ["KeyT", "altKey"] is Alt+T). A notification is at the end of the document and takes itself away again, so this is what makes the actions inside one operable from the keyboard at all. Off unless a shortcut is given; needs the bit BlazorUI script to be on the page.
    Icon BitIconInfo? null The leading icon of every snack bar item using custom CSS classes for external icon libraries. Only rendered while ShowIcon is enabled, and takes precedence over IconName when both are set.
    IconName string? null The name of the leading icon of every snack bar item from the built-in Fluent UI icons. Only rendered while ShowIcon is enabled. If unset, the icon of each item is selected automatically based on its color.
    MaxItems int? null The maximum number of snack bar items to show at once, so a burst of notifications cannot grow into a wall that covers the page. What happens to the item that does not fit is up to OverflowBehavior. Unset (or zero and below) means no cap.
    MaxWidth string? null The maximum width of the snack bar items. Any CSS length is accepted, and the stack never grows past the width of the screen whatever this says. Unset, an item is as wide as its longest line needs.
    Multiline bool false Enables the multiline mode of both title and body. A single-line title or body that does not fit is cut off with an ellipsis and keeps its full text in a tooltip.
    NewestOnTop bool false Puts the newest snack bar item at the top of the stack instead of the bottom.
    Offset string? null The distance of the stack from the edges of the screen (default is 8px). Any CSS length is accepted, which is how a snack bar is kept clear of the chrome the app already has at that edge.
    OnDismiss EventCallback<BitSnackBarItem> Callback for when any snack bar is dismissed, reporting the item that was dismissed. Its DismissReason tells what took it away.
    OnItemClick EventCallback<BitSnackBarItem> Callback for when any snack bar item is clicked.
    OnShow EventCallback<BitSnackBarItem> Callback for when a new snack bar item is shown. An item held back by the Queue overflow behavior reports this when it reaches the screen rather than when it was handed to Show.
    OverflowBehavior BitSnackBarOverflowBehavior BitSnackBarOverflowBehavior.DismissOldest What happens to a new snack bar item that arrives while MaxItems is already reached: the oldest one is dismissed to make room for it, the new one is held back until a slot frees up, or the new one is dropped.
    PauseOnHover bool true Pauses the auto-dismiss countdown while the pointer or the keyboard focus is inside a snack bar item. This is how the countdown meets WCAG 2.2.1 (Timing Adjustable) without a longer timeout.
    PauseOnPageHidden bool false Pauses the auto-dismiss countdown of every snack bar item while the page is hidden, so a notification is not spent in a background tab. Needs the bit BlazorUI services to be registered (AddBitBlazorUIServices).
    PauseOnWindowBlur bool false Pauses the auto-dismiss countdown of every snack bar item while the window does not have the focus. A window that another one is covering is not hidden, so PauseOnPageHidden alone lets a notification count down behind whatever is in front of it. Needs the bit BlazorUI services to be registered (AddBitBlazorUIServices).
    Persistent bool false Makes the snack bar non-dismissible in UI and removes the dismiss button. A persistent snack bar also opts out of the auto-dismiss countdown and of the Escape key. To take the button away without also taking the countdown away, use HideDismiss instead.
    Position BitSnackBarPosition? null The position of the snack bars to show (default is bottom right).
    PreventDuplicates bool false Skips showing a new snack bar while an identical one (same title, body and color) is already on screen, returning the one that is already showing instead and starting its countdown over.
    ReverseProgress bool false Draws the countdown progress bar depleting from full to empty instead of filling from empty to full, so it reads as the time the notification has left rather than as how far it has got through its lifetime.
    Role string? null A custom ARIA role for every snack bar item, overriding the one its color implies. By default the colors that report a problem are announced as an alert and the rest as a status, and a role that is not a live one leaves the item unannounced.
    ShowIcon bool false Renders a leading icon in each snack bar item, chosen from its color unless one is provided.
    Size BitSize? null The size of the snack bar items.
    Styles BitSnackBarClassStyles? null Custom CSS styles for different parts of the snack bar.
    SwipeToDismiss bool false Lets a snack bar item be dragged out of the way with the pointer, in either inline direction, which is how a notification is thrown away on a touch screen. A persistent item is not swipeable. Needs the bit BlazorUI script to be on the page.
    SwipeThreshold int 50 How far a snack bar item has to be dragged before it is dismissed, in pixels. Only in effect while SwipeToDismiss is enabled; a drag that stops short of this springs the item back where it was.
    Template RenderFragment<BitSnackBarItem>? null Used to fully customize how a snack bar item is rendered, taking the place of its header, body and actions. The countdown progress bar is still rendered under the template.
    TitleTemplate RenderFragment<string>? null Used to customize how content inside the title is rendered.
    TransitionDuration int 200 The duration in milliseconds of the enter and exit animations of the snack bar items. A dismissed item is kept in the DOM for this long so its exit animation can play. Set it to zero to remove the item at once.
    Variant BitVariant? null The visual variant of the snack bar items.

    BitSnackBar public members

    Name Type Default value Description
    Items IReadOnlyList<BitSnackBarItem> [] The snack bar items that are currently showing, oldest first (or newest first with NewestOnTop).
    PendingItems IReadOnlyList<BitSnackBarItem> [] The snack bar items that are waiting for a slot under the Queue overflow behavior, in the order they will be shown.
    Info Task<BitSnackBarItem> Info(string title, string? body = "", bool persistent = false, TimeSpan? autoDismissTime = null) Shows a new snackbar with Info color.
    Success Task<BitSnackBarItem> Success(string title, string? body = "", bool persistent = false, TimeSpan? autoDismissTime = null) Shows a new snackbar with Success color.
    Warning Task<BitSnackBarItem> Warning(string title, string? body = "", bool persistent = false, TimeSpan? autoDismissTime = null) Shows a new snackbar with Warning color.
    SevereWarning Task<BitSnackBarItem> SevereWarning(string title, string? body = "", bool persistent = false, TimeSpan? autoDismissTime = null) Shows a new snackbar with SevereWarning color.
    Error Task<BitSnackBarItem> Error(string title, string? body = "", bool persistent = false, TimeSpan? autoDismissTime = null) Shows a new snackbar with Error color.
    Show Task<BitSnackBarItem> Show(string title, string? body = "", BitColor color = BitColor.Info, string? cssClass = null, string? cssStyle = null, bool persistent = false, TimeSpan? autoDismissTime = null) Shows a new snackbar.
    Show Task<BitSnackBarItem> Show(BitSnackBarItem item) Shows a new snackbar. Showing an item that is already showing (or already waiting in the queue) is a no-op that returns it unchanged, and so is showing a duplicate of one while PreventDuplicates is enabled - in which case the item that is already showing comes back instead, with its countdown started over. An item that does not fit under MaxItems is dealt with by OverflowBehavior.
    Close Task Close(BitSnackBarItem item) Closes a snackbar item. The returned task completes once the item has left the DOM, which is after its exit animation has played. An item that is still waiting in the queue is taken out of it instead.
    Clear Task Clear() Closes every snackbar item that is currently showing, and drops everything that was waiting in the queue.
    Update Task Update(BitSnackBarItem item) Re-renders a snackbar item after its properties were changed, restarts its auto-dismiss countdown and announces its new text again. This is how a notification is turned into the report of what it was waiting for.
    FocusAsync ValueTask FocusAsync() Moves the keyboard focus to the snack bar region, which is what puts the next Tab inside the notifications. This is what Hotkey does, offered on its own for an app with a shortcut registry of its own.
    Pause Task Pause(BitSnackBarItem item) Pauses the auto-dismiss countdown of a snackbar item. This is a hold of its own rather than the same one the pointer takes, so it is not let go again by the pointer happening to leave the item - only Resume releases it.
    Resume Task Resume(BitSnackBarItem item) Resumes the auto-dismiss countdown of a snackbar item that was paused. A countdown is held back for as long as any one reason to hold it back stands, so this does nothing while the pointer or the keyboard focus is still inside the item or the page is still hidden.

    BitComponentBase parameters

    Name Type Default value Description
    AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
    Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
    Dir BitDir? null Gets or sets the text directionality for the component's content.
    ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
    HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters.
    Id string? null Gets or sets the unique identifier for the component's root element.
    IsEnabled bool true Gets or sets a value indicating whether the component is enabled and can respond to user interaction.
    Style string? null Gets or sets the CSS style string to apply to the rendered element.
    TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
    Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

    BitComponentBase public members

    Name Type Default value Description
    UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
    RootElement ElementReference Gets the reference to the root HTML element associated with this component.

    BitIconInfo properties

    Name Type Default value Description
    Name string? null Gets or sets the name of the icon.
    BaseClass string? null Gets or sets the base CSS class for the icon. For built-in Fluent UI icons, this defaults to "bit-icon". For external icon libraries like FontAwesome, you might set this to "fa" or leave empty.
    Prefix string? null Gets or sets the CSS class prefix used before the icon name. For built-in Fluent UI icons, this defaults to "bit-icon--". For external icon libraries, you might set this to "fa-" or leave empty.

    BitSnackBarClassStyles properties

    Name Type Default value Description
    Root string? null Custom CSS classes/styles for the root element of the BitSnackBar.
    Container string? null Custom CSS classes/styles for the main container of the BitSnackBar.
    Header string? null Custom CSS classes/styles for the header of the BitSnackBar.
    IconContainer string? null Custom CSS classes/styles for the icon container of the BitSnackBar.
    Icon string? null Custom CSS classes/styles for the leading icon of the BitSnackBar.
    DismissButton string? null Custom CSS classes/styles for the dismiss button of the BitSnackBar.
    DismissIcon string? null Custom CSS classes/styles for the dismiss icon of the BitSnackBar.
    Title string? null Custom CSS classes/styles for the title of the BitSnackBar.
    Body string? null Custom CSS classes/styles for the body of the BitSnackBar.
    Actions string? null Custom CSS classes/styles for the action area of the BitSnackBar.
    ProgressBar string? null Custom CSS classes/styles for the progress bar of the BitSnackBar.

    BitSnackBarItem properties

    A class to represent each snack bar item. It is handed to Show and stays the handle of the snack bar it opened, which Close, Update, Pause and Resume take and which OnDismiss reports back. Every member overrides the matching parameter of the host for this one item only.

    Name Type Default value Description
    Id Guid Guid.NewGuid() The unique identifier of the snack bar item.
    Actions RenderFragment? null The content of the action area of this snack bar item, rendered under its body, taking the place of the host's ActionsTemplate.
    AnnounceText string? null What a screen reader is told when this item arrives, instead of its title and body. An empty string leaves the item unannounced.
    AutoDismissTime TimeSpan? null How long it takes to automatically dismiss this specific snack bar item, overriding the AutoDismissTime of the host.
    Body string? null The body text of the snack bar item.
    Color BitColor? null The color theme of the snack bar item, which also decides its default icon and the politeness of its live region.
    CssClass string? null Custom CSS class to apply to the snack bar item.
    CssStyle string? null Custom CSS style to apply to the snack bar item.
    Data object? null An arbitrary payload to carry along with the snack bar item. Nothing in the component reads it; it is a place to keep whatever the callbacks of the item need.
    DuplicateCount int 0 How many further times this notification was raised while it was already on screen, counted by PreventDuplicates. Zero for an item that was raised once, and reset each time the item is shown afresh.
    DismissReason BitSnackBarDismissReason? null What took this item off the screen, set by the host just before the dismiss callbacks run. Null until the item has been dismissed.
    HideDismiss bool false Prevents rendering the dismiss button of this specific item, without taking its countdown, its answer to Escape or its part in DismissOnClick away.
    HideIcon bool false Prevents rendering the leading icon of this specific snack bar item.
    Icon BitIconInfo? null The leading icon of this snack bar item using custom CSS classes for external icon libraries.
    IconName string? null The name of the leading icon of this snack bar item from the built-in Fluent UI icons.
    OnClick Func<BitSnackBarItem, Task>? null A callback that is invoked when this snack bar item is clicked, before the host's OnItemClick.
    OnDismiss Func<BitSnackBarItem, Task>? null A callback that is invoked when this snack bar item is dismissed, before the host's OnDismiss.
    Persistent bool false Makes this specific snack bar item non-dismissible and removes its dismiss button, which also opts it out of the auto-dismiss countdown.
    Role string? null A custom ARIA role for this snack bar item, overriding the one its color implies.
    Title string null The title text of the snack bar item.

    BitSnackBarPosition enum

    Name Value Description
    TopStart 0 Top of the screen, at the inline start.
    TopCenter 1 Top of the screen, centered.
    TopEnd 2 Top of the screen, at the inline end.
    BottomStart 3 Bottom of the screen, at the inline start.
    BottomCenter 4 Bottom of the screen, centered.
    BottomEnd 5 Bottom of the screen, at the inline end (the default).

    BitSnackBarOverflowBehavior enum

    Name Value Description
    DismissOldest 0 Dismisses the oldest item on screen to make room for the new one. This is the default.
    Queue 1 Holds the new item back until a slot frees up, then shows it in the order it arrived.
    Skip 2 Drops the new item, leaving what is already on screen untouched.

    BitSnackBarDismissReason enum

    Name Value Description
    Programmatic 0 The code that opened the item closed it through Close.
    DismissButton 1 The user pressed the dismiss button of the item.
    Escape 2 The user pressed the Escape key while the focus was inside the item.
    Click 3 The user clicked the item while DismissOnClick was enabled.
    Swipe 4 The user swiped the item away while SwipeToDismiss was enabled.
    Timeout 5 The auto-dismiss countdown of the item ran out.
    Overflow 6 The item was taken away to make room for a newer one under MaxItems.
    Clear 7 The host was emptied through Clear.

    BitColor enum

    Name Value Description
    Primary 0 Primary general color.
    Secondary 1 Secondary general color.
    Tertiary 2 Tertiary general color.
    Info 3 Info general color.
    Success 4 Success general color.
    Warning 5 Warning general color.
    SevereWarning 6 SevereWarning general color.
    Error 7 Error general color.
    PrimaryBackground 8 Primary background color.
    SecondaryBackground 9 Secondary background color.
    TertiaryBackground 10 Tertiary background color.
    PrimaryForeground 11 Primary foreground color.
    SecondaryForeground 12 Secondary foreground color.
    TertiaryForeground 13 Tertiary foreground color.
    PrimaryBorder 14 Primary border color.
    SecondaryBorder 15 Secondary border color.
    TertiaryBorder 16 Tertiary border color.

    BitVariant enum

    Name Value Description
    Fill 0 Fill styled variant.
    Outline 1 Outline styled variant.
    Text 2 Text styled variant.

    BitSize enum

    Name Value Description
    Small 0 The small size snack bar.
    Medium 1 The medium size snack bar (the default).
    Large 2 The large size snack bar.

    BitVisibility enum

    Name Value Description
    Visible 0 The content of the component is visible.
    Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
    Collapsed 2 The component is hidden (display:none).

    BitDir enum

    Name Value Description
    Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
    Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
    Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

    Feedback

    Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.