syncfusion-blazor-notifications
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing Syncfusion Blazor Notifications
实现Syncfusion Blazor通知组件
A comprehensive skill for implementing Toast, Message, and Skeleton components from Syncfusion Blazor Notifications. These components provide essential user feedback mechanisms including temporary notifications, inline messages, and content loading states.
这是一份关于实现Syncfusion Blazor Notifications中Toast、Message和Skeleton组件的综合指南。这些组件提供了必要的用户反馈机制,包括临时通知、内联消息和内容加载状态。
Component Overview
组件概述
SfToast
SfToast
Lightweight, non-blocking notification popups that appear temporarily to provide feedback. Supports positioning, animations, action buttons, and templates.
Key Features:
- Configurable positions (top-left, top-center, top-right, bottom-left, bottom-center, bottom-right)
- Show/hide animations with customizable timing
- Auto-dismiss with timeout and progress bar
- Action buttons for user interaction
- Template support for custom content
- Event callbacks (OnOpen, OnClose, OnClick)
- Multiple toast stacking (newest on top/bottom)
轻量级、非阻塞式的通知弹窗,会临时显示以提供反馈。支持定位、动画、操作按钮和模板。
核心特性:
- 可配置位置(左上、顶部居中、右上、左下、底部居中、右下)
- 可自定义时长的显示/隐藏动画
- 带超时和进度条的自动关闭功能
- 用于用户交互的操作按钮
- 自定义内容的模板支持
- 事件回调(OnOpen、OnClose、OnClick)
- 多个Toast堆叠(最新的在顶部/底部)
SfMessage
SfMessage
Inline alert component for displaying contextual feedback messages with different severity levels.
Key Features:
- Severity types (Normal, Info, Success, Warning, Error) with color-coded styling
- Variants (Text, Outlined, Filled) for different visual styles
- Built-in icons matching severity levels
- Optional close button for dismissible messages
- Content alignment (left, center, right)
- Visibility control and close event handling
- Custom CSS styling support
内联警告组件,用于显示不同严重级别的上下文反馈消息。
核心特性:
- 严重级别类型(普通、提示、成功、警告、错误),配有颜色编码样式
- 变体样式(文本型、轮廓型、填充型)
- 与严重级别匹配的内置图标
- 可选的关闭按钮,支持可关闭消息
- 内容对齐方式(左、居中、右)
- 可见性控制和关闭事件处理
- 自定义CSS样式支持
SfSkeleton
SfSkeleton
Loading placeholder component that displays animated shapes to indicate content is loading.
Key Features:
- Shapes (Circle, Square, Rectangle, Text) for different content types
- Shimmer effects (Pulse, Wave, Fade, None) for visual feedback
- Configurable dimensions (width, height)
- Accessibility labels for screen readers
- Visibility toggle for showing/hiding
- CSS customization for styling
加载占位符组件,显示动画形状以指示内容正在加载。
核心特性:
- 适用于不同内容类型的形状(圆形、方形、矩形、文本)
- 视觉反馈的微光效果(脉冲、波浪、淡入淡出、无)
- 可配置的尺寸(宽度、高度)
- 供屏幕阅读器使用的无障碍标签
- 显示/隐藏的可见性切换
- 样式自定义的CSS支持
Quick Start
快速开始
Toast - Basic Example
Toast - 基础示例
razor
@page "/toast-demo"
@using Syncfusion.Blazor.Notifications
@using Syncfusion.Blazor.Buttons
<SfButton @onclick="ShowToast">Show Toast</SfButton>
<SfToast @ref="ToastObj" Title="Notification" Content="Your changes have been saved successfully!" />
@code {
SfToast ToastObj;
private async Task ShowToast()
{
await ToastObj.ShowAsync();
}
}razor
@page "/toast-demo"
@using Syncfusion.Blazor.Notifications
@using Syncfusion.Blazor.Buttons
<SfButton @onclick="ShowToast">Show Toast</SfButton>
<SfToast @ref="ToastObj" Title="Notification" Content="Your changes have been saved successfully!" />
@code {
SfToast ToastObj;
private async Task ShowToast()
{
await ToastObj.ShowAsync();
}
}Message - Basic Example
Message - 基础示例
razor
@page "/message-demo"
@using Syncfusion.Blazor.Notifications
<SfMessage Severity="MessageSeverity.Success" ShowIcon="true" ShowCloseIcon="true">
Your profile has been updated successfully!
</SfMessage>
<SfMessage Severity="MessageSeverity.Warning" ShowIcon="true">
Your session will expire in 5 minutes.
</SfMessage>
<SfMessage Severity="MessageSeverity.Error" ShowIcon="true" ShowCloseIcon="true">
Failed to save changes. Please try again.
</SfMessage>razor
@page "/message-demo"
@using Syncfusion.Blazor.Notifications
<SfMessage Severity="MessageSeverity.Success" ShowIcon="true" ShowCloseIcon="true">
Your profile has been updated successfully!
</SfMessage>
<SfMessage Severity="MessageSeverity.Warning" ShowIcon="true">
Your session will expire in 5 minutes.
</SfMessage>
<SfMessage Severity="MessageSeverity.Error" ShowIcon="true" ShowCloseIcon="true">
Failed to save changes. Please try again.
</SfMessage>Skeleton - Basic Example
Skeleton - 基础示例
razor
@page "/skeleton-demo"
@using Syncfusion.Blazor.Notifications
<div class="skeleton-container">
<SfSkeleton Shape="SkeletonType.Circle" Width="60px" Height="60px" />
<div class="skeleton-text">
<SfSkeleton Shape="SkeletonType.Text" Width="80%" />
<SfSkeleton Shape="SkeletonType.Text" Width="60%" />
</div>
</div>
<style>
.skeleton-container {
display: flex;
gap: 16px;
padding: 16px;
}
.skeleton-text {
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
}
</style>razor
@page "/skeleton-demo"
@using Syncfusion.Blazor.Notifications
<div class="skeleton-container">
<SfSkeleton Shape="SkeletonType.Circle" Width="60px" Height="60px" />
<div class="skeleton-text">
<SfSkeleton Shape="SkeletonType.Text" Width="80%" />
<SfSkeleton Shape="SkeletonType.Text" Width="60%" />
</div>
</div>
<style>
.skeleton-container {
display: flex;
gap: 16px;
padding: 16px;
}
.skeleton-text {
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
}
</style>Documentation and Navigation Guide
文档与导航指南
Toast Component
Toast组件
Getting Started with Toast
Toast入门
📄 Read: references/toast-getting-started.md
- Installation and NuGet package setup
- Service registration in Program.cs
- Basic toast implementation
- Showing and hiding toasts programmatically
- Position configuration basics
- Simple success/error notifications
📄 阅读: references/toast-getting-started.md
- 安装和NuGet包设置
- Program.cs中的服务注册
- 基础Toast实现
- 以编程方式显示和隐藏Toast
- 位置配置基础
- 简单的成功/错误通知
Advanced Toast Features
Toast高级特性
📄 Read: references/toast-features.md
- Position and alignment options (9 predefined positions)
- Animation settings (show/hide with effects and duration)
- Auto-dismiss with timeout and extended timeout
- Progress bar display and direction
- Action buttons with event handlers
- Title and content templates
- Multiple toast management and stacking order
- Event callbacks (OnOpen, OnClose, OnClick, BeforeOpen, BeforeClose)
- RTL (right-to-left) support
- Custom width, height, and CSS styling
- Target container specification
📄 阅读: references/toast-features.md
- 位置和对齐选项(9个预定义位置)
- 动画设置(带效果和时长的显示/隐藏)
- 带超时和延长超时的自动关闭
- 进度条显示和方向
- 带事件处理程序的操作按钮
- 标题和内容模板
- 多个Toast管理和堆叠顺序
- 事件回调(OnOpen、OnClose、OnClick、BeforeOpen、BeforeClose)
- RTL(从右到左)支持
- 自定义宽度、高度和CSS样式
- 目标容器指定
Message Component
Message组件
Message Implementation
Message实现
📄 Read: references/message-implementation.md
- Getting started with Message component
- Severity types (Normal, Info, Success, Warning, Error)
- Variant styles (Text, Outlined, Filled)
- Icon configuration (built-in and custom)
- Close icon and dismissal handling
- Content alignment options
- Visibility control and two-way binding
- Close event handling
- Custom content with ChildContent
- CSS class customization
- Accessibility features
- Integration with forms and validation
📄 阅读: references/message-implementation.md
- Message组件入门
- 严重级别类型(普通、提示、成功、警告、错误)
- 变体样式(文本型、轮廓型、填充型)
- 图标配置(内置和自定义)
- 关闭图标和关闭处理
- 内容对齐选项
- 可见性控制和双向绑定
- 关闭事件处理
- 带ChildContent的自定义内容
- CSS类自定义
- 无障碍特性
- 与表单和验证的集成
Skeleton Component
Skeleton组件
Skeleton Implementation
Skeleton实现
📄 Read: references/skeleton-implementation.md
- Getting started with Skeleton component
- Skeleton shapes (Circle, Square, Rectangle, Text)
- Shimmer effects (Pulse, Wave, Fade, None)
- Width and height configuration
- Visibility toggle for loading states
- Accessibility labels for screen readers
- Multiple skeleton layouts (lists, cards, tables)
- Common loading patterns (profile, article, grid)
- CSS customization and theming
- Performance considerations
📄 阅读: references/skeleton-implementation.md
- Skeleton组件入门
- Skeleton形状(圆形、方形、矩形、文本)
- 微光效果(脉冲、波浪、淡入淡出、无)
- 宽度和高度配置
- 加载状态的可见性切换
- 供屏幕阅读器使用的无障碍标签
- 多个Skeleton布局(列表、卡片、表格)
- 常见加载模式(个人资料、文章、网格)
- CSS自定义和主题设置
- 性能考虑
Styling and Themes
样式与主题
Styling All Notification Components
所有通知组件的样式设置
📄 Read: references/styling-and-themes.md
- Theme integration (Bootstrap, Material, Fluent, Tailwind)
- Custom CSS classes for Toast
- Custom CSS classes for Message
- Custom CSS classes for Skeleton
- Dark mode support for all components
- Responsive design patterns
- Color customization
- Animation customization
- Component-specific styling techniques
📄 阅读: references/styling-and-themes.md
- 主题集成(Bootstrap、Material、Fluent、Tailwind)
- Toast的自定义CSS类
- Message的自定义CSS类
- Skeleton的自定义CSS类
- 所有组件的深色模式支持
- 响应式设计模式
- 颜色自定义
- 动画自定义
- 组件特定的样式技巧
Use Cases and Examples
使用场景与示例
Real-World Implementation Examples
真实场景实现示例
📄 Read: references/use-cases-and-examples.md
- Form submission feedback (Toast + Message)
- E-commerce cart notifications
- Dashboard data updates
- File upload progress and feedback
- User authentication feedback
- Data loading with Skeleton placeholders
- Error handling and recovery
- Multi-step process feedback
- Notification center/history
- Combining all three components effectively
📄 阅读: references/use-cases-and-examples.md
- 表单提交反馈(Toast + Message)
- 电商购物车通知
- 仪表盘数据更新
- 文件上传进度和反馈
- 用户认证反馈
- 带Skeleton占位符的数据加载
- 错误处理与恢复
- 多步骤流程反馈
- 通知中心/历史记录
- 有效组合三个组件
Common Patterns
常见模式
Pattern 1: Success/Error Feedback with Toast
模式1:使用Toast提供成功/错误反馈
razor
@code {
SfToast ToastObj;
private async Task SaveData()
{
try
{
await DataService.SaveAsync();
ToastObj.Title = "Success";
ToastObj.Content = "Data saved successfully!";
await ToastObj.ShowAsync();
}
catch (Exception ex)
{
ToastObj.Title = "Error";
ToastObj.Content = $"Failed to save: {ex.Message}";
await ToastObj.ShowAsync();
}
}
}razor
@code {
SfToast ToastObj;
private async Task SaveData()
{
try
{
await DataService.SaveAsync();
ToastObj.Title = "Success";
ToastObj.Content = "Data saved successfully!";
await ToastObj.ShowAsync();
}
catch (Exception ex)
{
ToastObj.Title = "Error";
ToastObj.Content = $"Failed to save: {ex.Message}";
await ToastObj.ShowAsync();
}
}
}Pattern 2: Form Validation with Message
模式2:使用Message进行表单验证
razor
<EditForm Model="@model" OnValidSubmit="HandleValidSubmit">
<DataAnnotationsValidator />
@if (!string.IsNullOrEmpty(errorMessage))
{
<SfMessage Severity="MessageSeverity.Error"
ShowIcon="true"
ShowCloseIcon="true"
Closed="@(() => errorMessage = null)">
@errorMessage
</SfMessage>
}
<!-- Form fields -->
</EditForm>razor
<EditForm Model="@model" OnValidSubmit="HandleValidSubmit">
<DataAnnotationsValidator />
@if (!string.IsNullOrEmpty(errorMessage))
{
<SfMessage Severity="MessageSeverity.Error"
ShowIcon="true"
ShowCloseIcon="true"
Closed="@(() => errorMessage = null)">
@errorMessage
</SfMessage>
}
<!-- Form fields -->
</EditForm>Pattern 3: Loading State with Skeleton
模式3:使用Skeleton实现加载状态
razor
@if (isLoading)
{
<div class="product-card-skeleton">
<SfSkeleton Shape="SkeletonType.Rectangle" Width="100%" Height="200px" />
<SfSkeleton Shape="SkeletonType.Text" Width="80%" />
<SfSkeleton Shape="SkeletonType.Text" Width="60%" />
</div>
}
else
{
<div class="product-card">
<img src="@product.ImageUrl" alt="@product.Name" />
<h3>@product.Name</h3>
<p>@product.Description</p>
</div>
}razor
@if (isLoading)
{
<div class="product-card-skeleton">
<SfSkeleton Shape="SkeletonType.Rectangle" Width="100%" Height="200px" />
<SfSkeleton Shape="SkeletonType.Text" Width="80%" />
<SfSkeleton Shape="SkeletonType.Text" Width="60%" />
</div>
}
else
{
<div class="product-card">
<img src="@product.ImageUrl" alt="@product.Name" />
<h3>@product.Name</h3>
<p>@product.Description</p>
</div>
}Pattern 4: Multiple Toast Types
模式4:多种类型的Toast
razor
<SfToast @ref="SuccessToast"
Title="Success"
Icon="e-success"
CssClass="e-toast-success"
<ToastPosition X="Right" Y="Top"></ToastPositio
<SfToast @ref="ErrorToast"
Title="Error"
Icon="e-error"
CssClass="e-toast-danger"
<ToastPosition X="Right" Y="Top"></ToastPosition>
<SfToast @ref="WarningToast"
Title="Warning"
Icon="e-warning"
CssClass="e-toast-warning"
<ToastPosition X="Right" Y="Top"></ToastPosition>
@code {
SfToast SuccessToast, ErrorToast, WarningToast;
private async Task ShowSuccess(string message)
{
SuccessToast.Content = message;
await SuccessToast.ShowAsync();
}
private async Task ShowError(string message)
{
ErrorToast.Content = message;
await ErrorToast.ShowAsync();
}
private async Task ShowWarning(string message)
{
WarningToast.Content = message;
await WarningToast.ShowAsync();
}
}razor
<SfToast @ref="SuccessToast"
Title="Success"
Icon="e-success"
CssClass="e-toast-success"
<ToastPosition X="Right" Y="Top"></ToastPosition>
<SfToast @ref="ErrorToast"
Title="Error"
Icon="e-error"
CssClass="e-toast-danger"
<ToastPosition X="Right" Y="Top"></ToastPosition>
<SfToast @ref="WarningToast"
Title="Warning"
Icon="e-warning"
CssClass="e-toast-warning"
<ToastPosition X="Right" Y="Top"></ToastPosition>
@code {
SfToast SuccessToast, ErrorToast, WarningToast;
private async Task ShowSuccess(string message)
{
SuccessToast.Content = message;
await SuccessToast.ShowAsync();
}
private async Task ShowError(string message)
{
ErrorToast.Content = message;
await ErrorToast.ShowAsync();
}
private async Task ShowWarning(string message)
{
WarningToast.Content = message;
await WarningToast.ShowAsync();
}
}Installation
安装
NuGet Package
NuGet包
bash
dotnet add package Syncfusion.Blazor.Notifications
dotnet add package Syncfusion.Blazor.Themesbash
dotnet add package Syncfusion.Blazor.Notifications
dotnet add package Syncfusion.Blazor.ThemesService Registration
服务注册
Program.cs:
csharp
using Syncfusion.Blazor;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSyncfusionBlazor();Program.cs:
csharp
using Syncfusion.Blazor;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSyncfusionBlazor();Namespace Import
命名空间导入
_Imports.razor:
razor
@using Syncfusion.Blazor.Notifications_Imports.razor:
razor
@using Syncfusion.Blazor.NotificationsTheme Reference
主题引用
App.razor or layout file:
html
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>App.razor或布局文件:
html
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>Key Properties Reference
核心属性参考
Toast Properties
Toast属性
| Property | Type | Description |
|---|---|---|
| Content | string | Toast message content |
| Title | string | Toast title text |
| Icon | string | Icon CSS class |
| Position | ToastPosition | X and Y position (Top, Bottom, Left, Right, Center) |
| Timeout | int | Auto-hide duration in milliseconds (default: 5000) |
| ShowCloseButton | bool | Display close button (default: false) |
| ShowProgressBar | bool | Display progress bar (default: false) |
| NewestOnTop | bool | Stack newest toast on top (default: true) |
| CssClass | string | Custom CSS classes |
| 属性 | 类型 | 描述 |
|---|---|---|
| Content | string | Toast消息内容 |
| Title | string | Toast标题文本 |
| Icon | string | 图标CSS类 |
| Position | ToastPosition | X和Y位置(顶部、底部、左侧、右侧、居中) |
| Timeout | int | 自动隐藏时长(毫秒,默认:5000) |
| ShowCloseButton | bool | 显示关闭按钮(默认:false) |
| ShowProgressBar | bool | 显示进度条(默认:false) |
| NewestOnTop | bool | 将最新Toast堆叠在顶部(默认:true) |
| CssClass | string | 自定义CSS类 |
Message Properties
Message属性
| Property | Type | Description |
|---|---|---|
| Severity | MessageSeverity | Normal, Info, Success, Warning, Error |
| Variant | MessageVariant | Text, Outlined, Filled |
| ShowIcon | bool | Display severity icon (default: true) |
| ShowCloseIcon | bool | Display close button (default: false) |
| Visible | bool | Control visibility |
| ContentAlignment | HorizontalAlign | Left, Center, Right alignment |
| CssClass | string | Custom CSS classes |
| 属性 | 类型 | 描述 |
|---|---|---|
| Severity | MessageSeverity | 普通、提示、成功、警告、错误 |
| Variant | MessageVariant | 文本型、轮廓型、填充型 |
| ShowIcon | bool | 显示严重级别图标(默认:true) |
| ShowCloseIcon | bool | 显示关闭按钮(默认:false) |
| Visible | bool | 控制可见性 |
| ContentAlignment | HorizontalAlign | 左、居中、右对齐 |
| CssClass | string | 自定义CSS类 |
Skeleton Properties
Skeleton属性
| Property | Type | Description |
|---|---|---|
| Shape | SkeletonType | Circle, Square, Rectangle, Text |
| Effect | ShimmerEffect | Pulse, Wave, Fade, None |
| Width | string | Width in px, %, or other CSS units |
| Height | string | Height in px, %, or other CSS units |
| Visible | bool | Control visibility |
| Label | string | Accessibility label |
| CssClass | string | Custom CSS classes |
| 属性 | 类型 | 描述 |
|---|---|---|
| Shape | SkeletonType | 圆形、方形、矩形、文本 |
| Effect | ShimmerEffect | 脉冲、波浪、淡入淡出、无 |
| Width | string | 宽度(px、%或其他CSS单位) |
| Height | string | 高度(px、%或其他CSS单位) |
| Visible | bool | 控制可见性 |
| Label | string | 无障碍标签 |
| CssClass | string | 自定义CSS类 |
Common Use Cases
常见使用场景
- Form Submission Feedback - Show success/error toast after form submission
- Validation Messages - Display inline messages for validation errors
- Loading States - Use skeleton during data fetching
- Cart Operations - Toast notifications for add/remove from cart
- File Upload - Progress feedback and completion notification
- API Errors - Display error messages with retry options
- Session Warnings - Show warning message before session expires
- Data Refresh - Skeleton placeholders during refresh operations
- Multi-Step Forms - Progress feedback at each step
- Real-time Updates - Toast notifications for live data changes
- 表单提交反馈 - 表单提交后显示成功/错误Toast
- 验证消息 - 显示内联消息提示验证错误
- 加载状态 - 数据获取期间使用Skeleton
- 购物车操作 - 添加/移除商品时显示Toast通知
- 文件上传 - 进度反馈和完成通知
- API错误 - 显示带重试选项的错误消息
- 会话警告 - 会话过期前显示警告消息
- 数据刷新 - 刷新操作期间使用Skeleton占位符
- 多步骤表单 - 每一步显示进度反馈
- 实时更新 - 实时数据变化时显示Toast通知
Troubleshooting
故障排除
Toast Not Appearing
Toast不显示
- Ensure is called to display the toast
ShowAsync() - Verify toast component has content or template
- Check if toast timeout is too short
- Confirm ToastPosition is within viewport bounds
- 确保调用了来显示Toast
ShowAsync() - 验证Toast组件有内容或模板
- 检查Toast超时是否过短
- 确认ToastPosition在视口范围内
Message Not Visible
Message不可见
- Check property is set to
Visibletrue - Verify message has content in ChildContent or Content property
- Ensure component is rendered in DOM (not hidden by parent)
- Check CSS z-index conflicts
- 检查属性是否设置为
Visibletrue - 验证Message在ChildContent或Content属性中有内容
- 确保组件已渲染到DOM中(未被父元素隐藏)
- 检查CSS z-index冲突
Skeleton Not Animating
Skeleton无动画
- Verify property is set (Pulse, Wave, or Fade)
Effect - Check if shimmer effect CSS is loaded with theme
- Ensure skeleton has defined width and height
- Confirm is set to
Visibletrue
- 验证属性已设置(脉冲、波浪或淡入淡出)
Effect - 检查主题是否加载了微光效果CSS
- 确保Skeleton已定义宽度和高度
- 确认设置为
Visibletrue
Theme Not Applied
主题未应用
- Verify theme CSS is referenced in App.razor or layout
- Check Syncfusion.Blazor.Themes package is installed
- Ensure CSS link is before component usage
- Try clearing browser cache
- 验证主题CSS已在App.razor或布局中引用
- 检查Syncfusion.Blazor.Themes包是否已安装
- 确保CSS链接在组件使用之前
- 尝试清除浏览器缓存
Service Not Registered
服务未注册
- Add in Program.cs
builder.Services.AddSyncfusionBlazor() - Verify Syncfusion.Blazor.Core package is installed
- Ensure using statement is present
- Rebuild project after adding service
- 在Program.cs中添加
builder.Services.AddSyncfusionBlazor() - 验证Syncfusion.Blazor.Core包是否已安装
- 确保存在using语句
- 添加服务后重建项目
Best Practices
最佳实践
- Use appropriate notification type - Toast for temporary, Message for persistent
- Limit toast duration - 3-7 seconds for most messages, longer for errors
- Provide clear actions - Include retry/dismiss buttons where appropriate
- Skeleton resemblance - Make skeleton shapes match actual content structure
- Accessibility - Always provide labels for skeletons and icons
- Position consistency - Use same toast position throughout app
- Message severity - Use correct severity level for message context
- Avoid overuse - Don't overwhelm users with too many notifications
- Progressive enhancement - Use skeleton for perceived performance improvement
- Error handling - Always handle toast/message display errors gracefully
- 使用合适的通知类型 - Toast用于临时通知,Message用于持久化消息
- 限制Toast时长 - 大多数消息设置3-7秒,错误消息可更长
- 提供清晰操作 - 适当情况下包含重试/关闭按钮
- Skeleton与实际内容匹配 - 使Skeleton形状与实际内容结构一致
- 无障碍支持 - 始终为Skeleton和图标提供标签
- 位置一致性 - 整个应用使用相同的Toast位置
- 消息严重级别匹配 - 根据消息上下文使用正确的严重级别
- 避免过度使用 - 不要用过多通知打扰用户
- 渐进式增强 - 使用Skeleton提升感知性能
- 错误处理 - 优雅处理Toast/Message显示错误
Next Steps
下一步
- Explore Toast Advanced Features for animations and templates
- Learn Message Implementation for form validation
- Review Skeleton Patterns for loading states
- Check Styling Guide for customization
- See Real-World Examples for complete scenarios
- 探索Toast高级特性中的动画和模板
- 学习Message实现用于表单验证
- 查看Skeleton模式实现加载状态
- 查阅样式指南进行自定义
- 参考真实场景示例了解完整场景