Notifications
Message
An inline message that reports an error, a warning, or something worth knowing - a failed upload, an expiring licence, a saved draft - in place and without interrupting the page. It carries a color and a matching icon for its severity, an optional title, action buttons, a fold that holds a long text to one line or to a set number of them, and a dismiss button that can take the message off the page by itself, on a timer or on demand, and it announces itself to screen readers with the urgency its color implies.
Notes
Color is what makes a Message a notice rather than a box of text: it picks the palette, the
default icon, and the urgency of the announcement. Warning,
SevereWarning and
Error are announced as an
alert, which interrupts a screen reader;
everything else is announced politely as a status.
Override that with Role where the color is chosen for looks rather than for severity, and with
Politeness where the role is right but the urgency is not.
Never let the color carry the meaning on its own - the text has to say what happened - and never leave a
warning or an error without a way forward: give it an Actions button or a link that resolves it.
AutoDismissTime is a time limit, so it holds while a mouse or a pen rests on the message or the
focus is inside it. Keep it for confirmations that need no answer; anything with an action in it should
wait to be dismissed by hand.
The icon is decorative markup and is hidden from screen readers, so where the text does not say what kind
of message this is, say it with IconAriaLabel. And leave AutoFocus for the messages that have
to be acted upon: the rest are already announced, and taking the focus away from what the reader was doing
is an interruption of its own.
A live region only announces what changes inside it, so a message that appears with its text already in
place is a change of nothing and several screen readers stay silent about it: give the ones that answer
something the reader just did a DelayedAnnouncement.
A message that takes itself off the page takes the focus with it if the dismiss button was carrying it,
which leaves a keyboard user back at the top of the document. Where that matters, put the focus somewhere
deliberate from OnDismiss - the control the message was about, or the next message in the stack.
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
Title
A title that is a heading
Variant
Alignment
Elevation
Multiline
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new, an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
Truncate
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
Dismiss
Auto-dismiss
Actions
HideIcon
Icons
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
Square
Advanced
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
Announcement
Focus
Disabled
Color
External Icons
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
Size
Style & Class
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
In this space, potential reigns supreme. It is a moment suspended in time, where imagination dances freely and each word has the power to transform into something extraordinary. Here lies the start of something new-an opportunity to craft, inspire, and create. Whether it's a tale of adventure, a reflection of truth, or an idea that sparks change, these lines are yours to fill, to shape, and to make uniquely yours. The journey begins here, in this quiet moment where everything is possible.
RTL
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد.
API
Every parameter, public member, sub-class and enum this component exposes.
BitMessage parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| Actions | RenderFragment? | null | The content of the action to show on the message. |
| Alignment | BitAlignment? | null | Determines the alignment of the content section of the message. |
| AutoDismissTime | TimeSpan? | null | Enables the auto-dismiss feature and sets the time to automatically dismiss the message. It runs wherever dismissing would do something - an OnDismiss handler, Dismissible, or a Dismissed binding - and is held while the pointer is over the message, the focus is inside it, or PauseAutoDismiss was called. |
| AutoFocus | bool | false | Moves the focus to the message as soon as it is rendered. The root is made focusable (tabindex="-1") while no explicit TabIndex is given. |
| ChildContent | RenderFragment? | null | The content of message. |
| Classes | BitMessageClassStyles? | null | Custom CSS classes for different parts of the BitMessage. |
| CollapseAriaLabel | string | "Collapse" | The aria-label and the tooltip of the expander button of the message in Truncate mode while it is expanded. |
| CollapseIcon | BitIconInfo? | null | Gets or sets the icon for the collapse button in Truncate mode using custom CSS classes for external icon libraries. Takes precedence over CollapseIconName when both are set. |
| CollapseIconName | string? | null | Gets or sets the name of the collapse icon in Truncate mode from the built-in Fluent UI icons. |
| Color | BitColor? | null | The general color of the message. |
| Content | RenderFragment? | null | The alias for ChildContent. |
| DelayedAnnouncement | bool | false | Holds the content of the message back for one render, so its live region is already on the page when the text lands in it, which is what makes the announcement reliable. |
| DismissAriaLabel | string | "Dismiss" | The aria-label and the tooltip of the dismiss button of the message. |
| Dismissed | bool | false | Determines whether the message has been dismissed, which is two-way bindable. A dismissed message renders nothing, and setting it back to false brings the message back and re-arms its AutoDismissTime countdown. The message only sets it itself while Dismissible is set or the parameter is bound. |
| DismissedChanged | EventCallback<bool> | null | The callback that is called when the Dismissed value changes, for subscribing to the change without binding to Dismissed. |
| Dismissible | bool | false | Renders the dismiss button and lets the message dismiss itself by setting Dismissed, without an OnDismiss handler having to take it off the page. |
| DismissIcon | BitIconInfo? | null | Gets or sets the icon for the dismiss button using custom CSS classes for external icon libraries. Takes precedence over DismissIconName when both are set. |
| DismissIconName | string? | null | Gets or sets the name of the dismiss icon from the built-in Fluent UI icons. If unset, default will be the Fluent UI Cancel icon. |
| DismissOnEscape | bool | false | Dismisses the message when the Escape key is pressed while the focus is inside it. Only wired up while dismissing would do something - that is, while OnDismiss has a handler, Dismissible is set, or Dismissed is bound. |
| Elevation | int? | null | Determines the elevation of the message, a scale from 1 to 24. |
| ExpandAriaLabel | string | "Expand" | The aria-label and the tooltip of the expander button of the message in Truncate mode while it is collapsed. |
| Expanded | bool | false | Determines whether the truncated content of the message is expanded, which is two-way bindable. Only meaningful together with Truncate. |
| ExpandedChanged | EventCallback<bool> | null | The callback that is called when the Expanded value changes, for subscribing to the change without binding to Expanded. |
| ExpandIcon | BitIconInfo? | null | Gets or sets the icon for the expand button in Truncate mode using custom CSS classes for external icon libraries. Takes precedence over ExpandIconName when both are set. |
| ExpandIconName | string? | null | Gets or sets the name of the expand icon in Truncate mode from the built-in Fluent UI icons. |
| HideIcon | bool | false | Prevents rendering the icon of the message. |
| Icon | BitIconInfo? | null | Gets or sets the icon to display using custom CSS classes for external icon libraries. Takes precedence over IconName when both are set. |
| IconAriaLabel | string? | null | The text that says out loud what the icon of the message means, rendered invisibly at the start of the announced region. Set it where the text of the message does not already say what kind of message it is. |
| IconName | string? | null | Gets or sets the name of the icon to display from the built-in Fluent UI icons. If unset, the icon will be selected automatically based on Color. |
| IconTemplate | RenderFragment? | null | The custom template to render in place of the icon of the message, which takes precedence over Icon and IconName. |
| MaxLines | int? | null | Caps how many lines the content of the message may wrap over in Multiline mode, ending the last of them in an ellipsis. Pair it with Truncate to give the reader the expander button that unfolds the rest. |
| Multiline | bool | false | Determines if the message is multi-lined. If false, and the text overflows over buttons or to another line, it is clipped. |
| OnDismiss | EventCallback | Reports that the message was dismissed - by its button, the Escape key, the countdown or a DismissAsync call - and renders the dismiss button that does it. Taking the message off the page is left to this callback; use Dismissible to have the message do that itself. | |
| OnDismissing | EventCallback<BitMessageDismissArgs> | Callback invoked before the message is dismissed, letting the dismissal be cancelled. Set Cancel on the provided args to keep the message where it is, and read its Reason to tell the dismiss button, the Escape key, the countdown and a DismissAsync call apart. Refusing a countdown gives the message its AutoDismissTime over again. | |
| Politeness | BitPoliteness? | null | How urgently the message interrupts a screen reader (aria-live), independently of the role it is announced under. Left unset, the role carries the urgency on its own: alert interrupts, status waits its turn. |
| Role | string? | null | Custom role to apply to the message text. If unset, Warning, SevereWarning and Error announce as "alert" and every other color as "status". Set it to "none" for a message that should not be announced at all. |
| ShowAutoDismissProgress | bool | false | Renders a bar along the bottom edge of the message that runs down as its AutoDismissTime does, holding wherever the countdown holds. It only renders where there is a countdown to show. |
| Size | BitSize? | null | The size of Message, Possible values: Small | Medium | Large. |
| Square | bool | false | Removes the rounded corners of the message so it can sit flush against the edges of its container as a banner. |
| Styles | BitMessageClassStyles? | null | Custom CSS styles for different parts of the BitMessage. |
| Title | string? | null | The title (heading) of the message, rendered above the content in multiline mode and ahead of it otherwise. |
| TitleElement | string? | null | The HTML element the title of the message is rendered as. The default is a div; set it to a heading (h2 ... h6) where the message is a part of the page a reader should be able to jump to. |
| TitleTemplate | RenderFragment? | null | The custom template to render as the title (heading) of the message, which takes precedence over Title. |
| Truncate | bool | false | Determines if the message text is truncated. If true, the content is clipped to a single line and a button renders to unfold it, for a message that has to fit in a tight space. On a Multiline message it unfolds the content past the MaxLines cap instead, and does nothing without one. |
| Variant | BitVariant? | null | The variant of the message. |
BitMessage public members
| Name | Type | Default value | Description |
|---|---|---|---|
| CollapseAsync | Task | Folds the truncated content of the message back into a single line, the way its expander button does. | |
| DismissAsync | Task | Dismisses the message the same way its dismiss button does: the countdown is stopped, the message takes itself off the page while it owns its dismissal, and OnDismiss is invoked. | |
| ExpandAsync | Task | Unfolds the truncated content of the message, the way its expander button does. | |
| FocusAsync | ValueTask | Moves the focus to the message, which has to be focusable for the focus to land: either give it a TabIndex or set AutoFocus. | |
| PauseAutoDismiss | void | Holds the AutoDismissTime countdown where it is, the way hovering the message does, for holding it over something the message cannot see. | |
| ResumeAutoDismiss | void | Lets the AutoDismissTime countdown spend its time again after a PauseAutoDismiss, from wherever it was held. | |
| ToggleExpandAsync | Task | Turns the truncated content of the message over: unfolds it while it is folded, folds it while it is not. |
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. |
BitMessageClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitMessage. |
| RootContainer | string? | null | Custom CSS classes/styles for the root container of the BitMessage. |
| Container | string? | null | Custom CSS classes/styles for the icon and content container of the BitMessage. |
| IconContainer | string? | null | Custom CSS classes/styles for the icon container of the BitMessage. |
| Icon | string? | null | Custom CSS classes/styles for the icon element of the BitMessage. |
| IconLabel | string? | null | Custom CSS classes/styles for the visually hidden icon label of the BitMessage. |
| ContentContainer | string? | null | Custom CSS classes/styles for the content container of the BitMessage. |
| ContentWrapper | string? | null | Custom CSS classes/styles for the content wrapper element of the BitMessage. |
| Title | string? | null | Custom CSS classes/styles for the title element of the BitMessage. |
| Content | string? | null | Custom CSS classes/styles for the content element of the BitMessage. |
| Actions | string? | null | Custom CSS classes/styles for the actions element of the BitMessage. |
| ExpanderButton | string? | null | Custom CSS classes/styles for the truncate expander button of the BitMessage. |
| ExpanderIcon | string? | null | Custom CSS classes/styles for the truncate expander icon of the BitMessage. |
| DismissButton | string? | null | Custom CSS classes/styles for the dismiss button of the BitMessage. |
| DismissIcon | string? | null | Custom CSS classes/styles for the dismiss icon of the BitMessage. |
| AutoDismissProgress | string? | null | Custom CSS classes/styles for the auto-dismiss progress track of the BitMessage. |
| AutoDismissProgressBar | string? | null | Custom CSS classes/styles for the auto-dismiss progress bar of the BitMessage. |
BitMessageDismissArgs properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Reason | BitMessageDismissReason | What made the message dismiss: its dismiss button, the Escape key, the auto-dismiss countdown, or a call to the DismissAsync method. | |
| Cancel | bool | false | Set to true to cancel the dismissal and keep the message where it is. |
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. |
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. |
BitAlignment enum
| Name | Value | Description |
|---|---|---|
| Start | 0 | |
| End | 1 | |
| Center | 2 | |
| SpaceBetween | 3 | |
| SpaceAround | 4 | |
| SpaceEvenly | 5 | |
| Baseline | 6 | |
| Stretch | 7 |
BitPoliteness enum
| Name | Value | Description |
|---|---|---|
| Off | 0 | The region is not a live region: nothing in it is announced as it changes (aria-live="off"). |
| Polite | 1 | The change waits its turn and is announced once the screen reader has finished what it was saying (aria-live="polite"). |
| Assertive | 2 | The change interrupts the screen reader and is announced right away (aria-live="assertive"). |
BitMessageDismissReason enum
| Name | Value | Description |
|---|---|---|
| Button | 0 | The dismiss button of the message was pressed. |
| Escape | 1 | The Escape key was pressed while the focus was inside the message. |
| AutoDismiss | 2 | The AutoDismissTime countdown of the message ran out. |
| Programmatic | 3 | The DismissAsync method of the message was called. |
BitSize enum
| Name | Value | Description |
|---|---|---|
| Small | 0 | The small size message. |
| Medium | 1 | The medium size message. |
| Large | 2 | The large size message. |
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.