SnackBar
SnackBars provide brief notifications. The component is also known as a toast.
Usage
Type & Position
Templates
Style & Class
Implementation
BitSnackBar parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
AutoDismiss | bool | true | Whether or not to dismiss itself automatically. |
AutoDismissTime | TimeSpan | TimeSpan.FromSeconds(3) | How long the SnackBar will automatically dismiss (default is 3 seconds). |
BodyTemplate | RenderFragment<string>? | null | Used to customize how content inside the Body is rendered. |
Classes | BitSnackBarClassStyles? | null | Custom CSS classes for different parts of the BitSnackBar. |
DismissIconName | string? | null | Dismiss Icon in SnackBar. |
OnDismiss | EventCallback | Callback for when the Dismissed. | |
Position | BitSnackBarPosition | BitSnackBarPosition.BottomRight | The position of SnackBar to show. |
Styles | BitSnackBarClassStyles? | null | Custom CSS styles for different parts of the BitSnackBar. |
TitleTemplate | RenderFragment<string>? | null | Used to customize how content inside the Title is rendered. |
BitComponentBase parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
AriaLabel | string? | null | The aria-label of the control for the benefit of screen readers. |
Class | string? | null | Custom CSS class for the root element of the component. |
HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Capture and render additional attributes in addition to the component's parameters. |
Id | string? | null | Custom id attribute for the root element. if null the UniqueId will be used instead. |
IsEnabled | bool | true | Whether or not the component is enabled. |
Style | string? | null | Custom CSS style for the root element of the component. |
Visibility | BitVisibility | BitVisibility.Visible | Whether the component is visible, hidden or collapsed. |
BitComponentBase public members
Name |
Type |
Default value |
Description |
---|---|---|---|
UniqueId | Guid | Guid.NewGuid() | The readonly unique id of the root element. it will be assigned to a new Guid at component instance construction. |
RootElement | ElementReference | The ElementReference of the root element. |
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. |
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. |
ProgressBar | string? | null | Custom CSS classes/styles for the progress bar of the BitSnackBar. |
BitSnackBarPosition enum
Name |
Value |
Description |
---|---|---|
TopLeft | 0 | |
TopCenter | 1 | |
TopRight | 2 | |
BottomLeft | 3 | |
BottomCenter | 4 | |
BottomRight | 5 |
BitSnackBarType enum
Name |
Value |
Description |
---|---|---|
None | 0 | None styled SnackBar |
Info | 1 | Info styled SnackBar |
Warning | 2 | Warning styled SnackBar |
Success | 3 | Success styled SnackBar |
Error | 4 | Error styled SnackBar |
SevereWarning | 5 | Severe Warning styled SnackBar |
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). |