Skip to content

Radio button component#67

Merged
albx merged 8 commits intomainfrom
feature/37-radio-button
Jan 6, 2026
Merged

Radio button component#67
albx merged 8 commits intomainfrom
feature/37-radio-button

Conversation

@albx
Copy link
Owner

@albx albx commented Jan 2, 2026

This pull request introduces a new, fully featured BitRadioGroup and BitRadio component set for forms in Blazor, along with comprehensive tests and Storybook stories. The new components support grouping, inline display, disabling, additional help text, and integration with form validation. The changes are organized as follows:

Component Implementation:

  • Added BitRadioGroup<T> and BitRadio<T> components, supporting generic value types, inline/grouped display, disabling, additional text, and unique ID generation. These components are designed for use in forms and support validation and flexible layout. (src/BitBlazor/Form/Radio/BitRadioGroup.razor [1] src/BitBlazor/Form/Radio/BitRadioGroup.razor.cs [2] src/BitBlazor/Form/Radio/BitRadio.razor [3] src/BitBlazor/Form/Radio/BitRadio.razor.cs [4]

Storybook/Documentation:

Automated Testing:

  • Added unit and rendering tests for BitRadioGroup, verifying value change behavior, checked attribute logic, rendering of inline/grouped/disabled/additional-text scenarios, and markup correctness. (tests/BitBlazor.Test/Form/Radio/BitRadioGroupTest.Behaviors.cs [1] tests/BitBlazor.Test/Form/Radio/BitRadioGroupTest.Rendering.razor [2]

@albx albx linked an issue Jan 2, 2026 that may be closed by this pull request
@albx albx marked this pull request as ready for review January 5, 2026 05:51
@albx albx requested a review from Copilot January 5, 2026 05:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new radio button component set (BitRadioGroup and BitRadio) for single-choice selection in forms, with support for generic value types, validation, inline/grouped layouts, disabled states, and additional help text. The implementation includes comprehensive tests and Storybook examples, following existing component patterns in the codebase.

Key changes:

  • New BitRadioGroup<T> and BitRadio<T> components with full form integration via InputRadioGroup and InputRadio
  • Comprehensive test coverage including behavioral tests (value changes, checked attributes) and rendering tests (inline, grouped, disabled, additional text)
  • Complete documentation with usage examples and accessibility guidance

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/BitBlazor/Form/Radio/BitRadioGroup.razor Component template wrapping InputRadioGroup with cascading context
src/BitBlazor/Form/Radio/BitRadioGroup.razor.cs Component logic with validation support, inline/grouped layout options
src/BitBlazor/Form/Radio/BitRadio.razor Individual radio item template with label and additional text
src/BitBlazor/Form/Radio/BitRadio.razor.cs Radio item logic with CSS class computation and accessibility attributes
tests/BitBlazor.Test/Form/Radio/BitRadioGroupTest.Behaviors.cs Behavioral tests for value changes and checked state management
tests/BitBlazor.Test/Form/Radio/BitRadioGroupTest.Rendering.razor Rendering tests verifying markup for various configurations
stories/BitBlazor.Stories/Components/Stories/Form/BitRadioGroup.stories.razor Storybook examples demonstrating component features
docs/form/radio.md Comprehensive component documentation with examples
docs/quick-reference.md Quick reference documentation with basic usage patterns
docs/README.md Updated component index with radio button entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/BitBlazor/Form/Radio/BitRadio.razor:18

  • Extra blank line at the end of the file. Other similar Razor files in the codebase (like BitCheckbox.razor and BitRadioGroup.razor) have only one blank line at the end, not two.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@albx albx merged commit 5603eac into main Jan 6, 2026
4 checks passed
@albx albx deleted the feature/37-radio-button branch January 6, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add radio button component

1 participant