BlazorSplitGrid 1.9.1
dotnet add package BlazorSplitGrid --version 1.9.1
NuGet\Install-Package BlazorSplitGrid -Version 1.9.1
<PackageReference Include="BlazorSplitGrid" Version="1.9.1" />
<PackageVersion Include="BlazorSplitGrid" Version="1.9.1" />
<PackageReference Include="BlazorSplitGrid" />
paket add BlazorSplitGrid --version 1.9.1
#r "nuget: BlazorSplitGrid, 1.9.1"
#:package BlazorSplitGrid@1.9.1
#addin nuget:?package=BlazorSplitGrid&version=1.9.1
#tool nuget:?package=BlazorSplitGrid&version=1.9.1
Blazor Split Grid
A basic Blazor component wrapper around Split Grid.
Prerequisites
- A system that can compile and run the .NET Framework
- .NET SDK
- A code editor, we recommend Jet Brains Rider, Visual Studio or VS Code
Installation Guide
- Install the Nuget Package
dotnet add package BlazorSplit
- Add namespace reference to your
_Imports.razor
@using BlazorSplitGrid
- Add the following to the end of your HTML body section, it's either
index.html
or_Layout.cshtml/_Host.cshtml
depending on whether you're running WebAssembly or Server, it should be in the same location as the default blazor script.<script src="_content/BlazorSplitGrid/splitGrid/split-grid.min.js"></script>
- Optional In the same file but located in the HTML head section, you can add basic gutter styling by including
the following css
<link href="_content/BlazorSplitGrid/BlazorSplitGrid.min.css" rel="stylesheet" />
Usage
Blazor Split Grid will automatically generate the track number and classes for your gutters so all you need to specify is whether the gutter is a row or column.
<SplitGrid SnapOffset="0" DragInterval="1" MaxSize="850">
<SplitGridContent></SplitGridContent>
<SplitGridColumn/>
<SplitGridContent></SplitGridContent>
<SplitGridRow/>
<SplitGridContent></SplitGridContent>
<SplitGridContent></SplitGridContent>
</SplitGrid>
Example
See the example project for a more comprehensive example.
API Reference
SplitGrid
You are able to specify all
the Split Grid options on the top level
SplitGrid
component except the row and column gutters.
Attribute | Type | Default | Description |
---|---|---|---|
MinSize | int | 0 | The minimum size in pixels for all tracks. |
MaxSize | int | Infinity | The maximum size in pixels for all tracks. |
ColumnMinSize | int | MinSize | The minimum size in pixels for all tracks. |
RowMinSize | int | MinSize | The minimum size in pixels for all tracks. |
ColumnMaxSize | int | MaxSize | The maximum size in pixels for all tracks. |
RowMaxSize | int | MaxSize | The maximum size in pixels for all tracks. |
ColumnMinSizes | Dictionary<int, int> | ColumnMinSize | An object keyed by track index, with values set to the minimum size in pixels for the track at that index. Allows individual minSizes to be specified by track. Note this option is plural with an s, while the two fallback options are singular. |
RowMinSizes | Dictionary<int, int> | RowMinSize | object keyed by track index, with values set to the minimum size in pixels for the track at that index. Allows individual minSizes to be specified by track. Note this option is plural with an s, while the two fallback options are singular. |
ColumnMaxSizes | Dictionary<int, int> | ColumnMaxSize | An object keyed by track index, with values set to the maximum size in pixels for the track at that index. Allows individual maxSizes to be specified by track. Note this option is plural with an s, while the two fallback options are singular. |
RowMaxSizes | Dictionary<int, int> | RowMaxSize | An object keyed by track index, with values set to the maximum size in pixels for the track at that index. Allows individual maxSizes to be specified by track. Note this option is plural with an s, while the two fallback options are singular. |
SnapOffset | int | 30 | Snap to minimum size at this offset in pixels. Set to 0 to disable snap. |
ColumnSnapOffset | int | SnapOffset | Snap to minimum size at this offset in pixels. Set to 0 to disable snap. |
RowSnapOffset | int | SnapOffset | Snap to minimum size at this offset in pixels. Set to 0 to disable snap. |
DragInterval | int | 1 | Drag this number of pixels at a time. Defaults to 1 for smooth dragging, but can be set to a pixel value to give more control over the resulting sizes. |
ColumnDragInterval | int | DragInterval | Drag this number of pixels at a time. Defaults to 1 for smooth dragging, but can be set to a pixel value to give more control over the resulting sizes. |
RowDragInterval | int | DragInterval | Drag this number of pixels at a time. Defaults to 1 for smooth dragging, but can be set to a pixel value to give more control over the resulting sizes. |
Cursor | string | 'col-resize' and 'row-resize' | Cursor to show while dragging. Defaults to 'col-resize' for column gutters and 'row-resize' for row gutters. |
ColumnCursor | string | 'col-resize' | Cursor to show while dragging. |
RowCursor | string | 'row-resize' | Cursor to show while dragging. |
OnDrag | DragEventArgs | - | Called continuously on drag. For process intensive code, add a debounce function to rate limit this callback. gridTemplateStyle is the computed CSS value for grid-template-column or grid-template-row, depending on direction. |
OnDragStart | DragEventArgs | - | Called on drag start. |
OnDragEnd | DragEventArgs | - | Called on drag end. |
OnColumnsResized | SizeEventArgs | - | Called when the control or any of the columns has been resized (on drag stop). The event contains the new sizes of the columns in pixels as well as the raw size string returned by GetSizes |
OnRowsResized | SizeEventArgs | - | Called when the control or any of the rows has been resized (on drag stop). The event contains the new sizes of the rows in pixels as well as the raw size string returned by GetSizes |
ResizeDebounceTime | TimeSpan | 1s | The time to wait before OnColumnsResized and OnRowsResized are called when the control itself resizes. This is here to avoid performance issues when resizing multiple columns/rows at once. The default is 1 second. |
SplitGridRow / SplitGridColumn
You can specify the MinSize and MaxSize on the gutters which is automatically added to the ColumnMinSizes/RowMinSizes and ColumnMaxSizes/RowMaxSizes properties.
Attribute | Type | Default | Description |
---|---|---|---|
MinSize | int | 0 | The minimum size in pixels for this track. |
MaxSize | int | Infinity | The maximum size in pixels for this track. |
Contributing
For more details check out our contributing guide.
When contributing please keep in mind the Code of Conduct.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components (>= 8.0.18)
- Microsoft.AspNetCore.Components.Web (>= 8.0.18)
-
net9.0
- Microsoft.AspNetCore.Components (>= 9.0.7)
- Microsoft.AspNetCore.Components.Web (>= 9.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
RELEASE_NOTES.md