Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions App.razor

This file was deleted.

13 changes: 0 additions & 13 deletions Data/WeatherForecast.cs

This file was deleted.

20 changes: 0 additions & 20 deletions Data/WeatherForecastService.cs

This file was deleted.

42 changes: 0 additions & 42 deletions Pages/Error.cshtml

This file was deleted.

27 changes: 0 additions & 27 deletions Pages/Error.cshtml.cs

This file was deleted.

47 changes: 0 additions & 47 deletions Pages/FetchData.razor

This file was deleted.

36 changes: 0 additions & 36 deletions Pages/_Host.cshtml

This file was deleted.

34 changes: 0 additions & 34 deletions Program.cs

This file was deleted.

37 changes: 0 additions & 37 deletions Properties/launchSettings.json

This file was deleted.

62 changes: 48 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
# Blazor Textbox Customization
# Blazor TextBox Customization

This sample explains about how to customize the Syncfusion Blazor TextBox component.
A comprehensive guide to customizing the [Blazor TextBox](https://www.syncfusion.com/blazor-components/blazor-textbox) component with validation, tooltips, and custom behaviors.

**Reference link**: [https://blazor.syncfusion.com/documentation/textbox/how-to/create-custom-component-with-validation](https://blazor.syncfusion.com/documentation/textbox/how-to/create-custom-component-with-validation)
## Overview

This project showcases how to create sophisticated TextBox components in Blazor with advanced customization options. It includes a custom `CustomTextbox` component that encapsulates validation logic, data binding, and interactive features like tooltips and error messaging.

### Features

- **Custom TextBox Component** — Reusable wrapper around SfTextBox with built-in validation
- **Real-Time Validation** — Data annotations with immediate error feedback
- **Tooltip Integration** — Contextual validation messages displayed on hover
- **Two-Way Data Binding** — Seamless integration with Blazor EditForm
- **Multiline Support** — Configurable single-line and textarea modes
- **Length Constraints** — Min/max length validation with HTML5 attributes
- **Readonly Mode** — Display-only input state for non-editable scenarios
- **Placeholder Customization** — User-friendly hint text configuration
- **EditContext Cascading** — Full form-level validation awareness

## Prerequisites

* Visual Studio 2022
* [.NET SDK 10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) or later
* [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) or later
* [Visual Studio Code](https://code.visualstudio.com/)

## Getting started

### Clone the repository

```bash
git clone https://github.com/SyncfusionExamples/blazor-textbox-customization.git
cd blazor-textbox-customization
```

### Run with Visual Studio

1. Open the solution file using Visual Studio 2022 or later.
2. Restore the NuGet packages by rebuilding the solution.
3. Build the project to ensure there are no compilation errors.
4. Run the project.

### Run with .NET CLI

## How to run the project
```bash
# Restore dependencies
dotnet restore

* Checkout this project to a location in your disk.
* Open the solution file using the Visual Studio 2022.
* Restore the NuGet packages by rebuilding the solution.
* Run the project.
# Run the project
dotnet run
```

## Blog reference
## References

* [Blazor TextBox Customization - A Complete Guide](https://www.syncfusion.com/blogs/post/blazor-textbox-customization-a-complete-guide.aspx)
**Blog reference** : https://www.syncfusion.com/blogs/post/blazor-textbox-customization-a-complete-guide.aspx

## See also
**Documentation**: https://blazor.syncfusion.com/documentation/textbox/how-to/create-custom-component-with-validation

* [Online examples](https://blazor.syncfusion.com)
* [Documentation](https://blazor.syncfusion.com/documentation/introduction/)
**Online examples**: https://blazor.syncfusion.com/demos/textbox/forms-validation?theme=fluent2
39 changes: 0 additions & 39 deletions Shared/NavMenu.razor

This file was deleted.

Loading