$ show dotnetcore/BootstrapBlazor
BootstrapBlazor is a comprehensive, enterprise-class Blazor UI component library built on Bootstrap 5. It provides over 100 reusable components including tables, dialogs, forms, charts, navigation, and media elements, all with extensive localization support (Chinese/English) and JavaScript interop for rich client-side behavior. The library follows a consistent architecture: each component inherits from BootstrapComponentBase, uses a CssBuilder for CSS class construction, and optionally loads a dedicated JS module via the JSModuleAutoLoader attribute. Services like DialogService, ToastService, and DrawerService follow a callback-based pattern (BootstrapServiceBase) for decoupled UI interactions. The repository also includes a full demo server (BootstrapBlazor.Server) that showcases every component with live examples, sample data services, and API controllers for authentication, file upload, and real-time communication (SignalR, TCP sockets). External dependencies include Bootstrap CSS, FontAwesome/Material Design icons, Floating UI for dropdown positioning, and several third-party JS libraries (Chart.js, Plyr, etc.). The codebase is well-tested with bUnit and xUnit, and is actively maintained with frequent releases and a large contributor community.
The LLM identified 5 files worth highlighting for reuse:
Base class for Blazor components that automatically load and dispose a corresponding JavaScript module. It uses the JSModuleAutoLoader attribute to resolve the module path, invokes Init/DisposeAsync on the JS side, and provides a clean pattern for JS interop without manual module management. This pattern is reusable in any Blazor project needing structured JS interop.
Abstract base class for singleton services (DialogService, ToastService, DrawerService) that manage UI popups. It provides a ShowAsync method that invokes a registered callback, allowing components to subscribe and render content without tight coupling. This pattern is reusable for any service that needs to trigger UI from non-UI code.
A generic throttling utility that ensures an asynchronous action is not invoked more than once within a specified interval. It uses a timer and cancellation token to debounce calls, making it ideal for rate-limiting event handlers (e.g., scroll, resize). The implementation is self-contained and can be extracted into any .NET project.
A fluent builder for constructing CSS class strings with conditional additions, replacements, and style attributes. It provides a clean API (AddClass, AddStyle, Build) and is used pervasively across all components. This pattern is reusable in any web UI framework that needs dynamic CSS class composition.
Custom IStringLocalizerFactory implementation that loads localized strings from JSON files embedded in the assembly. It supports fallback cultures, missing-item handling, and reload-on-change. This pattern is reusable for any .NET application needing JSON-based localization without satellite assemblies.