Implement CheckBox component#280
Merged
csharpfritz merged 4 commits intodevfrom Jan 28, 2026
Merged
Conversation
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement CheckBox component for Blazor
Implement CheckBox component
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
CheckBoxcomponent emulating ASP.NET Web FormsSystem.Web.UI.WebControls.CheckBoxwith label positioning support.Implementation
BaseStyledComponent, supportsChecked,Text,TextAlign,Enabled, and standard style propertiesLeft|Rightfor label positioning (default:Right)<span><input><label></span>when text present, or bare<input>without textCheckedChangedfor two-way binding,OnCheckedChangedfor change handlingUsage
Testing
26 tests covering:
Documentation
docs/EditorControls/CheckBox.mdmkdocs.ymlandREADME.mdOriginal prompt
This section details on the original issue you should resolve
<issue_title>Issue: Implement CheckBox Component</issue_title>
<issue_description>## Overview
Implement the CheckBox Blazor component that emulates the ASP.NET Web Forms
System.Web.UI.WebControls.CheckBoxcontrol. This is a fundamental form control for boolean input with an optional text label.Microsoft Docs Reference: https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.checkbox?view=netframework-4.8
Phase 1: Research & Reference Setup
Step 1: Add Web Forms Sample Page
Create sample page at
samples/BeforeWebForms/ControlSamples/CheckBox/Default.aspx:Step 2: Capture HTML Output
Run the BeforeWebForms project and document the exact HTML output. Expected patterns:
CheckBox with Text (TextAlign=Right, default):
CheckBox with Text (TextAlign=Left):
CheckBox without Text:
Checked CheckBox:
Phase 2: Blazor Implementation
Step 3: Create Component Files
Create
src/BlazorWebFormsComponents/CheckBox.razor:Create
src/BlazorWebFormsComponents/CheckBox.razor.cs:Step 4: Implement Core Features
Properties to implement:
Checked- Boolean state of the checkboxText- Label text displayed next to checkboxTextAlign- Left or Right posi...💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.