Implementing Syncfusion Blazor FileUpload
This skill covers the Syncfusion Blazor FileUpload component, a robust solution for file handling in Blazor applications. Learn to implement single and multiple file uploads, configure validation rules, enable drag-drop interactions, handle large files with chunked uploads, and leverage comprehensive events for complete upload control and user feedback.
FileUpload
Learn to implement Syncfusion Blazor File Upload component with async/sync uploads, validation, events, customization, and always get immediate file handling with drag-drop or form integration for web and server applications.
Documentation
Getting Started
📄 Read: references/file-upload-getting-started.md
- Installation and NuGet package setup
- Visual Studio/Visual Studio Code setup steps
- Blazor WebAssembly vs Server configuration
- Basic SfUploader component rendering
- CSS and script imports
- Minimal working example
Core Configuration
📄 Read: references/file-upload-configuration.md
- ID property for component identification
- AllowedExtensions for file type restriction
- AllowMultiple vs single file uploads
- AutoUpload behavior configuration
- SequentialUpload for ordered processing
- DirectoryUpload capability
- Enabled state and component control
Upload Methods & Behavior
📄 Read: references/file-upload-file-upload-methods.md
- Synchronous vs asynchronous uploads
- Save URL and Remove URL configuration
- Upload button click handlers
- Automatic vs manual upload triggering
- Upload progress tracking mechanisms
- Backend API requirements
Events & Handlers
📄 Read: references/file-upload-events-and-handlers.md
- ValueChange event for direct file access (Blazor Server only, without AsyncSettings)
- FileSelected event for pre-validation
- Created event for initialization logic
- OnFileListRender for custom file display
- OnUploadStart, Success, OnFailure events (use with AsyncSettings)
- Event handler patterns and best practices
- Important: ValueChange and UploaderAsyncSettings are mutually exclusive
File Validation
📄 Read: references/file-upload-validation.md
- File type validation strategies
- File size constraints (MinFileSize, MaxFileSize)
- Custom validation functions
- Preventing invalid file uploads
- Error messages and user feedback
- Validation within EditForm
Advanced Features
📄 Read: references/file-upload-advanced-features.md
- Chunked upload for large files
- Pause and resume functionality
- Async/await patterns in event handlers
- MemoryStream processing without disk I/O
- Batch upload operations
- Retry and recovery mechanisms
Customization & Styling
📄 Read: references/file-upload-customization.md
- Custom file list templates
- CSS class customization
- Theme Studio integration
- Custom button styling
- Dark mode support
- Responsive design patterns
File Source Options
📄 Read: references/file-upload-file-source-options.md
- Drag-and-drop upload implementation
- Form integration patterns
- Direct file picker interaction
- Browser file dialog usage
- Directory selection and upload
- Multiple input method combinations
- Accessibility best practices
Localization & Accessibility
📄 Read: references/file-upload-localization-accessibility.md
- Multi-language UI support
- Locale configuration options
- Custom text labels
- WCAG 2.1 compliance
- Keyboard navigation implementation
- Screen reader support
- ARIA attributes
Platform-Specific Setup
📄 Read: references/file-upload-platform-specific-setup.md
- Blazor WebAssembly app setup
- Blazor Server app setup
- Blazor Web App (.NET 8+) setup
- MAUI integration
- Different render modes
- Platform-specific considerations
Quick Start Example
@using Syncfusion.Blazor.Inputs
<SfUploader AutoUpload="true" AllowedExtensions=".jpg,.jpeg,.png,.pdf">
<UploaderAsyncSettings
SaveUrl="api/upload/save"
RemoveUrl="api/upload/remove">
</UploaderAsyncSettings>
</SfUploader>
Common Patterns
Pattern 1: Basic File Upload with Validation (Server Upload)
- Use
AutoUpload="true" for instant uploads
- Configure
UploaderAsyncSettings with SaveUrl/RemoveUrl
- Set
AllowedExtensions to restrict file types
- Listen to
FileSelected event for pre-validation
- Use
Success/OnFailure events for upload feedback
Pattern 2: Direct File Access (Blazor Server Only)
- Use
ValueChange event to access file content directly
- Do NOT use
UploaderAsyncSettings with ValueChange
- Process files in memory or save to directory
- Best for file preview, Base64 conversion, or direct storage
Pattern 3: Multiple File Handling
- Set
AllowMultiple="true" to allow batch uploads
- Use
SequentialUpload for ordered processing
- Track progress with upload events
- Display file list with individual progress indicators
Pattern 4: Large File Upload with Chunking
- Configure
ChunkSize in UploaderAsyncSettings
- Enable pause/resume with chunk upload
- Implement retry logic for failed chunks
- Show chunk-level progress to user
Key Props
| Property |
Default |
Use When |
| AutoUpload |
true |
Upload files immediately after selection |
| AllowMultiple |
true |
User needs to upload multiple files |
| SequentialUpload |
false |
Files must upload one at a time |
| AllowedExtensions |
"" |
Only specific file types allowed |
| DirectoryUpload |
false |
User can select entire folders |
| MaxFileSize |
28.4 MB |
Limiting maximum upload file size |
| MinFileSize |
0 |
Setting minimum file size requirement |
| ChunkSize |
0 (disabled) |
Enable chunked upload for large files |
| ShowFileList |
true |
Control visibility of uploaded file list |
| ShowProgressBar |
true |
Display upload progress indicator |
| Enabled |
true |
Enable or disable the uploader |
| DropArea |
null |
Specify custom drop zone CSS selector |
| CssClass |
"" |
Apply custom CSS classes |
| TabIndex |
0 |
Set tab navigation order |
| EnablePersistence |
false |
Maintain state across page reloads |
| EnableRtl |
false |
Enable right-to-left layout |
Common Use Cases
- Document Upload: Resume, PDF, certification file uploads
- Image Gallery: User profile pictures, photo collections
- Data Import: CSV/Excel file imports for data processing
- Media Library: Video, audio file uploads and management
- Backup Uploads: Database backups, configuration files
- Report Generation: Monthly reports, analytics data
- Invoice Processing: Financial document uploads
- User Attachments: Email attachments, message files
Quick Decision Tree
User needs file upload functionality
├─ Single file only? → Set AllowMultiple="false" + use basic setup
├─ Multiple files?
│ ├─ All at once? → AllowMultiple="true" + SequentialUpload="false"
│ └─ One at a time? → AllowMultiple="true" + SequentialUpload="true"
└─ Large files (>100MB)?
├─ Enable chunking → Set ChunkSize property
└─ Add pause/resume → Listen to Paused and OnResume events
TextArea
Learn to implement Syncfusion Blazor TextArea component for multi-line text input with configurable resize modes, row/column sizing, character limits, floating labels, and comprehensive validation. Perfect for comments, descriptions, messages, and any scenario requiring extended text entry with real-time feedback and form integration.
Documentation
Getting Started
📄 Read: references/textarea-getting-started.md
- Installation and NuGet package setup
- Basic SfTextArea component setup
- Namespace imports and service registration
- CSS theme configuration
- Minimal working example
- Initial component rendering
Configuration Options
📄 Read: references/textarea-configuration.md
- RowCount and ColumnCount for sizing
- ResizeMode (Vertical, Horizontal, Both, None)
- MaxLength property for character limits
- Placeholder text configuration
- FloatLabelType (Auto, Always, Never)
- ReadOnly and Disabled states
- Width property and responsive sizing
- HTML attributes customization
Events and Data Binding
📄 Read: references/textarea-events-binding.md
- Value property and two-way binding (@bind-Value)
- ValueChange event for real-time updates
- Focus and Blur events (TextAreaFocusInEventArgs, TextAreaFocusOutEventArgs)
- Input event for keystroke tracking
- Created and Destroyed lifecycle events
- Form validation integration with EditForm
- ValueExpression for validation binding
Customization and Styling
📄 Read: references/textarea-customization.md
- CssClass for custom styling
- ShowClearButton for quick text removal
- InputAttributes and HtmlAttributes
- Theme customization with Theme Studio
- Responsive design patterns
- Accessibility features (ARIA, keyboard navigation)
- RTL (Right-to-Left) support with EnableRtl
Quick Start Example
@using Syncfusion.Blazor.Inputs
<SfTextArea @bind-Value="@description"
Placeholder="Enter description..."
RowCount="5"
ColumnCount="50"
MaxLength="500"
FloatLabelType="FloatLabelType.Auto">
</SfTextArea>
@code {
private string description = "";
}
Common Patterns
Pattern 1: Basic Multi-Line Input
- Use
RowCount to set visible lines (default: 2)
- Set
Placeholder for user guidance
- Enable
@bind-Value for two-way binding
- Apply
MaxLength for character constraints
Pattern 2: Resizable TextArea with Limits
- Set
ResizeMode="Resize.Both" for user resizing
- Configure
RowCount and ColumnCount for initial size
- Use
MaxLength to prevent excessive input
- Listen to
ValueChange for live character counting
Pattern 3: Form Integration with Validation
- Wrap in
<EditForm> with model binding
- Use
@bind-Value with ValueExpression
- Apply
[Required] or [StringLength] attributes
- Display validation messages with
<ValidationMessage>
- Style invalid state with CSS
Pattern 4: Auto-Growing TextArea
- Set
ResizeMode="Resize.Vertical" for vertical expansion
- Start with minimal
RowCount (e.g., 3)
- Allow user to expand as needed
- Combine with
MaxLength for upper bounds
Key Props
| Property |
Default |
Use When |
| Value |
"" |
Binding textarea content |
| RowCount |
2 |
Setting visible number of rows |
| ColumnCount |
20 |
Setting visible number of columns |
| MaxLength |
null |
Limiting maximum characters |
| ResizeMode |
Resize.Both |
Controlling user resize behavior |
| Placeholder |
"" |
Showing hint text when empty |
| FloatLabelType |
FloatLabelType.Never |
Enabling floating label animation |
| ShowClearButton |
false |
Adding quick clear functionality |
| ReadOnly |
false |
Preventing user edits while showing content |
| Disabled |
false |
Disabling the component entirely |
| Width |
"100%" |
Setting component width |
| CssClass |
"" |
Applying custom CSS classes |
| EnableRtl |
false |
Enabling right-to-left text direction |
Common Use Cases
- Comment Sections: User feedback, review comments, discussion threads
- Form Descriptions: Product descriptions, bio sections, about fields
- Message Composition: Email bodies, chat messages, note-taking
- Code/JSON Input: Configuration files, script input, data entry
- Address Fields: Multi-line address entry with street, city, etc.
- Search Queries: Complex search inputs with multiple criteria
- Customer Support: Ticket descriptions, issue reporting, help requests
- Content Management: Article drafts, blog post editing, documentation
Quick Decision Tree
User needs multi-line text input
├─ Fixed size? → Set ResizeMode="Resize.None" + specific RowCount
├─ User-resizable?
│ ├─ Vertical only? → ResizeMode="Resize.Vertical"
│ ├─ Horizontal only? → ResizeMode="Resize.Horizontal"
│ └─ Both directions? → ResizeMode="Resize.Both"
├─ Character limit needed? → Set MaxLength property
└─ Form validation?
├─ Use within <EditForm>
└─ Add ValueExpression for validation binding
Signature
Learn to implement Syncfusion Blazor Signature component for capturing digital signatures with configurable stroke width, colors, background images, save/load functionality in multiple formats (PNG, JPEG, SVG), and comprehensive event handling. Perfect for e-signatures, document approval workflows, digital consent forms, and any scenario requiring handwritten signature capture with touch and mouse support.
Documentation
Getting Started
📄 Read: references/signature-getting-started.md
- Installation and NuGet package setup
- Basic SfSignature component setup
- Namespace imports and service registration
- CSS theme configuration
- Canvas rendering and initialization
- Touch and mouse input support
- Minimal working example
Drawing Configuration
📄 Read: references/signature-drawing-configuration.md
- MinStrokeWidth and MaxStrokeWidth for pen thickness
- StrokeColor for ink color customization
- BackgroundColor for canvas background
- BackgroundImage for letterhead/watermark
- Velocity property for stroke smoothness
- Drawing behavior and responsiveness
- Pressure sensitivity simulation
Save and Load Signatures
📄 Read: references/signature-save-load.md
- Save() method with format options (PNG, JPEG, SVG)
- SaveWithBackground property configuration
- GetSignature() for Base64 string retrieval
- Load() method for existing signatures
- Clear() method for signature removal
- File format selection and quality settings
- Server integration patterns
- Database storage strategies
Event Handling
📄 Read: references/signature-events.md
- Changed event for stroke tracking
- OnSave event for save operations
- Created event for initialization
- Event argument structure
- Real-time signature validation
- Detecting empty vs filled signatures
- Event-driven workflows
Customization and Styling
📄 Read: references/signature-customization.md
- Disabled and IsReadOnly states
- HtmlAttributes for custom styling
- Canvas size customization
- Theme integration
- Mobile and touch device optimization
- Accessibility considerations
- Responsive design patterns
Quick Start Example
@using Syncfusion.Blazor.Inputs
<div class="signature-container">
<label>Sign below:</label>
<SfSignature @ref="signatureRef"
StrokeColor="#000000"
BackgroundColor="#FFFFFF"
MaxStrokeWidth="2.0"
MinStrokeWidth="0.5">
</SfSignature>
<div class="signature-actions">
<button @onclick="SaveSignature">Save</button>
<button @onclick="ClearSignature">Clear</button>
</div>
</div>
@code {
private SfSignature signatureRef;
private async Task SaveSignature()
{
await signatureRef.SaveAsync(SignatureFileType.Png, "signature.png");
}
private async Task ClearSignature()
{
await signatureRef.ClearAsync();
}
}
Common Patterns
Pattern 1: Basic Signature Capture
- Use default stroke settings for natural handwriting feel
- Set
BackgroundColor="#FFFFFF" for clear canvas
- Provide Clear button for user corrections
- Save as PNG for universal compatibility
- Validate signature is not empty before submission
Pattern 2: Document Signing with Letterhead
- Use
BackgroundImage for company letterhead or form template
- Set
SaveWithBackground="true" to include background in saved file
- Configure
StrokeColor to contrast with background
- Save as PNG or JPEG with background embedded
- Ideal for contracts, agreements, official documents
Pattern 3: Mobile-Optimized Signature
- Increase stroke width for better touch visibility
- Use larger canvas size for thumb-friendly drawing
- Set
IsReadOnly="false" only when signature mode active
- Auto-save on signature completion
- Provide clear visual feedback for touch interactions
Pattern 4: Multi-Signature Forms
- Use multiple SfSignature components for different signatories
- Track completion state per signature field
- Save each signature with unique identifier
- Combine signatures in final document generation
- Validate all required signatures before form submission
Key Props
| Property |
Default |
Use When |
| MinStrokeWidth |
0.5 |
Setting minimum pen thickness |
| MaxStrokeWidth |
2.0 |
Setting maximum pen thickness |
| StrokeColor |
"#000000" |
Changing ink color |
| BackgroundColor |
"#FFFFFF" |
Setting canvas background color |
| BackgroundImage |
null |
Adding letterhead or watermark image |
| Velocity |
0.7 |
Controlling stroke smoothness (0-1) |
| SaveWithBackground |
true |
Including background in saved signature |
| Disabled |
false |
Disabling signature capture entirely |
| IsReadOnly |
false |
Preventing signature changes while showing existing |
| EnablePersistence |
false |
Maintaining signature across page reloads |
| HtmlAttributes |
null |
Adding custom HTML attributes to wrapper |
Common Use Cases
- E-Signature Capture: Digital document signing, contract approval, consent forms
- Financial Services: Loan applications, account opening, transaction authorization
- Healthcare: Patient consent forms, HIPAA agreements, medical records
- Legal Documents: Contracts, NDAs, legal agreements, court documents
- HR Processes: Employment contracts, onboarding documents, policy acknowledgments
- Delivery Confirmation: Package delivery signatures, service completion
- Check-In Systems: Visitor logs, attendance tracking, registration forms
- Educational: Test proctoring, form submissions, parent consent
Quick Decision Tree
User needs signature capture
├─ Basic signature?
│ └─ Use default settings + Save as PNG
├─ Document with letterhead?
│ ├─ Set BackgroundImage property
│ └─ Enable SaveWithBackground="true"
├─ Mobile/touch primary?
│ ├─ Increase MaxStrokeWidth to 3.0+
│ └─ Use larger canvas dimensions
├─ Multiple signers?
│ ├─ Use multiple SfSignature components
│ ├─ Track each signature state separately
│ └─ Save with unique identifiers
└─ Need specific format?
├─ PNG → Universal support, transparency
├─ JPEG → Smaller file size, no transparency
└─ SVG → Vector format, scalable
RangeSlider
Learn to implement Syncfusion Blazor Range Slider component with dual handles for range selection, ticks, tooltips, color ranges, movement limits, and always get immediate two-value selection for price filters, date ranges, temperature zones, or any scenario requiring range input with visual feedback and validation in Blazor applications.
Documentation
Getting Started
📄 Read: references/rangeslider-getting-started.md
- Installation and NuGet package setup
- Basic SfSlider with Type="SliderType.Range"
- Value binding with arrays for dual handles
- CSS imports and theme configuration
- Namespace imports and service registration
- Minimal working example with range selection
Range Configuration
📄 Read: references/rangeslider-range-configuration.md
- Min, Max, and Step properties for range bounds
- Type property (SliderType.Range vs Default)
- Two-way value binding with arrays (@bind-Value)
- Custom non-numeric values with CustomValues
- IsImmediateValue for real-time updates
- Value array structure and data types
Ticks and Tooltip
📄 Read: references/rangeslider-ticks-and-tooltip.md
- SliderTicks component configuration
- LargeStep and SmallStep for interval markers
- Tick placement options (Before, After, Both)
- ShowSmallTicks property for granular display
- Format property for tick label customization
- SliderTooltip component setup
- Tooltip visibility modes (Focus, Hover, Always, Auto)
- Tooltip placement and format customization
- Custom tooltip templates
Color Ranges and Visual Indication
📄 Read: references/rangeslider-color-ranges-visual.md
- SliderColorRanges for visual feedback
- ColorRange components with Start, End, Color
- Multiple color segments for different value zones
- Use cases (temperature zones, price tiers, ratings)
- Color customization and styling
- Accessibility considerations for color choices
Limits and Constraints
📄 Read: references/rangeslider-limits-and-constraints.md
- SliderLimits configuration for movement restrictions
- MinStart, MinEnd, MaxStart, MaxEnd properties
- Enabled property for limit activation
- StartHandleFixed and EndHandleFixed for locked handles
- Restricting handle movement within bounds
- Use cases (booking date ranges, budget constraints)
- Validation patterns with limits
Orientation and Customization
📄 Read: references/rangeslider-orientation-and-customization.md
- Orientation property (Horizontal vs Vertical)
- ShowButtons for increment/decrement controls
- Width property for responsive sizing
- EnableAnimation for smooth transitions
- CssClass for custom styling
- EnableRtl for right-to-left language support
- ReadOnly and Enabled states
- Theme customization with Theme Studio
Events and Data Binding
📄 Read: references/rangeslider-events-and-binding.md
- SliderEvents component configuration
- ValueChange event callback for range updates
- OnChange vs Changed event timing
- Created event for initialization logic
- Rendered event for post-render operations
- OnTooltipChange for dynamic tooltip content
- OnTicksRender for custom tick label rendering
- Form integration with EditForm
- Validation with EditContext and data annotations
Quick Start Example
@using Syncfusion.Blazor.Inputs
<div class="range-slider-container">
<label>Select Price Range: $@priceRange[0] - $@priceRange[1]</label>
<SfSlider @bind-Value="@priceRange"
Type="SliderType.Range"
Min="0"
Max="1000"
Step="10">
<SliderTicks Placement="Placement.After" LargeStep="200" SmallStep="50" ShowSmallTicks="true"></SliderTicks>
<SliderTooltip IsVisible="true" ShowOn="TooltipShowOn.Always" Format="C0"></SliderTooltip>
</SfSlider>
</div>
@code {
private int[] priceRange = new int[] { 200, 800 };
}
Common Patterns
Pattern 1: Basic Range Selection
- Set
Type="SliderType.Range" for dual handles
- Bind value to int[] or double[] array with two elements
- Configure
Min, Max, and Step properties
- Enable tooltip with
IsVisible="true" for user feedback
- Use
ValueChange event to capture range updates
Pattern 2: Range with Visual Color Zones
- Add
SliderColorRanges component
- Define multiple
ColorRange segments (e.g., cold/warm/hot)
- Set colors that provide clear visual distinction
- Use for temperature, ratings, or risk indicators
- Combine with ticks for precise value identification
Pattern 3: Constrained Range Selection
- Use
SliderLimits to restrict handle movement
- Set
MinStart/MaxStart for first handle bounds
- Set
MinEnd/MaxEnd for second handle bounds
- Enable
StartHandleFixed or EndHandleFixed if one handle should be locked
- Ideal for booking systems, budget planning, scheduling
Pattern 4: Custom Value Range Selection
- Use
CustomValues array for non-numeric ranges
- Example: string[] { "XS", "S", "M", "L", "XL", "XXL" }
- Value array uses indices, not actual values
- Display custom labels via tick formatting
- Perfect for size selection, priority levels, skill ratings
Key Props
| Property |
Default |
Use When |
| Type |
SliderType.Default |
Set to SliderType.Range for dual handles |
| Value |
new int[]{} |
Binding range values (must be 2-element array) |
| Min |
0 |
Setting minimum selectable value |
| Max |
100 |
Setting maximum selectable value |
| Step |
1 |
Defining increment/decrement value |
| CustomValues |
null |
Using non-numeric values (sizes, labels) |
| IsImmediateValue |
false |
Getting real-time updates during drag |
| ShowButtons |
false |
Adding increment/decrement buttons |
| Orientation |
SliderOrientation.Horizontal |
Changing to vertical layout |
| Width |
null |
Setting component width |
| EnableAnimation |
true |
Controlling handle animation |
| ReadOnly |
false |
Preventing user interaction while showing value |
| Enabled |
true |
Enabling/disabling the entire component |
Common Use Cases
- E-Commerce Price Filters: Min/max price selection, budget range filtering
- Date Range Pickers: Check-in/check-out dates, event duration, scheduling
- Temperature Control: HVAC systems, oven settings, climate zones
- Age Range Selection: Demographics, target audience, age restrictions
- Time Range Selection: Working hours, availability slots, time windows
- Score/Rating Ranges: Grade filtering, performance metrics, review scores
- Financial Planning: Budget allocation, investment ranges, spending limits
- Resource Allocation: CPU/memory limits, bandwidth throttling, capacity planning
Quick Decision Tree
User needs range selection (two values)
├─ Numeric range?
│ ├─ Set Type="SliderType.Range"
│ ├─ Use int[] or double[] for Value
│ └─ Configure Min, Max, Step
├─ Non-numeric values (sizes, labels)?
│ ├─ Set CustomValues array
│ ├─ Value array contains indices
│ └─ Use tick formatting for labels
├─ Need visual zones?
│ ├─ Add SliderColorRanges component
│ └─ Define multiple ColorRange segments
├─ Restrict movement?
│ ├─ Use SliderLimits component
│ ├─ Set MinStart/MaxStart/MinEnd/MaxEnd
│ └─ Enable StartHandleFixed or EndHandleFixed if needed
├─ Vertical layout needed?
│ └─ Set Orientation="SliderOrientation.Vertical"
└─ Real-time updates during drag?
└─ Set IsImmediateValue="true"
OtpInput
Learn to implement Syncfusion Blazor OtpInput (One-Time Password) component for secure verification code entry with configurable length, input types (number, text, password), styling modes (outlined, underlined, filled), automatic focus management, and comprehensive event handling. Perfect for 2FA authentication, email verification, SMS codes, PIN entry, and any scenario requiring secure multi-digit code input with keyboard navigation and accessibility support.
Documentation
Getting Started
📄 Read: references/otpinput-getting-started.md
- Installation and NuGet package setup
- Basic SfOtpInput component setup
- Namespace imports and service registration
- CSS theme configuration
- Length property for OTP digit count
- Value binding and retrieval
- Minimal working example
Configuration Options
📄 Read: references/otpinput-configuration.md
- Length property for digit count (default: 4)
- Type property (Number, Text, Password)
- Placeholder configuration for empty inputs
- Separator for visual grouping
- AutoFocus for immediate input
- Disabled state management
- ID and HtmlAttributes customization
Styling Modes
📄 Read: references/otpinput-styling-modes.md
- StylingMode options (Outlined, Underlined, Filled)
- TextTransform (None, Lowercase, Uppercase)
- CssClass for custom styling
- Theme customization with Theme Studio
- Responsive design patterns
- Visual states and focus indicators
Events and Data Binding
📄 Read: references/otpinput-events-binding.md
- Value property and two-way binding (@bind-Value)
- ValueChanged event callback (use Value property only, NOT @bind-Value)
- OnInput event with OtpInputEventArgs
- OnFocus and OnBlur events
- Created lifecycle event
- Form validation integration
- Real-time verification patterns
- Auto-submit on completion
Accessibility
📄 Read: references/otpinput-accessibility.md
- AriaLabels array for individual input fields
- Keyboard navigation (arrows, backspace, delete)
- Screen reader support
- WCAG 2.1 compliance
- Focus management best practices
- Password type accessibility considerations
- Mobile device optimization
Quick Start Example
@using Syncfusion.Blazor.Inputs
<div class="otp-container">
<label>Enter verification code:</label>
<SfOtpInput @bind-Value="@otpValue"
Length="6"
Type="OtpInputType.Number"
StylingMode="OtpInputStyle.Outlined">
</SfOtpInput>
@if (!string.IsNullOrEmpty(message))
{
<div class="message">@message</div>
}
</div>
@code {
private string otpValue = "";
private string message = "";
protected override void OnParametersSet()
{
if (otpValue.Length == 6)
{
message = "Verifying code...";
// Call verification API
}
}
}
Common Patterns
Pattern 1: Basic OTP Verification (6-digit numeric)
- Set
Length="6" for standard OTP length
- Use
Type="OtpInputType.Number" for numeric-only input
- Enable
AutoFocus="true" for immediate input
- Use
@bind-Value for two-way binding (simplest approach)
- Validate and verify OTP on server
Pattern 2: Email/SMS Verification Code
- Configure
Length="4" or Length="6" based on service
- Use
Type="OtpInputType.Number" for numeric codes
- Set
StylingMode="OtpInputStyle.Underlined" for clean look
- Auto-focus first input on page load
- Show countdown timer for code expiration
- Provide "Resend code" functionality
Pattern 3: Secure PIN Entry
- Use
Type="OtpInputType.Password" to mask input
- Set
Length="4" or Length="6" for PIN length
- Apply
StylingMode="OtpInputStyle.Filled" for modern look
- Implement rate limiting for security
- Clear input on failed attempts
- Show visual feedback for validation
Pattern 4: Alphanumeric Verification (with separators)
- Set
Type="OtpInputType.Text" for letters and numbers
- Use
TextTransform="TextTransform.Uppercase" for readability
- Configure
Separator="-" to visually group digits
- Example: ABC-123-XYZ pattern
- Set
Length="9" (including separator positions)
- Useful for activation codes, license keys
Key Props
| Property |
Default |
Use When |
| Value |
"" |
Binding OTP value (two-way with @bind-Value) |
| Length |
4 |
Setting number of OTP input fields |
| Type |
OtpInputType.Number |
Defining input type (Number, Text, Password) |
| StylingMode |
OtpInputStyle.Outlined |
Choosing visual style (Outlined, Underlined, Filled) |
| Placeholder |
"" |
Showing hint text in empty fields |
| Separator |
"" |
Adding visual separator between groups |
| TextTransform |
TextTransform.None |
Transforming text (None, Lowercase, Uppercase) |
| AutoFocus |
false |
Auto-focusing first input on load |
| Disabled |
false |
Disabling all input fields |
| CssClass |
"" |
Applying custom CSS classes |
| AriaLabels |
null |
Setting custom ARIA labels for each input |
| HtmlAttributes |
null |
Adding custom HTML attributes |
Common Use Cases
- Two-Factor Authentication (2FA): Login security, account verification, multi-factor authentication
- Email Verification: Account activation, email confirmation, newsletter signup
- SMS Verification: Phone number verification, mobile app login, transaction confirmation
- Password Reset: Secure password recovery, account access restoration
- Transaction Verification: Banking transactions, payment confirmation, fund transfers
- Access Control: Building entry codes, secure area access, temporary access codes
- Device Pairing: Bluetooth pairing codes, smart device setup, IoT device linking
- Activation Codes: Software licenses, product activation, subscription validation
Quick Decision Tree
User needs OTP/verification code input
├─ Numeric only?
│ ├─ Set Type="OtpInputType.Number"
│ └─ Use Length="4" or Length="6"
├─ Need to hide input (PIN)?
│ ├─ Set Type="OtpInputType.Password"
│ └─ Apply security best practices
├─ Alphanumeric codes?
│ ├─ Set Type="OtpInputType.Text"
│ ├─ Use TextTransform="TextTransform.Uppercase"
│ └─ Consider Separator for readability
├─ Auto-submit when complete?
│ ├─ Listen to ValueChanged event
│ ├─ Check if value.Length == Length
│ └─ Call verification API automatically
├─ Custom styling needed?
│ ├─ Outlined → StylingMode="OtpInputStyle.Outlined" (default)
│ ├─ Underlined → StylingMode="OtpInputStyle.Underlined"
│ └─ Filled → StylingMode="OtpInputStyle.Filled"
└─ Accessibility important?
├─ Set AriaLabels array for screen readers
└─ Enable AutoFocus for keyboard users
Rating
Learn to implement Syncfusion Blazor Rating component for intuitive rating and feedback collection with configurable precision modes (full, half, quarter, exact), custom icons and templates, label and tooltip support, comprehensive event handling, and accessibility features. Perfect for product reviews, skill assessments, satisfaction surveys, quality ratings, and any scenario requiring user feedback through star ratings or custom iconography with keyboard navigation and form integration.
Documentation
Getting Started
📄 Read: references/rating-getting-started.md
- Installation and NuGet package setup
- Basic SfRating component setup
- Namespace imports and service registration
- CSS theme configuration
- ItemsCount property for rating scale
- Value binding and retrieval
- Minimal working example
- Basic 5-star rating implementation
Precision and Values
📄 Read: references/rating-precision-and-values.md
- Precision property (Full, Half, Quarter, Exact)
- Full precision for whole numbers only
- Half precision for 0.5 increments
- Quarter precision for 0.25 increments
- Exact precision for decimal values
- Min property for minimum rating value
- AllowReset for clearing ratings
- EnableSingleSelection for single-item mode
- Value calculations and display
Labels and Tooltips
📄 Read: references/rating-labels-and-tooltips.md
- ShowLabel property for label display
- LabelPosition (Top, Bottom, Left, Right)
- LabelTemplate for custom label formatting
- ShowTooltip property for hover tooltips
- TooltipTemplate for custom tooltip content
- Dynamic label updates based on value
- Contextual feedback patterns
Templates and Customization
📄 Read: references/rating-templates-customization.md
- EmptyTemplate for unselected items
- FullTemplate for selected items
- RatingItemContext for template data
- Custom icon implementation (hearts, thumbs, emojis)
- SVG and icon font integration
- CssClass for custom styling
- EnableAnimation property
- Theme customization and responsive design
Events and States
📄 Read: references/rating-events-and-states.md
- ValueChanged event for rating updates
- OnItemHover event with RatingHoverEventArgs
- Created lifecycle event
- Form validation integration
- ReadOnly state for display-only ratings
- Disabled state management
- Visible property control
- Keyboard navigation support
- Accessibility features and ARIA attributes
Quick Start Example
@using Syncfusion.Blazor.Inputs
<div class="rating-container">
<label>Rate your experience:</label>
<SfRating @bind-Value="@userRating"
ItemsCount="5"
Precision="PrecisionType.Full"
ShowLabel="true">
</SfRating>
@if (userRating > 0)
{
<p>You rated: @userRating / 5 stars</p>
}
</div>
@code {
private double userRating = 0;
}
Common Patterns
Pattern 1: Basic 5-Star Product Rating
- Use default
ItemsCount="5" for standard rating
- Set
Precision="PrecisionType.Full" for whole stars only
- Enable
@bind-Value for two-way data binding
- Show
ShowLabel="true" to display rating value
- Position label with
LabelPosition="LabelPosition.Right"
- Use
ValueChanged event for auto-submit
Pattern 2: Half-Star Rating with Hover Feedback
- Set
Precision="PrecisionType.Half" for 0.5 increments
- Enable
ShowTooltip="true" for hover feedback
- Use
OnItemHover event for preview
- Display average ratings with
ReadOnly="true"
- Show rating count in custom label template
- Implement real-time feedback messages
Pattern 3: Custom Icon Templates (Hearts, Thumbs, Emojis)
- Define
EmptyTemplate for unselected state
- Define
FullTemplate for selected state
- Use
RatingItemContext for item-specific rendering
- Implement custom icons (♥, 👍, 😊, etc.)
- Apply
CssClass for custom colors and sizing
- Enable
EnableAnimation="true" for smooth transitions
Pattern 4: Multi-Category Rating Form
- Create multiple
SfRating components
- Different
ItemsCount per category if needed
- Combine with
EditForm for validation
- Calculate overall rating average
- Track completion with event handlers
- Enable submit only when all ratings complete
Key Props
| Property |
Default |
Use When |
| Value |
0 |
Binding rating value (two-way with @bind-Value) |
| ItemsCount |
5 |
Setting number of rating items (stars) |
| Precision |
PrecisionType.Full |
Defining rating granularity (Full, Half, Quarter, Exact) |
| ShowLabel |
false |
Displaying rating value as text |
| LabelPosition |
LabelPosition.Right |
Positioning label (Top, Bottom, Left, Right) |
| ShowTooltip |
false |
Enabling hover tooltips |
| AllowReset |
true |
Allowing users to clear their rating |
| EnableSingleSelection |
false |
Single item selection mode (thumbs up/down) |
| Min |
null |
Setting minimum rating value |
| ReadOnly |
false |
Display-only mode for showing ratings |
| Disabled |
false |
Disabling all interactions |
| EnableAnimation |
true |
Enabling smooth transitions |
| Visible |
true |
Controlling component visibility |
| EmptyTemplate |
null |
Custom template for unselected items |
| FullTemplate |
null |
Custom template for selected items |
| LabelTemplate |
null |
Custom label content |
| TooltipTemplate |
null |
Custom tooltip content |
| CssClass |
"" |
Applying custom CSS classes |
Common Use Cases
- Product Reviews: E-commerce ratings, marketplace feedback, customer reviews, product quality assessment
- Service Quality: Restaurant ratings, hotel reviews, delivery service feedback, support
…(truncated)
1---
2name: syncfusion-blazor-inputs
3description: Implement Syncfusion Blazor Input components including FileUpload, TextBox, NumericTextBox, TextArea, Signature, RangeSlider, OtpInput, Rating, InputMask, and ColorPicker. Use this when working with file uploads, text entry, numeric values, multi-line text inputs, signatures, ratings, or color selection. This skill covers input validation, events, data binding, and advanced customization options for all input-related components in Blazor applications.
4metadata:
5 author: "Syncfusion Inc"
6 version: "34.1.29"
7 category: "Inputs"
8---
9
10# Implementing Syncfusion Blazor FileUpload
11
12This skill covers the Syncfusion Blazor FileUpload component, a robust solution for file handling in Blazor applications. Learn to implement single and multiple file uploads, configure validation rules, enable drag-drop interactions, handle large files with chunked uploads, and leverage comprehensive events for complete upload control and user feedback.
13
14---
15
16## FileUpload
17
18Learn to implement Syncfusion Blazor File Upload component with async/sync uploads, validation, events, customization, and always get immediate file handling with drag-drop or form integration for web and server applications.
19
20### Documentation
21
22#### Getting Started
23📄 **Read:** [references/file-upload-getting-started.md](references/file-upload-getting-started.md)
24- Installation and NuGet package setup
25- Visual Studio/Visual Studio Code setup steps
26- Blazor WebAssembly vs Server configuration
27- Basic SfUploader component rendering
28- CSS and script imports
29- Minimal working example
30
31#### Core Configuration
32📄 **Read:** [references/file-upload-configuration.md](references/file-upload-configuration.md)
33- ID property for component identification
34- AllowedExtensions for file type restriction
35- AllowMultiple vs single file uploads
36- AutoUpload behavior configuration
37- SequentialUpload for ordered processing
38- DirectoryUpload capability
39- Enabled state and component control
40
41#### Upload Methods & Behavior
42📄 **Read:** [references/file-upload-file-upload-methods.md](references/file-upload-file-upload-methods.md)
43- Synchronous vs asynchronous uploads
44- Save URL and Remove URL configuration
45- Upload button click handlers
46- Automatic vs manual upload triggering
47- Upload progress tracking mechanisms
48- Backend API requirements
49
50#### Events & Handlers
51📄 **Read:** [references/file-upload-events-and-handlers.md](references/file-upload-events-and-handlers.md)
52- ValueChange event for direct file access (Blazor Server only, without AsyncSettings)
53- FileSelected event for pre-validation
54- Created event for initialization logic
55- OnFileListRender for custom file display
56- OnUploadStart, Success, OnFailure events (use with AsyncSettings)
57- Event handler patterns and best practices
58- **Important:** ValueChange and UploaderAsyncSettings are mutually exclusive
59
60#### File Validation
61📄 **Read:** [references/file-upload-validation.md](references/file-upload-validation.md)
62- File type validation strategies
63- File size constraints (MinFileSize, MaxFileSize)
64- Custom validation functions
65- Preventing invalid file uploads
66- Error messages and user feedback
67- Validation within EditForm
68
69#### Advanced Features
70📄 **Read:** [references/file-upload-advanced-features.md](references/file-upload-advanced-features.md)
71- Chunked upload for large files
72- Pause and resume functionality
73- Async/await patterns in event handlers
74- MemoryStream processing without disk I/O
75- Batch upload operations
76- Retry and recovery mechanisms
77
78#### Customization & Styling
79📄 **Read:** [references/file-upload-customization.md](references/file-upload-customization.md)
80- Custom file list templates
81- CSS class customization
82- Theme Studio integration
83- Custom button styling
84- Dark mode support
85- Responsive design patterns
86
87#### File Source Options
88📄 **Read:** [references/file-upload-file-source-options.md](references/file-upload-file-source-options.md)
89- Drag-and-drop upload implementation
90- Form integration patterns
91- Direct file picker interaction
92- Browser file dialog usage
93- Directory selection and upload
94- Multiple input method combinations
95- Accessibility best practices
96
97#### Localization & Accessibility
98📄 **Read:** [references/file-upload-localization-accessibility.md](references/file-upload-localization-accessibility.md)
99- Multi-language UI support
100- Locale configuration options
101- Custom text labels
102- WCAG 2.1 compliance
103- Keyboard navigation implementation
104- Screen reader support
105- ARIA attributes
106
107#### Platform-Specific Setup
108📄 **Read:** [references/file-upload-platform-specific-setup.md](references/file-upload-platform-specific-setup.md)
109- Blazor WebAssembly app setup
110- Blazor Server app setup
111- Blazor Web App (.NET 8+) setup
112- MAUI integration
113- Different render modes
114- Platform-specific considerations
115
116### Quick Start Example
117
118```razor
119@using Syncfusion.Blazor.Inputs
120
121<SfUploader AutoUpload="true" AllowedExtensions=".jpg,.jpeg,.png,.pdf">
122 <UploaderAsyncSettings
123 SaveUrl="api/upload/save"
124 RemoveUrl="api/upload/remove">
125 </UploaderAsyncSettings>
126</SfUploader>
127```
128
129### Common Patterns
130
131#### Pattern 1: Basic File Upload with Validation (Server Upload)
132- Use `AutoUpload="true"` for instant uploads
133- Configure `UploaderAsyncSettings` with SaveUrl/RemoveUrl
134- Set `AllowedExtensions` to restrict file types
135- Listen to `FileSelected` event for pre-validation
136- Use `Success`/`OnFailure` events for upload feedback
137
138#### Pattern 2: Direct File Access (Blazor Server Only)
139- Use `ValueChange` event to access file content directly
140- **Do NOT use** `UploaderAsyncSettings` with ValueChange
141- Process files in memory or save to directory
142- Best for file preview, Base64 conversion, or direct storage
143
144#### Pattern 3: Multiple File Handling
145- Set `AllowMultiple="true"` to allow batch uploads
146- Use `SequentialUpload` for ordered processing
147- Track progress with upload events
148- Display file list with individual progress indicators
149
150#### Pattern 4: Large File Upload with Chunking
151- Configure `ChunkSize` in `UploaderAsyncSettings`
152- Enable pause/resume with chunk upload
153- Implement retry logic for failed chunks
154- Show chunk-level progress to user
155
156### Key Props
157
158| Property | Default | Use When |
159|----------|---------|----------|
160| AutoUpload | true | Upload files immediately after selection |
161| AllowMultiple | true | User needs to upload multiple files |
162| SequentialUpload | false | Files must upload one at a time |
163| AllowedExtensions | "" | Only specific file types allowed |
164| DirectoryUpload | false | User can select entire folders |
165| MaxFileSize | 28.4 MB | Limiting maximum upload file size |
166| MinFileSize | 0 | Setting minimum file size requirement |
167| ChunkSize | 0 (disabled) | Enable chunked upload for large files |
168| ShowFileList | true | Control visibility of uploaded file list |
169| ShowProgressBar | true | Display upload progress indicator |
170| Enabled | true | Enable or disable the uploader |
171| DropArea | null | Specify custom drop zone CSS selector |
172| CssClass | "" | Apply custom CSS classes |
173| TabIndex | 0 | Set tab navigation order |
174| EnablePersistence | false | Maintain state across page reloads |
175| EnableRtl | false | Enable right-to-left layout |
176
177
178### Common Use Cases
179
1801. **Document Upload**: Resume, PDF, certification file uploads
1812. **Image Gallery**: User profile pictures, photo collections
1823. **Data Import**: CSV/Excel file imports for data processing
1834. **Media Library**: Video, audio file uploads and management
1845. **Backup Uploads**: Database backups, configuration files
1856. **Report Generation**: Monthly reports, analytics data
1867. **Invoice Processing**: Financial document uploads
1878. **User Attachments**: Email attachments, message files
188
189### Quick Decision Tree
190
191**User needs file upload functionality**
192 ├─ Single file only? → Set `AllowMultiple="false"` + use basic setup
193 ├─ Multiple files?
194 │ ├─ All at once? → `AllowMultiple="true"` + `SequentialUpload="false"`
195 │ └─ One at a time? → `AllowMultiple="true"` + `SequentialUpload="true"`
196 └─ Large files (>100MB)?
197 ├─ Enable chunking → Set `ChunkSize` property
198 └─ Add pause/resume → Listen to `Paused` and `OnResume` events
199
200---
201
202## TextArea
203
204Learn to implement Syncfusion Blazor TextArea component for multi-line text input with configurable resize modes, row/column sizing, character limits, floating labels, and comprehensive validation. Perfect for comments, descriptions, messages, and any scenario requiring extended text entry with real-time feedback and form integration.
205
206### Documentation
207
208#### Getting Started
209📄 **Read:** [references/textarea-getting-started.md](references/textarea-getting-started.md)
210- Installation and NuGet package setup
211- Basic SfTextArea component setup
212- Namespace imports and service registration
213- CSS theme configuration
214- Minimal working example
215- Initial component rendering
216
217#### Configuration Options
218📄 **Read:** [references/textarea-configuration.md](references/textarea-configuration.md)
219- RowCount and ColumnCount for sizing
220- ResizeMode (Vertical, Horizontal, Both, None)
221- MaxLength property for character limits
222- Placeholder text configuration
223- FloatLabelType (Auto, Always, Never)
224- ReadOnly and Disabled states
225- Width property and responsive sizing
226- HTML attributes customization
227
228#### Events and Data Binding
229📄 **Read:** [references/textarea-events-binding.md](references/textarea-events-binding.md)
230- Value property and two-way binding (@bind-Value)
231- ValueChange event for real-time updates
232- Focus and Blur events (TextAreaFocusInEventArgs, TextAreaFocusOutEventArgs)
233- Input event for keystroke tracking
234- Created and Destroyed lifecycle events
235- Form validation integration with EditForm
236- ValueExpression for validation binding
237
238#### Customization and Styling
239📄 **Read:** [references/textarea-customization.md](references/textarea-customization.md)
240- CssClass for custom styling
241- ShowClearButton for quick text removal
242- InputAttributes and HtmlAttributes
243- Theme customization with Theme Studio
244- Responsive design patterns
245- Accessibility features (ARIA, keyboard navigation)
246- RTL (Right-to-Left) support with EnableRtl
247
248### Quick Start Example
249
250```razor
251@using Syncfusion.Blazor.Inputs
252
253<SfTextArea @bind-Value="@description"
254 Placeholder="Enter description..."
255 RowCount="5"
256 ColumnCount="50"
257 MaxLength="500"
258 FloatLabelType="FloatLabelType.Auto">
259</SfTextArea>
260
261@code {
262 private string description = "";
263}
264```
265
266### Common Patterns
267
268#### Pattern 1: Basic Multi-Line Input
269- Use `RowCount` to set visible lines (default: 2)
270- Set `Placeholder` for user guidance
271- Enable `@bind-Value` for two-way binding
272- Apply `MaxLength` for character constraints
273
274#### Pattern 2: Resizable TextArea with Limits
275- Set `ResizeMode="Resize.Both"` for user resizing
276- Configure `RowCount` and `ColumnCount` for initial size
277- Use `MaxLength` to prevent excessive input
278- Listen to `ValueChange` for live character counting
279
280#### Pattern 3: Form Integration with Validation
281- Wrap in `<EditForm>` with model binding
282- Use `@bind-Value` with `ValueExpression`
283- Apply `[Required]` or `[StringLength]` attributes
284- Display validation messages with `<ValidationMessage>`
285- Style invalid state with CSS
286
287#### Pattern 4: Auto-Growing TextArea
288- Set `ResizeMode="Resize.Vertical"` for vertical expansion
289- Start with minimal `RowCount` (e.g., 3)
290- Allow user to expand as needed
291- Combine with `MaxLength` for upper bounds
292
293### Key Props
294
295| Property | Default | Use When |
296|----------|---------|----------|
297| Value | "" | Binding textarea content |
298| RowCount | 2 | Setting visible number of rows |
299| ColumnCount | 20 | Setting visible number of columns |
300| MaxLength | null | Limiting maximum characters |
301| ResizeMode | Resize.Both | Controlling user resize behavior |
302| Placeholder | "" | Showing hint text when empty |
303| FloatLabelType | FloatLabelType.Never | Enabling floating label animation |
304| ShowClearButton | false | Adding quick clear functionality |
305| ReadOnly | false | Preventing user edits while showing content |
306| Disabled | false | Disabling the component entirely |
307| Width | "100%" | Setting component width |
308| CssClass | "" | Applying custom CSS classes |
309| EnableRtl | false | Enabling right-to-left text direction |
310
311### Common Use Cases
312
3131. **Comment Sections**: User feedback, review comments, discussion threads
3142. **Form Descriptions**: Product descriptions, bio sections, about fields
3153. **Message Composition**: Email bodies, chat messages, note-taking
3164. **Code/JSON Input**: Configuration files, script input, data entry
3175. **Address Fields**: Multi-line address entry with street, city, etc.
3186. **Search Queries**: Complex search inputs with multiple criteria
3197. **Customer Support**: Ticket descriptions, issue reporting, help requests
3208. **Content Management**: Article drafts, blog post editing, documentation
321
322### Quick Decision Tree
323
324**User needs multi-line text input**
325 ├─ Fixed size? → Set `ResizeMode="Resize.None"` + specific `RowCount`
326 ├─ User-resizable?
327 │ ├─ Vertical only? → `ResizeMode="Resize.Vertical"`
328 │ ├─ Horizontal only? → `ResizeMode="Resize.Horizontal"`
329 │ └─ Both directions? → `ResizeMode="Resize.Both"`
330 ├─ Character limit needed? → Set `MaxLength` property
331 └─ Form validation?
332 ├─ Use within `<EditForm>`
333 └─ Add `ValueExpression` for validation binding
334
335---
336
337## Signature
338
339Learn to implement Syncfusion Blazor Signature component for capturing digital signatures with configurable stroke width, colors, background images, save/load functionality in multiple formats (PNG, JPEG, SVG), and comprehensive event handling. Perfect for e-signatures, document approval workflows, digital consent forms, and any scenario requiring handwritten signature capture with touch and mouse support.
340
341### Documentation
342
343#### Getting Started
344📄 **Read:** [references/signature-getting-started.md](references/signature-getting-started.md)
345- Installation and NuGet package setup
346- Basic SfSignature component setup
347- Namespace imports and service registration
348- CSS theme configuration
349- Canvas rendering and initialization
350- Touch and mouse input support
351- Minimal working example
352
353#### Drawing Configuration
354📄 **Read:** [references/signature-drawing-configuration.md](references/signature-drawing-configuration.md)
355- MinStrokeWidth and MaxStrokeWidth for pen thickness
356- StrokeColor for ink color customization
357- BackgroundColor for canvas background
358- BackgroundImage for letterhead/watermark
359- Velocity property for stroke smoothness
360- Drawing behavior and responsiveness
361- Pressure sensitivity simulation
362
363#### Save and Load Signatures
364📄 **Read:** [references/signature-save-load.md](references/signature-save-load.md)
365- Save() method with format options (PNG, JPEG, SVG)
366- SaveWithBackground property configuration
367- GetSignature() for Base64 string retrieval
368- Load() method for existing signatures
369- Clear() method for signature removal
370- File format selection and quality settings
371- Server integration patterns
372- Database storage strategies
373
374#### Event Handling
375📄 **Read:** [references/signature-events.md](references/signature-events.md)
376- Changed event for stroke tracking
377- OnSave event for save operations
378- Created event for initialization
379- Event argument structure
380- Real-time signature validation
381- Detecting empty vs filled signatures
382- Event-driven workflows
383
384#### Customization and Styling
385📄 **Read:** [references/signature-customization.md](references/signature-customization.md)
386- Disabled and IsReadOnly states
387- HtmlAttributes for custom styling
388- Canvas size customization
389- Theme integration
390- Mobile and touch device optimization
391- Accessibility considerations
392- Responsive design patterns
393
394### Quick Start Example
395
396```razor
397@using Syncfusion.Blazor.Inputs
398
399<div class="signature-container">
400 <label>Sign below:</label>
401 <SfSignature @ref="signatureRef"
402 StrokeColor="#000000"
403 BackgroundColor="#FFFFFF"
404 MaxStrokeWidth="2.0"
405 MinStrokeWidth="0.5">
406 </SfSignature>
407
408 <div class="signature-actions">
409 <button @onclick="SaveSignature">Save</button>
410 <button @onclick="ClearSignature">Clear</button>
411 </div>
412</div>
413
414@code {
415 private SfSignature signatureRef;
416
417 private async Task SaveSignature()
418 {
419 await signatureRef.SaveAsync(SignatureFileType.Png, "signature.png");
420 }
421
422 private async Task ClearSignature()
423 {
424 await signatureRef.ClearAsync();
425 }
426}
427```
428
429### Common Patterns
430
431#### Pattern 1: Basic Signature Capture
432- Use default stroke settings for natural handwriting feel
433- Set `BackgroundColor="#FFFFFF"` for clear canvas
434- Provide Clear button for user corrections
435- Save as PNG for universal compatibility
436- Validate signature is not empty before submission
437
438#### Pattern 2: Document Signing with Letterhead
439- Use `BackgroundImage` for company letterhead or form template
440- Set `SaveWithBackground="true"` to include background in saved file
441- Configure `StrokeColor` to contrast with background
442- Save as PNG or JPEG with background embedded
443- Ideal for contracts, agreements, official documents
444
445#### Pattern 3: Mobile-Optimized Signature
446- Increase stroke width for better touch visibility
447- Use larger canvas size for thumb-friendly drawing
448- Set `IsReadOnly="false"` only when signature mode active
449- Auto-save on signature completion
450- Provide clear visual feedback for touch interactions
451
452#### Pattern 4: Multi-Signature Forms
453- Use multiple SfSignature components for different signatories
454- Track completion state per signature field
455- Save each signature with unique identifier
456- Combine signatures in final document generation
457- Validate all required signatures before form submission
458
459### Key Props
460
461| Property | Default | Use When |
462|----------|---------|----------|
463| MinStrokeWidth | 0.5 | Setting minimum pen thickness |
464| MaxStrokeWidth | 2.0 | Setting maximum pen thickness |
465| StrokeColor | "#000000" | Changing ink color |
466| BackgroundColor | "#FFFFFF" | Setting canvas background color |
467| BackgroundImage | null | Adding letterhead or watermark image |
468| Velocity | 0.7 | Controlling stroke smoothness (0-1) |
469| SaveWithBackground | true | Including background in saved signature |
470| Disabled | false | Disabling signature capture entirely |
471| IsReadOnly | false | Preventing signature changes while showing existing |
472| EnablePersistence | false | Maintaining signature across page reloads |
473| HtmlAttributes | null | Adding custom HTML attributes to wrapper |
474
475### Common Use Cases
476
4771. **E-Signature Capture**: Digital document signing, contract approval, consent forms
4782. **Financial Services**: Loan applications, account opening, transaction authorization
4793. **Healthcare**: Patient consent forms, HIPAA agreements, medical records
4804. **Legal Documents**: Contracts, NDAs, legal agreements, court documents
4815. **HR Processes**: Employment contracts, onboarding documents, policy acknowledgments
4826. **Delivery Confirmation**: Package delivery signatures, service completion
4837. **Check-In Systems**: Visitor logs, attendance tracking, registration forms
4848. **Educational**: Test proctoring, form submissions, parent consent
485
486### Quick Decision Tree
487
488**User needs signature capture**
489 ├─ Basic signature?
490 │ └─ Use default settings + Save as PNG
491 ├─ Document with letterhead?
492 │ ├─ Set `BackgroundImage` property
493 │ └─ Enable `SaveWithBackground="true"`
494 ├─ Mobile/touch primary?
495 │ ├─ Increase `MaxStrokeWidth` to 3.0+
496 │ └─ Use larger canvas dimensions
497 ├─ Multiple signers?
498 │ ├─ Use multiple SfSignature components
499 │ ├─ Track each signature state separately
500 │ └─ Save with unique identifiers
501 └─ Need specific format?
502 ├─ PNG → Universal support, transparency
503 ├─ JPEG → Smaller file size, no transparency
504 └─ SVG → Vector format, scalable
505
506---
507
508## RangeSlider
509
510Learn to implement Syncfusion Blazor Range Slider component with dual handles for range selection, ticks, tooltips, color ranges, movement limits, and always get immediate two-value selection for price filters, date ranges, temperature zones, or any scenario requiring range input with visual feedback and validation in Blazor applications.
511
512### Documentation
513
514#### Getting Started
515📄 **Read:** [references/rangeslider-getting-started.md](references/rangeslider-getting-started.md)
516- Installation and NuGet package setup
517- Basic SfSlider with Type="SliderType.Range"
518- Value binding with arrays for dual handles
519- CSS imports and theme configuration
520- Namespace imports and service registration
521- Minimal working example with range selection
522
523#### Range Configuration
524📄 **Read:** [references/rangeslider-range-configuration.md](references/rangeslider-range-configuration.md)
525- Min, Max, and Step properties for range bounds
526- Type property (SliderType.Range vs Default)
527- Two-way value binding with arrays (@bind-Value)
528- Custom non-numeric values with CustomValues
529- IsImmediateValue for real-time updates
530- Value array structure and data types
531
532#### Ticks and Tooltip
533📄 **Read:** [references/rangeslider-ticks-and-tooltip.md](references/rangeslider-ticks-and-tooltip.md)
534- SliderTicks component configuration
535- LargeStep and SmallStep for interval markers
536- Tick placement options (Before, After, Both)
537- ShowSmallTicks property for granular display
538- Format property for tick label customization
539- SliderTooltip component setup
540- Tooltip visibility modes (Focus, Hover, Always, Auto)
541- Tooltip placement and format customization
542- Custom tooltip templates
543
544#### Color Ranges and Visual Indication
545📄 **Read:** [references/rangeslider-color-ranges-visual.md](references/rangeslider-color-ranges-visual.md)
546- SliderColorRanges for visual feedback
547- ColorRange components with Start, End, Color
548- Multiple color segments for different value zones
549- Use cases (temperature zones, price tiers, ratings)
550- Color customization and styling
551- Accessibility considerations for color choices
552
553#### Limits and Constraints
554📄 **Read:** [references/rangeslider-limits-and-constraints.md](references/rangeslider-limits-and-constraints.md)
555- SliderLimits configuration for movement restrictions
556- MinStart, MinEnd, MaxStart, MaxEnd properties
557- Enabled property for limit activation
558- StartHandleFixed and EndHandleFixed for locked handles
559- Restricting handle movement within bounds
560- Use cases (booking date ranges, budget constraints)
561- Validation patterns with limits
562
563#### Orientation and Customization
564📄 **Read:** [references/rangeslider-orientation-and-customization.md](references/rangeslider-orientation-and-customization.md)
565- Orientation property (Horizontal vs Vertical)
566- ShowButtons for increment/decrement controls
567- Width property for responsive sizing
568- EnableAnimation for smooth transitions
569- CssClass for custom styling
570- EnableRtl for right-to-left language support
571- ReadOnly and Enabled states
572- Theme customization with Theme Studio
573
574#### Events and Data Binding
575📄 **Read:** [references/rangeslider-events-and-binding.md](references/rangeslider-events-and-binding.md)
576- SliderEvents component configuration
577- ValueChange event callback for range updates
578- OnChange vs Changed event timing
579- Created event for initialization logic
580- Rendered event for post-render operations
581- OnTooltipChange for dynamic tooltip content
582- OnTicksRender for custom tick label rendering
583- Form integration with EditForm
584- Validation with EditContext and data annotations
585
586### Quick Start Example
587
588```razor
589@using Syncfusion.Blazor.Inputs
590
591<div class="range-slider-container">
592 <label>Select Price Range: $@priceRange[0] - $@priceRange[1]</label>
593 <SfSlider @bind-Value="@priceRange"
594 Type="SliderType.Range"
595 Min="0"
596 Max="1000"
597 Step="10">
598 <SliderTicks Placement="Placement.After" LargeStep="200" SmallStep="50" ShowSmallTicks="true"></SliderTicks>
599 <SliderTooltip IsVisible="true" ShowOn="TooltipShowOn.Always" Format="C0"></SliderTooltip>
600 </SfSlider>
601</div>
602
603@code {
604 private int[] priceRange = new int[] { 200, 800 };
605}
606```
607
608### Common Patterns
609
610#### Pattern 1: Basic Range Selection
611- Set `Type="SliderType.Range"` for dual handles
612- Bind value to int[] or double[] array with two elements
613- Configure `Min`, `Max`, and `Step` properties
614- Enable tooltip with `IsVisible="true"` for user feedback
615- Use `ValueChange` event to capture range updates
616
617#### Pattern 2: Range with Visual Color Zones
618- Add `SliderColorRanges` component
619- Define multiple `ColorRange` segments (e.g., cold/warm/hot)
620- Set colors that provide clear visual distinction
621- Use for temperature, ratings, or risk indicators
622- Combine with ticks for precise value identification
623
624#### Pattern 3: Constrained Range Selection
625- Use `SliderLimits` to restrict handle movement
626- Set `MinStart`/`MaxStart` for first handle bounds
627- Set `MinEnd`/`MaxEnd` for second handle bounds
628- Enable `StartHandleFixed` or `EndHandleFixed` if one handle should be locked
629- Ideal for booking systems, budget planning, scheduling
630
631#### Pattern 4: Custom Value Range Selection
632- Use `CustomValues` array for non-numeric ranges
633- Example: string[] { "XS", "S", "M", "L", "XL", "XXL" }
634- Value array uses indices, not actual values
635- Display custom labels via tick formatting
636- Perfect for size selection, priority levels, skill ratings
637
638### Key Props
639
640| Property | Default | Use When |
641|----------|---------|----------|
642| Type | SliderType.Default | Set to SliderType.Range for dual handles |
643| Value | new int[]{} | Binding range values (must be 2-element array) |
644| Min | 0 | Setting minimum selectable value |
645| Max | 100 | Setting maximum selectable value |
646| Step | 1 | Defining increment/decrement value |
647| CustomValues | null | Using non-numeric values (sizes, labels) |
648| IsImmediateValue | false | Getting real-time updates during drag |
649| ShowButtons | false | Adding increment/decrement buttons |
650| Orientation | SliderOrientation.Horizontal | Changing to vertical layout |
651| Width | null | Setting component width |
652| EnableAnimation | true | Controlling handle animation |
653| ReadOnly | false | Preventing user interaction while showing value |
654| Enabled | true | Enabling/disabling the entire component |
655
656### Common Use Cases
657
6581. **E-Commerce Price Filters**: Min/max price selection, budget range filtering
6592. **Date Range Pickers**: Check-in/check-out dates, event duration, scheduling
6603. **Temperature Control**: HVAC systems, oven settings, climate zones
6614. **Age Range Selection**: Demographics, target audience, age restrictions
6625. **Time Range Selection**: Working hours, availability slots, time windows
6636. **Score/Rating Ranges**: Grade filtering, performance metrics, review scores
6647. **Financial Planning**: Budget allocation, investment ranges, spending limits
6658. **Resource Allocation**: CPU/memory limits, bandwidth throttling, capacity planning
666
667### Quick Decision Tree
668
669**User needs range selection (two values)**
670 ├─ Numeric range?
671 │ ├─ Set `Type="SliderType.Range"`
672 │ ├─ Use int[] or double[] for Value
673 │ └─ Configure Min, Max, Step
674 ├─ Non-numeric values (sizes, labels)?
675 │ ├─ Set `CustomValues` array
676 │ ├─ Value array contains indices
677 │ └─ Use tick formatting for labels
678 ├─ Need visual zones?
679 │ ├─ Add `SliderColorRanges` component
680 │ └─ Define multiple `ColorRange` segments
681 ├─ Restrict movement?
682 │ ├─ Use `SliderLimits` component
683 │ ├─ Set MinStart/MaxStart/MinEnd/MaxEnd
684 │ └─ Enable StartHandleFixed or EndHandleFixed if needed
685 ├─ Vertical layout needed?
686 │ └─ Set `Orientation="SliderOrientation.Vertical"`
687 └─ Real-time updates during drag?
688 └─ Set `IsImmediateValue="true"`
689
690---
691
692## OtpInput
693
694Learn to implement Syncfusion Blazor OtpInput (One-Time Password) component for secure verification code entry with configurable length, input types (number, text, password), styling modes (outlined, underlined, filled), automatic focus management, and comprehensive event handling. Perfect for 2FA authentication, email verification, SMS codes, PIN entry, and any scenario requiring secure multi-digit code input with keyboard navigation and accessibility support.
695
696### Documentation
697
698#### Getting Started
699📄 **Read:** [references/otpinput-getting-started.md](references/otpinput-getting-started.md)
700- Installation and NuGet package setup
701- Basic SfOtpInput component setup
702- Namespace imports and service registration
703- CSS theme configuration
704- Length property for OTP digit count
705- Value binding and retrieval
706- Minimal working example
707
708#### Configuration Options
709📄 **Read:** [references/otpinput-configuration.md](references/otpinput-configuration.md)
710- Length property for digit count (default: 4)
711- Type property (Number, Text, Password)
712- Placeholder configuration for empty inputs
713- Separator for visual grouping
714- AutoFocus for immediate input
715- Disabled state management
716- ID and HtmlAttributes customization
717
718#### Styling Modes
719📄 **Read:** [references/otpinput-styling-modes.md](references/otpinput-styling-modes.md)
720- StylingMode options (Outlined, Underlined, Filled)
721- TextTransform (None, Lowercase, Uppercase)
722- CssClass for custom styling
723- Theme customization with Theme Studio
724- Responsive design patterns
725- Visual states and focus indicators
726
727#### Events and Data Binding
728📄 **Read:** [references/otpinput-events-binding.md](references/otpinput-events-binding.md)
729- Value property and two-way binding (@bind-Value)
730- ValueChanged event callback (use Value property only, NOT @bind-Value)
731- OnInput event with OtpInputEventArgs
732- OnFocus and OnBlur events
733- Created lifecycle event
734- Form validation integration
735- Real-time verification patterns
736- Auto-submit on completion
737
738#### Accessibility
739📄 **Read:** [references/otpinput-accessibility.md](references/otpinput-accessibility.md)
740- AriaLabels array for individual input fields
741- Keyboard navigation (arrows, backspace, delete)
742- Screen reader support
743- WCAG 2.1 compliance
744- Focus management best practices
745- Password type accessibility considerations
746- Mobile device optimization
747
748### Quick Start Example
749
750```razor
751@using Syncfusion.Blazor.Inputs
752
753<div class="otp-container">
754 <label>Enter verification code:</label>
755 <SfOtpInput @bind-Value="@otpValue"
756 Length="6"
757 Type="OtpInputType.Number"
758 StylingMode="OtpInputStyle.Outlined">
759 </SfOtpInput>
760
761 @if (!string.IsNullOrEmpty(message))
762 {
763 <div class="message">@message</div>
764 }
765</div>
766
767@code {
768 private string otpValue = "";
769 private string message = "";
770
771 protected override void OnParametersSet()
772 {
773 if (otpValue.Length == 6)
774 {
775 message = "Verifying code...";
776 // Call verification API
777 }
778 }
779}
780```
781
782### Common Patterns
783
784#### Pattern 1: Basic OTP Verification (6-digit numeric)
785- Set `Length="6"` for standard OTP length
786- Use `Type="OtpInputType.Number"` for numeric-only input
787- Enable `AutoFocus="true"` for immediate input
788- Use `@bind-Value` for two-way binding (simplest approach)
789- Validate and verify OTP on server
790
791#### Pattern 2: Email/SMS Verification Code
792- Configure `Length="4"` or `Length="6"` based on service
793- Use `Type="OtpInputType.Number"` for numeric codes
794- Set `StylingMode="OtpInputStyle.Underlined"` for clean look
795- Auto-focus first input on page load
796- Show countdown timer for code expiration
797- Provide "Resend code" functionality
798
799#### Pattern 3: Secure PIN Entry
800- Use `Type="OtpInputType.Password"` to mask input
801- Set `Length="4"` or `Length="6"` for PIN length
802- Apply `StylingMode="OtpInputStyle.Filled"` for modern look
803- Implement rate limiting for security
804- Clear input on failed attempts
805- Show visual feedback for validation
806
807#### Pattern 4: Alphanumeric Verification (with separators)
808- Set `Type="OtpInputType.Text"` for letters and numbers
809- Use `TextTransform="TextTransform.Uppercase"` for readability
810- Configure `Separator="-"` to visually group digits
811- Example: ABC-123-XYZ pattern
812- Set `Length="9"` (including separator positions)
813- Useful for activation codes, license keys
814
815### Key Props
816
817| Property | Default | Use When |
818|----------|---------|----------|
819| Value | "" | Binding OTP value (two-way with @bind-Value) |
820| Length | 4 | Setting number of OTP input fields |
821| Type | OtpInputType.Number | Defining input type (Number, Text, Password) |
822| StylingMode | OtpInputStyle.Outlined | Choosing visual style (Outlined, Underlined, Filled) |
823| Placeholder | "" | Showing hint text in empty fields |
824| Separator | "" | Adding visual separator between groups |
825| TextTransform | TextTransform.None | Transforming text (None, Lowercase, Uppercase) |
826| AutoFocus | false | Auto-focusing first input on load |
827| Disabled | false | Disabling all input fields |
828| CssClass | "" | Applying custom CSS classes |
829| AriaLabels | null | Setting custom ARIA labels for each input |
830| HtmlAttributes | null | Adding custom HTML attributes |
831
832### Common Use Cases
833
8341. **Two-Factor Authentication (2FA)**: Login security, account verification, multi-factor authentication
8352. **Email Verification**: Account activation, email confirmation, newsletter signup
8363. **SMS Verification**: Phone number verification, mobile app login, transaction confirmation
8374. **Password Reset**: Secure password recovery, account access restoration
8385. **Transaction Verification**: Banking transactions, payment confirmation, fund transfers
8396. **Access Control**: Building entry codes, secure area access, temporary access codes
8407. **Device Pairing**: Bluetooth pairing codes, smart device setup, IoT device linking
8418. **Activation Codes**: Software licenses, product activation, subscription validation
842
843### Quick Decision Tree
844
845**User needs OTP/verification code input**
846 ├─ Numeric only?
847 │ ├─ Set `Type="OtpInputType.Number"`
848 │ └─ Use `Length="4"` or `Length="6"`
849 ├─ Need to hide input (PIN)?
850 │ ├─ Set `Type="OtpInputType.Password"`
851 │ └─ Apply security best practices
852 ├─ Alphanumeric codes?
853 │ ├─ Set `Type="OtpInputType.Text"`
854 │ ├─ Use `TextTransform="TextTransform.Uppercase"`
855 │ └─ Consider `Separator` for readability
856 ├─ Auto-submit when complete?
857 │ ├─ Listen to `ValueChanged` event
858 │ ├─ Check if `value.Length == Length`
859 │ └─ Call verification API automatically
860 ├─ Custom styling needed?
861 │ ├─ Outlined → `StylingMode="OtpInputStyle.Outlined"` (default)
862 │ ├─ Underlined → `StylingMode="OtpInputStyle.Underlined"`
863 │ └─ Filled → `StylingMode="OtpInputStyle.Filled"`
864 └─ Accessibility important?
865 ├─ Set `AriaLabels` array for screen readers
866 └─ Enable `AutoFocus` for keyboard users
867
868---
869
870## Rating
871
872Learn to implement Syncfusion Blazor Rating component for intuitive rating and feedback collection with configurable precision modes (full, half, quarter, exact), custom icons and templates, label and tooltip support, comprehensive event handling, and accessibility features. Perfect for product reviews, skill assessments, satisfaction surveys, quality ratings, and any scenario requiring user feedback through star ratings or custom iconography with keyboard navigation and form integration.
873
874### Documentation
875
876#### Getting Started
877📄 **Read:** [references/rating-getting-started.md](references/rating-getting-started.md)
878- Installation and NuGet package setup
879- Basic SfRating component setup
880- Namespace imports and service registration
881- CSS theme configuration
882- ItemsCount property for rating scale
883- Value binding and retrieval
884- Minimal working example
885- Basic 5-star rating implementation
886
887#### Precision and Values
888📄 **Read:** [references/rating-precision-and-values.md](references/rating-precision-and-values.md)
889- Precision property (Full, Half, Quarter, Exact)
890- Full precision for whole numbers only
891- Half precision for 0.5 increments
892- Quarter precision for 0.25 increments
893- Exact precision for decimal values
894- Min property for minimum rating value
895- AllowReset for clearing ratings
896- EnableSingleSelection for single-item mode
897- Value calculations and display
898
899#### Labels and Tooltips
900📄 **Read:** [references/rating-labels-and-tooltips.md](references/rating-labels-and-tooltips.md)
901- ShowLabel property for label display
902- LabelPosition (Top, Bottom, Left, Right)
903- LabelTemplate for custom label formatting
904- ShowTooltip property for hover tooltips
905- TooltipTemplate for custom tooltip content
906- Dynamic label updates based on value
907- Contextual feedback patterns
908
909#### Templates and Customization
910📄 **Read:** [references/rating-templates-customization.md](references/rating-templates-customization.md)
911- EmptyTemplate for unselected items
912- FullTemplate for selected items
913- RatingItemContext for template data
914- Custom icon implementation (hearts, thumbs, emojis)
915- SVG and icon font integration
916- CssClass for custom styling
917- EnableAnimation property
918- Theme customization and responsive design
919
920#### Events and States
921📄 **Read:** [references/rating-events-and-states.md](references/rating-events-and-states.md)
922- ValueChanged event for rating updates
923- OnItemHover event with RatingHoverEventArgs
924- Created lifecycle event
925- Form validation integration
926- ReadOnly state for display-only ratings
927- Disabled state management
928- Visible property control
929- Keyboard navigation support
930- Accessibility features and ARIA attributes
931
932### Quick Start Example
933
934```razor
935@using Syncfusion.Blazor.Inputs
936
937<div class="rating-container">
938 <label>Rate your experience:</label>
939 <SfRating @bind-Value="@userRating"
940 ItemsCount="5"
941 Precision="PrecisionType.Full"
942 ShowLabel="true">
943 </SfRating>
944
945 @if (userRating > 0)
946 {
947 <p>You rated: @userRating / 5 stars</p>
948 }
949</div>
950
951@code {
952 private double userRating = 0;
953}
954```
955
956### Common Patterns
957
958#### Pattern 1: Basic 5-Star Product Rating
959- Use default `ItemsCount="5"` for standard rating
960- Set `Precision="PrecisionType.Full"` for whole stars only
961- Enable `@bind-Value` for two-way data binding
962- Show `ShowLabel="true"` to display rating value
963- Position label with `LabelPosition="LabelPosition.Right"`
964- Use `ValueChanged` event for auto-submit
965
966#### Pattern 2: Half-Star Rating with Hover Feedback
967- Set `Precision="PrecisionType.Half"` for 0.5 increments
968- Enable `ShowTooltip="true"` for hover feedback
969- Use `OnItemHover` event for preview
970- Display average ratings with `ReadOnly="true"`
971- Show rating count in custom label template
972- Implement real-time feedback messages
973
974#### Pattern 3: Custom Icon Templates (Hearts, Thumbs, Emojis)
975- Define `EmptyTemplate` for unselected state
976- Define `FullTemplate` for selected state
977- Use `RatingItemContext` for item-specific rendering
978- Implement custom icons (♥, 👍, 😊, etc.)
979- Apply `CssClass` for custom colors and sizing
980- Enable `EnableAnimation="true"` for smooth transitions
981
982#### Pattern 4: Multi-Category Rating Form
983- Create multiple `SfRating` components
984- Different `ItemsCount` per category if needed
985- Combine with `EditForm` for validation
986- Calculate overall rating average
987- Track completion with event handlers
988- Enable submit only when all ratings complete
989
990### Key Props
991
992| Property | Default | Use When |
993|----------|---------|----------|
994| Value | 0 | Binding rating value (two-way with @bind-Value) |
995| ItemsCount | 5 | Setting number of rating items (stars) |
996| Precision | PrecisionType.Full | Defining rating granularity (Full, Half, Quarter, Exact) |
997| ShowLabel | false | Displaying rating value as text |
998| LabelPosition | LabelPosition.Right | Positioning label (Top, Bottom, Left, Right) |
999| ShowTooltip | false | Enabling hover tooltips |
1000| AllowReset | true | Allowing users to clear their rating |
1001| EnableSingleSelection | false | Single item selection mode (thumbs up/down) |
1002| Min | null | Setting minimum rating value |
1003| ReadOnly | false | Display-only mode for showing ratings |
1004| Disabled | false | Disabling all interactions |
1005| EnableAnimation | true | Enabling smooth transitions |
1006| Visible | true | Controlling component visibility |
1007| EmptyTemplate | null | Custom template for unselected items |
1008| FullTemplate | null | Custom template for selected items |
1009| LabelTemplate | null | Custom label content |
1010| TooltipTemplate | null | Custom tooltip content |
1011| CssClass | "" | Applying custom CSS classes |
1012
1013### Common Use Cases
1014
10151. **Product Reviews**: E-commerce ratings, marketplace feedback, customer reviews, product quality assessment
10162. **Service Quality**: Restaurant ratings, hotel reviews, delivery service feedback, support satisfaction
10173. **Skill Assessments**: Employee evaluations, competency ratings, training feedback, proficiency levels
10184. **Content Rating**: Article feedback, video ratings, course reviews, documentation usefulness
10195. **User Experience**: App store ratings, feature satisfaction, usability scores, NPS surveys
10206. **Performance Reviews**: Team member evaluations, project ratings, goal achievements, KPI tracking
10217. **Survey Responses**: Satisfaction surveys, opinion polls, feedback forms, questionnaires
10228. **Quality Control**: Inspection ratings, compliance scoring, audit results, quality metrics
10239. **Entertainment**: Movie ratings, music reviews, book ratings, game scores
102410. **Sentiment Analysis**: Customer sentiment, brand perception, mood tracking, emotional feedback
1025
1026### Quick Decision Tree
1027
1028**User needs rating/feedback functionality**
1029 ├─ Display existing rating (read-only)?
1030 │ ├─ Set `ReadOnly="true"`
1031 │ ├─ Use `Precision="PrecisionType.Exact"` for average ratings
1032 │ └─ Show `ShowLabel="true"` with review count
1033 ├─ Collect new rating from user?
1034 │ ├─ Whole stars only? → `Precision="PrecisionType.Full"`
1035 │ ├─ Half stars? → `Precision="PrecisionType.Half"`
1036 │ ├─ Quarter stars? → `Precision="PrecisionType.Quarter"`
1037 │ └─ Any decimal? → `Precision="PrecisionType.Exact"`
1038 ├─ Custom rating scale?
1039 │ ├─ 3-point scale → `ItemsCount="3"`
1040 │ ├─ 7-point scale → `ItemsCount="7"`
1041 │ └─ 10-point scale → `ItemsCount="10"`
1042 ├─ Need custom icons instead of stars?
1043 │ ├─ Hearts → Define `EmptyTemplate` and `FullTemplate` with ♥
1044 │ ├─ Thumbs → Use 👍/👎 icons
1045 │ ├─ Emojis → Use 😞😐🙂😊🤩 progression
1046 │ └─ Custom SVG → Render SVG in templates
1047 ├─ Thumbs up/down only?
1048 │ ├─ Set `EnableSingleSelection="true"`
1049 │ ├─ Use `ItemsCount="1"` or `ItemsCount="2"`
1050 │ └─ Custom templates with thumb icons
1051 ├─ Form integration needed?
1052 │ ├─ Use within `<EditForm>`
1053 │ ├─ Add validation attributes
1054 │ └─ Listen to `ValueChanged` for validation
1055 ├─ Show rating feedback?
1056 │ ├─ Enable `ShowLabel="true"` for numeric display
1057 │ ├─ Use `LabelTemplate` for custom messages
1058 │ ├─ Enable `ShowTooltip="true"` for hover feedback
1059 │ └─ Use `TooltipTemplate` for contextual messages
1060 └─ Accessibility requirements?
1061 ├─ Ensure keyboard navigation works (arrow keys)
1062 ├─ Test screen reader compatibility
1063 └─ Provide clear ARIA labels
1064
1065---
1066
1067## InputMask
1068
1069Learn to implement Syncfusion Blazor InputMask (MaskedTextBox) component for formatted text input with predefined patterns, custom mask rules, prompt characters, and always get immediate masked input for phone numbers, SSN, credit cards, dates, ZIP codes, license plates, or any scenario requiring structured text entry with format validation, literal preservation, and comprehensive event handling in Blazor applications.
1070
1071### Documentation
1072
1073#### Getting Started
1074📄 **Read:** [references/inputmask-getting-started.md](references/inputmask-getting-started.md)
1075- Installation and NuGet package setup
1076- Basic SfMaskedTextBox component setup
1077- Namespace imports and service registration
1078- CSS theme configuration
1079- Simple mask examples (phone, date, SSN)
1080- Value binding basics
1081- Minimal working example
1082
1083#### Mask Patterns and Configuration
1084📄 **Read:** [references/inputmask-mask-patterns.md](references/inputmask-mask-patterns.md)
1085- Standard mask characters (0, 9, L, ?, A, &, C, #)
1086- Predefined patterns (phone, SSN, ZIP, date, time)
1087- Mask property configuration
1088- Literal characters in masks
1089- Optional vs required positions
1090- Complex pattern examples
1091- International format patterns
1092- Pattern validation rules
1093
1094#### Custom Characters and Formatting
1095📄 **Read:** [references/inputmask-custom-characters.md](references/inputmask-custom-characters.md)
1096- CustomCharacters dictionary usage
1097- Creating custom mask rules
1098- Regex-based character validation
1099- Advanced pattern customization
1100- Use cases (license plates, product codes, etc.)
1101- Combining custom with standard masks
1102- Best practices for custom rules
1103
1104#### Prompt Character Configuration
1105📄 **Read:** [references/inputmask-prompt-configuration.md](references/inputmask-prompt-configuration.md)
1106- PromptChar property (default: _)
1107- PromptPlaceholder for display
1108- EnableLiterals for value inclusion
1109- Placeholder vs PromptChar difference
1110- Visual feedback configuration
1111- User experience considerations
1112- Examples with different configurations
1113
1114#### Events and Data Binding
1115📄 **Read:** [references/inputmask-events-binding.md](references/inputmask-events-binding.md)
1116- Value property and @bind-Value
1117- ValueChange event (MaskChangeEventArgs)
1118- ValueChanged event callback
1119- Focus and Blur events (MaskFocusEventArgs, MaskBlurEventArgs)
1120- OnChange vs OnInput vs ValueChange timing
1121- EditForm integration with EditContext
1122- ValueExpression for validation
1123- Real-time validation patterns
1124- Event handler best practices
1125
1126#### Styling and Accessibility
1127📄 **Read:** [references/inputmask-styling-accessibility.md](references/inputmask-styling-accessibility.md)
1128- FloatLabelType configuration
1129- ShowClearButton functionality
1130- CssClass for custom styling
1131- Width and responsive sizing
1132- Enabled vs Readonly states
1133- Theme customization with Theme Studio
1134- WCAG 2.1 compliance
1135- Keyboard navigation
1136- ARIA attributes
1137- Screen reader support
1138- RTL (EnableRtl) support
1139- HtmlAttributes and InputAttributes
1140- Accessibility best practices
1141
1142### Quick Start Example
1143
1144```razor
1145@using Syncfusion.Blazor.Inputs
1146
1147<div class="input-mask-container">
1148 <label>Phone Number:</label>
1149 <SfMaskedTextBox @bind-Value="@phoneNumber"
1150 Mask="(000) 000-0000"
1151 Placeholder="Enter phone number"
1152 FloatLabelType="FloatLabelType.Auto">
1153 </SfMaskedTextBox>
1154
1155 <label>Social Security Number:</label>
1156 <SfMaskedTextBox @bind-Value="@ssn"
1157 Mask="000-00-0000"
1158 PromptChar="#"
1159 Placeholder="Enter SSN">
1160 </SfMaskedTextBox>
1161</div>
1162
1163@code {
1164 private string phoneNumber = "";
1165 private string ssn = "";
1166}
1167```
1168
1169### Common Patterns
1170
1171#### Pattern 1: Phone Number Input (US Format)
1172- Use mask `"(000) 000-0000"` for US phone numbers
1173- Set `PromptChar="_"` for clear visual feedback
1174- Enable `@bind-Value` for two-way binding
1175- Use `FloatLabelType.Auto` for modern UX
1176- Configure `Placeholder` for user guidance
1177- Set `EnableLiterals="false"` to exclude parentheses/dashes from value
1178
1179#### Pattern 2: Social Security Number (SSN)
1180- Use mask `"000-00-0000"` for SSN format
1181- Set `PromptChar="#"` or `PromptChar="*"` for privacy
1182- Apply `Readonly="false"` for input, `Readonly="true"` for display
1183- Use `ShowClearButton="true"` for quick reset
1184- Implement validation with `ValueChange` event
1185- Consider masking display value for security
1186
1187#### Pattern 3: Credit Card Number with Separators
1188- Use mask `"0000 0000 0000 0000"` for 16-digit cards
1189- Set `EnableLiterals="false"` to get digits only
1190- Listen to `ValueChange` to detect card type (Visa, MC, Amex)
1191- Show card brand icon based on first digits
1192- Apply real-time Luhn algorithm validation
1193- Use `PromptChar="X"` for clear empty positions
1194
1195#### Pattern 4: Date Input with Custom Format
1196- Use mask `"00/00/0000"` for MM/DD/YYYY format
1197- Or `"00-00-0000"` for DD-MM-YYYY format
1198- Set `Placeholder="MM/DD/YYYY"` for format guidance
1199- Implement custom validation for valid dates
1200- Use `ValueChange` to validate day/month ranges
1201- Consider using DatePicker component for complex date selection
1202
1203#### Pattern 5: Custom Product Code Format
1204- Define `CustomCharacters` dictionary for special rules
1205- Example: `@(new Dictionary<string, string> { { "P", "[A-Z]" }, { "N", "[0-9]" } })`
1206- Use mask like `"PPP-NNN-NNN"` for ABC-123-456 format
1207- Combine standard and custom characters
1208- Apply `TextTransform` for uppercase conversion
1209- Validate against business rules in events
1210
1211#### Pattern 6: International Phone with Custom Characters
1212- Use `CustomCharacters` for country-specific patterns
1213- Example: `"+00 (000) 000-0000"` with country code
1214- Set `EnableLiterals="true"` to include + and formatting
1215- Display country flag based on code
1216- Implement dynamic mask switching per country
1217- Support multiple international formats
1218
1219### Key Props
1220
1221| Property | Default | Use When |
1222|----------|---------|----------|
1223| Mask | "" | Defining input format pattern (required) |
1224| Value | "" | Binding masked input value |
1225| PromptChar | '_' | Setting placeholder character for empty positions |
1226| PromptPlaceholder | null | Overriding prompt character in placeholder mode |
1227| EnableLiterals | true | Include/exclude literal characters in value |
1228| CustomCharacters | null | Defining custom mask rules with regex |
1229| Placeholder | "" | Showing hint text when empty |
1230| FloatLabelType | FloatLabelType.Never | Enabling floating label animation |
1231| ShowClearButton | false | Adding quick clear functionality |
1232| Readonly | false | Preventing edits while showing masked value |
1233| Enabled | true | Enabling/disabling the component |
1234| Width | "" | Setting component width |
1235| CssClass | "" | Applying custom CSS classes |
1236| EnableRtl | false | Enabling right-to-left text direction |
1237| HtmlAttributes | null | Adding custom HTML attributes to wrapper |
1238| InputAttributes | null | Adding custom attributes to input element |
1239| TabIndex | 0 | Setting tab navigation order |
1240
1241### Common Use Cases
1242
12431. **Contact Information**: Phone numbers, fax numbers, mobile numbers with country codes
12442. **Personal Identification**: SSN, tax ID, national ID, passport numbers, driver's license
12453. **Financial Data**: Credit card numbers, bank account numbers, routing numbers, CVV codes
12464. **Dates and Times**: Custom date formats, time entry, date ranges with specific patterns
12475. **Postal Codes**: ZIP codes (US), postal codes (international), area codes with formatting
12486. **Product Identification**: SKU numbers, serial numbers, product codes, barcode entry
12497. **License Numbers**: Vehicle plates, software licenses, registration numbers with patterns
12508. **Network Information**: IP addresses, MAC addresses, subnet masks with dot notation
12519. **Version Numbers**: Software versions (1.2.3), build numbers with custom formats
125210. **Custom Codes**: Voucher codes, promo codes, tracking numbers with specific patterns
1253
1254### Quick Decision Tree
1255
1256**User needs formatted text input with pattern**
1257 ├─ Standard formats?
1258 │ ├─ US Phone → `Mask="(000) 000-0000"`
1259 │ ├─ SSN → `Mask="000-00-0000"`
1260 │ ├─ ZIP Code → `Mask="00000"` or `Mask="00000-0000"`
1261 │ ├─ Credit Card → `Mask="0000 0000 0000 0000"`
1262 │ ├─ Date → `Mask="00/00/0000"` (MM/DD/YYYY)
1263 │ └─ Time → `Mask="00:00"` (HH:MM)
1264 ├─ Need digits only in value?
1265 │ ├─ Set `EnableLiterals="false"`
1266 │ └─ Mask literals will be excluded from Value
1267 ├─ Include formatting in value?
1268 │ ├─ Set `EnableLiterals="true"` (default)
1269 │ └─ Value will include parentheses, dashes, etc.
1270 ├─ Custom pattern (not standard)?
1271 │ ├─ Use `CustomCharacters` dictionary
1272 │ ├─ Define regex for each custom character
1273 │ ├─ Example: { "P", "[A-Z]" } for uppercase letters
1274 │ └─ Combine in mask: `"PPP-000-NNN"`
1275 ├─ Privacy/security concerns?
1276 │ ├─ Set `PromptChar="*"` or `PromptChar="#"`
1277 │ ├─ Use `Readonly="true"` for display-only masked data
1278 │ └─ Implement additional masking on display if needed
1279 ├─ International format support?
1280 │ ├─ Use `CustomCharacters` for flexible patterns
1281 │ ├─ Implement dynamic mask switching based on locale
1282 │ └─ Consider country/region selection
1283 ├─ Form validation needed?
1284 │ ├─ Use within `<EditForm>` with model binding
1285 │ ├─ Add `ValueExpression` for validation
1286 │ ├─ Apply data annotations ([Required], [StringLength])
1287 │ ├─ Listen to `ValueChange` for real-time validation
1288 │ └─ Implement custom validation logic (Luhn, date ranges)
1289 ├─ Enhance user experience?
1290 │ ├─ Set `FloatLabelType="FloatLabelType.Auto"`
1291 │ ├─ Enable `ShowClearButton="true"` for quick reset
1292 │ ├─ Use meaningful `Placeholder` text
1293 │ └─ Provide visual feedback on validation
1294 └─ Accessibility important?
1295 ├─ Ensure keyboard navigation works
1296 ├─ Set proper ARIA labels via `HtmlAttributes`
1297 ├─ Test screen reader compatibility
1298 └─ Provide clear format instructions in label/placeholder
1299
1300---
1301
1302## ColorPicker
1303
1304Learn to implement Syncfusion Blazor ColorPicker component for intuitive color selection with picker and palette modes, opacity control, preset color collections, inline or popup display, mode switching, and always get immediate color input for themes, UI customization, design tools, data visualization, branding, or any scenario requiring color selection with hex/rgba values, recent colors tracking, and comprehensive event handling in Blazor applications.
1305
1306### Documentation
1307
1308#### Getting Started
1309📄 **Read:** [references/colorpicker-getting-started.md](references/colorpicker-getting-started.md)
1310- Installation and NuGet package setup
1311- Basic SfColorPicker component setup
1312- Namespace imports and service registration
1313- CSS theme configuration
1314- Value binding with color formats
1315- Mode overview (Picker vs Palette)
1316- Minimal working example
1317
1318#### Modes and Configuration
1319📄 **Read:** [references/colorpicker-modes-configuration.md](references/colorpicker-modes-configuration.md)
1320- ColorPickerMode (Picker vs Palette)
1321- Picker mode for gradient color selection
1322- Palette mode for predefined color grids
1323- Inline vs Popup display options
1324- ModeSwitcher for user mode selection
1325- Columns configuration for palette layout
1326- ShowButtons for Apply/Cancel actions
1327- Mode-specific behaviors and use cases
1328
1329#### Preset Colors and Palettes
1330📄 **Read:** [references/colorpicker-presets-colors.md](references/colorpicker-presets-colors.md)
1331- PresetColors dictionary configuration
1332- Custom color palette groups
1333- Default preset color collections
1334- ShowRecentColors functionality
1335- NoColor option for "no selection"
1336- Organizing preset categories
1337- Business and design use cases
1338
1339#### Opacity and Value Formats
1340📄 **Read:** [references/colorpicker-opacity-values.md](references/colorpicker-opacity-values.md)
1341- EnableOpacity for alpha channel control
1342- Opacity slider configuration
1343- Value formats (hex, rgba, hsva)
1344- Reading and setting opacity values
1345- Transparent color handling
1346- Use cases (overlays, highlights, transparency)
1347
1348#### Events and Data Binding
1349📄 **Read:** [references/colorpicker-events-binding.md](references/colorpicker-events-binding.md)
1350- Value property and two-way binding (@bind-Value)
1351- ValueChanged event callback
1352- Selected event with ColorPickerEventArgs
1353- OnOpen and OnClose events for popup control
1354- ModeSwitched event handling
1355- OnTileRender for custom palette tiles
1356- Form integration with EditForm
1357- Real-time color preview patterns
1358
1359#### Customization and Accessibility
1360📄 **Read:** [references/colorpicker-customization-accessibility.md](references/colorpicker-customization-accessibility.md)
1361- ShowButtons configuration
1362- CssClass for custom styling
1363- Disabled and EnableRtl states
1364- HtmlAttributes customization
1365- Keyboard navigation support
1366- ARIA attributes for accessibility
1367- WCAG 2.1 compliance
1368- Theme customization with Theme Studio
1369- Responsive design patterns
1370
1371### Quick Start Example
1372
1373```razor
1374@using Syncfusion.Blazor.Inputs
1375
1376<div class="colorpicker-container">
1377 <label>Choose a color:</label>
1378 <SfColorPicker @bind-Value="@selectedColor"
1379 Mode="ColorPickerMode.Palette"
1380 ShowButtons="true">
1381 </SfColorPicker>
1382
1383 <div class="color-preview" style="background-color: @selectedColor;">
1384 Selected: @selectedColor
1385 </div>
1386</div>
1387
1388@code {
1389 private string selectedColor = "#008000";
1390}
1391```
1392
1393### Common Patterns
1394
1395#### Pattern 1: Basic Palette Color Picker
1396- Use `Mode="ColorPickerMode.Palette"` for predefined color grid
1397- Enable `@bind-Value` for two-way binding
1398- Set `ShowButtons="true"` for Apply/Cancel actions
1399- Use default PresetColors or customize
1400- Bind to string variable for hex values
1401- Display preview with selected color
1402
1403#### Pattern 2: Advanced Gradient Picker with Opacity
1404- Set `Mode="ColorPickerMode.Picker"` for gradient selector
1405- Enable `EnableOpacity="true"` for alpha channel
1406- Use `ModeSwitcher="true"` to allow mode switching
1407- Display rgba value for transparency
1408- Ideal for design tools, graphics editors
1409- Show real-time preview with opacity
1410
1411#### Pattern 3: Inline Color Selector (No Popup)
1412- Set `Inline="true"` for always-visible picker
1413- Use for color customization panels
1414- No popup trigger, immediate display
1415- Works with both Picker and Palette modes
1416- Combine with `ShowButtons="false"` for instant selection
1417- Perfect for settings panels, theme builders
1418
1419#### Pattern 4: Custom Preset Palette
1420- Define `PresetColors` dictionary with custom groups
1421- Organize by categories (brand colors, pastels, etc.)
1422- Set `Columns` property for grid layout
1423- Use `ShowRecentColors="true"` for history
1424- Enable `NoColor="true"` for "no selection" option
1425- Ideal for brand color systems, design systems
1426
1427### Key Props
1428
1429| Property | Default | Use When |
1430|----------|---------|----------|
1431| Value | "" | Binding selected color (hex, rgba, hsva) |
1432| Mode | ColorPickerMode.Picker | Choosing Picker (gradient) or Palette (grid) |
1433| Inline | false | Display picker inline instead of popup |
1434| ModeSwitcher | false | Allow user to switch between Picker and Palette |
1435| EnableOpacity | false | Enable alpha channel/transparency control |
1436| ShowButtons | false | Show Apply and Cancel buttons (popup mode) |
1437| ShowRecentColors | true | Display recently selected colors |
1438| PresetColors | null | Custom preset color palette dictionary |
1439| Columns | 10 | Number of columns in palette mode |
1440| NoColor | false | Allow "no color" selection option |
1441| Disabled | false | Disable color selection entirely |
1442| EnableRtl | false | Enable right-to-left layout |
1443| CssClass | "" | Apply custom CSS classes |
1444| HtmlAttributes | null | Add custom HTML attributes |
1445
1446### Common Use Cases
1447
14481. **UI Theme Customization**: User-selectable themes, color scheme builders, personalization
14492. **Design Tools**: Graphic editors, drawing apps, image annotation, markup tools
14503. **Data Visualization**: Chart color selection, graph customization, report styling
14514. **Branding**: Logo colors, brand identity, style guide implementation, corporate colors
14525. **Web Design**: CSS color selection, background colors, text colors, border colors
14536. **Product Customization**: Product color variants, custom merchandise, personalization
14547. **Highlighting Tools**: Text highlighters, annotation colors, emphasis markers
14558. **Dashboard Customization**: Widget colors, status indicators, category colors
14569. **Form Builders**: Custom form styling, input colors, validation colors
145710. **Calendar/Scheduling**: Event colors, category coding, priority indicators
1458
1459### Quick Decision Tree
1460
1461**User needs color selection functionality**
1462 ├─ Specific predefined colors only?
1463 │ ├─ Use `Mode="ColorPickerMode.Palette"`
1464 │ ├─ Set `PresetColors` with custom palette
1465 │ └─ Configure `Columns` for grid layout
1466 ├─ Any color from gradient?
1467 │ ├─ Use `Mode="ColorPickerMode.Picker"` (default)
1468 │ └─ Users can select from full color spectrum
1469 ├─ Allow both modes?
1470 │ ├─ Enable `ModeSwitcher="true"`
1471 │ └─ Users can toggle between Picker and Palette
1472 ├─ Need transparency/opacity?
1473 │ ├─ Set `EnableOpacity="true"`
1474 │ ├─ Value will include alpha (rgba format)
1475 │ └─ Show opacity slider for user control
1476 ├─ Always visible (no popup)?
1477 │ ├─ Set `Inline="true"`
1478 │ ├─ Use in settings panels, sidebars
1479 │ └─ Consider `ShowButtons="false"` for instant selection
1480 ├─ Popup with confirmation?
1481 │ ├─ Use `Inline="false"` (default)
1482 │ ├─ Set `ShowButtons="true"` for Apply/Cancel
1483 │ └─ Listen to `Selected` event for confirmed selection
1484 ├─ Track recent colors?
1485 │ ├─ Enable `ShowRecentColors="true"` (default)
1486 │ └─ Recent colors displayed automatically
1487 ├─ Allow "no color" selection?
1488 │ ├─ Set `NoColor="true"`
1489 │ └─ User can clear color selection
1490 ├─ Custom color palette needed?
1491 │ ├─ Define `PresetColors` dictionary
1492 │ ├─ Group colors by category
1493 │ └─ Example: { "Basic": ["#fff", "#000"], "Brand": ["#e74c3c", "#3498db"] }
1494 ├─ Form integration required?
1495 │ ├─ Use within `<EditForm>`
1496 │ ├─ Apply validation attributes
1497 │ └─ Listen to `ValueChanged` for validation
1498 └─ Accessibility important?
1499 ├─ Ensure keyboard navigation works (Tab, Enter, Escape)
1500 ├─ Test screen reader compatibility
1501 └─ Provide clear labels via `HtmlAttributes`