Blazor wrapper for the gridstack.js library.
Credits go to the BlazorGridStack project, from which this wrapper took inspiration.
dotnet add package Itemzen.GridStack.BlazorThe version of the nuget package matches the gridstack version against which the wrapper was created,
including a version suffix indicating the wrapper release number. For example, v10.1.0-r2 indicates the
second release of the wrapper for version 10.2.0 of the gridstack library.
Note that it is in general fine to use/include a different (minor) gridstack version in your project, especially bugfix releases, but if things don't work as expected it might be best to try and match the gridstack version exactly.
Download the gridstack files from npm
npm install --save gridstackCopy the relevant files over from the node_modules/gridstack/dist to your Blazor project
wwwroot/lib/gridstack-all.js
wwwroot/lib/gridstack.min.cssAdd the following lines in wwwroot/index.html
<head>
...
<link href="lib/gridstack.min.css" rel="stylesheet" />
</head>
<body>
...
<script src="lib/gridstack-all.js"></script>
</body>Add a reference to the relevant namespace in the top-level _Imports.razor file of your project
@using GridStack.BlazorThe wrapper adds two components: GsGrid and GsWidget.
<GsGrid Options="...">
<GsWidget Options="...">
<div>The widget layout</div>
</GsWidget>
</GsGrid>The widgets can be added to the grid using markup (as shown above), or programatically using the GsGrid API.
The demo project contains additional details.