column.Visible = false)" @onclick:stopPropagation>
+
column.Visible = false)" @onclick:stopPropagation>
diff --git a/src/BlazorTable/Components/Table.razor.cs b/src/BlazorTable/Components/Table.razor.cs
index 57c959c3..07848d84 100644
--- a/src/BlazorTable/Components/Table.razor.cs
+++ b/src/BlazorTable/Components/Table.razor.cs
@@ -10,6 +10,7 @@
using System.Threading.Tasks;
using BlazorTable.Components.ServerSide;
using BlazorTable.Interfaces;
+using Microsoft.Extensions.Options;
namespace BlazorTable
{
@@ -95,6 +96,9 @@ public partial class Table
: ITable
[Inject]
IStringLocalizer Localization { get; set; }
+ [Inject]
+ IOptions Options { get; set; }
+
///
/// Ref to visibility menu icon for popover display
///
@@ -140,6 +144,11 @@ public partial class Table : ITable
///
private List> CustomRows { get; set; } = new List>();
+ ///
+ /// Switch between float-right and float-end based on bootstrap version
+ ///
+ public string FloatRightClass => Options.Value.IsBootstrap5 ? "float-end" : "float-right";
+
protected override async Task OnParametersSetAsync()
{
await UpdateAsync().ConfigureAwait(false);
diff --git a/src/BlazorTable/IServiceCollectionExtensions.cs b/src/BlazorTable/IServiceCollectionExtensions.cs
index 6ed95cd5..1655d80a 100644
--- a/src/BlazorTable/IServiceCollectionExtensions.cs
+++ b/src/BlazorTable/IServiceCollectionExtensions.cs
@@ -1,11 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
+using System;
namespace BlazorTable
{
public static class IServiceCollectionExtensions
{
- public static IServiceCollection AddBlazorTable(this IServiceCollection services)
+ public static IServiceCollection AddBlazorTable(this IServiceCollection services, Action configureOptions = default)
{
+ if (configureOptions != default)
+ {
+ services.Configure(configureOptions);
+ }
return services.AddLocalization();
}
}