MenuLibrary 1.1.24

dotnet add package MenuLibrary --version 1.1.24
NuGet\Install-Package MenuLibrary -Version 1.1.24
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MenuLibrary" Version="1.1.24" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MenuLibrary --version 1.1.24
#r "nuget: MenuLibrary, 1.1.24"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MenuLibrary as a Cake Addin
#addin nuget:?package=MenuLibrary&version=1.1.24

// Install MenuLibrary as a Cake Tool
#tool nuget:?package=MenuLibrary&version=1.1.24

Quality Gate Status codecov

A simple ASP.NET / NPM library pair to automate the production of the left hand menu.

This has probably been done elsewhere and more than likely better, but you don't learn unless you try.

Packages

There are two packages included in this project:

Cookies

This impemtation uses a cookie to track whether the menu is open or closed.

To Use

You need to configure which controller methods will be displayed in the menu, and then call the menu in the HTML.

Decorations

The valid list of decorations are:

  • Display - Display the method as a menu item, default = True
  • Order - Order of item on menu Display
  • Name - Display name
  • Icon - Icon, default = fas-circle
  • Route - Route, default = Home
  • ClassNavItem - Class of Nav Item
  • ClassNavLink - Class on Nav Link
  • IconGroup - Icon group, default = fas
  • Parent - Parent nav item, default = None

Use in Controllers

Simply add decoarations to your Control. The minimum decoration you needs is the Name

        [MenuLibrary.MenuAttributes(Name = "Documentation", Icon = "fa-book" , Order = 50 )]
        public IActionResult Docs()
        {
            return Redirect("https://sfawcett123.github.io/FlightSimulator/");
        }

Use in HTML

To include in your layouts page, you simply need to call the LeftMenu Method

@using MenuLibrary
<script src="~/lib/menulibrary/dist/js/menu.js"></script>
<link href="~/lib/menulibrary/dist/css/menu.css" rel="stylesheet" />

<body id=@Menu.BODY_ID>
    <header class="header" id="header">
        <div class="navbar_left header_toggle">
            <a class="navbar_brand">Demo</a>
        </div>
    </header>

    @Html.Raw( LeftMenu.Display( Menu.GetSubClasses<Controller>()) )

    
    <div class="content">
        Something interesting
    
    </div
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.24 230 11/17/2023
1.1.23 110 11/17/2023
1.1.22 105 11/17/2023
1.1.21 106 11/17/2023
1.1.20 111 11/17/2023
1.1.19 115 11/17/2023
1.1.18 92 11/17/2023
1.1.17 107 11/17/2023
1.1.16 103 11/17/2023
1.1.15 174 5/9/2023
1.1.14 190 5/2/2023
1.1.13 145 5/2/2023
1.1.12 187 4/17/2023
1.1.11 191 4/11/2023
1.1.10 192 4/3/2023
1.1.9 216 3/27/2023
1.1.8 213 3/21/2023
1.1.7 194 3/21/2023
1.1.6 209 3/14/2023
1.1.5 197 3/14/2023
1.1.4 300 1/23/2023
1.1.2 284 1/23/2023
1.1.1 278 1/20/2023
1.0.18 285 1/20/2023
1.0.17 280 1/20/2023
1.0.16 283 1/20/2023
1.0.15 292 1/20/2023
1.0.14 291 1/20/2023
1.0.13 261 1/20/2023
1.0.12 286 1/20/2023
1.0.11 278 1/19/2023
1.0.10 302 1/4/2023
1.0.9 278 1/3/2023
1.0.8 285 1/3/2023
1.0.7 285 1/3/2023
1.0.6 290 12/12/2022
1.0.5 279 12/12/2022
1.0.4 294 12/28/2022
1.0.3 300 12/28/2022
1.0.2 310 12/28/2022
1.0.1 270 12/12/2022
1.0.0 331 11/4/2022