MenuLibrary 1.1.19

There is a newer version of this package available.
See the version list below for details.
dotnet add package MenuLibrary --version 1.1.19                
NuGet\Install-Package MenuLibrary -Version 1.1.19                
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.19" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MenuLibrary --version 1.1.19                
#r "nuget: MenuLibrary, 1.1.19"                
#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.19

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

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 285 11/17/2023
1.1.23 118 11/17/2023
1.1.22 123 11/17/2023
1.1.21 123 11/17/2023
1.1.20 133 11/17/2023
1.1.19 131 11/17/2023
1.1.18 110 11/17/2023
1.1.17 125 11/17/2023
1.1.16 125 11/17/2023
1.1.15 203 5/9/2023
1.1.14 207 5/2/2023
1.1.13 159 5/2/2023
1.1.12 209 4/17/2023
1.1.11 210 4/11/2023
1.1.10 209 4/3/2023
1.1.9 241 3/27/2023
1.1.8 235 3/21/2023
1.1.7 216 3/21/2023
1.1.6 225 3/14/2023
1.1.5 211 3/14/2023
1.1.4 325 1/23/2023
1.1.2 294 1/23/2023
1.1.1 303 1/20/2023
1.0.18 309 1/20/2023
1.0.17 301 1/20/2023
1.0.16 308 1/20/2023
1.0.15 309 1/20/2023
1.0.14 306 1/20/2023
1.0.13 278 1/20/2023
1.0.12 303 1/20/2023
1.0.11 295 1/19/2023
1.0.10 321 1/4/2023
1.0.9 302 1/3/2023
1.0.8 303 1/3/2023
1.0.7 310 1/3/2023
1.0.6 307 12/12/2022
1.0.5 302 12/12/2022
1.0.4 312 12/28/2022
1.0.3 326 12/28/2022
1.0.2 336 12/28/2022
1.0.1 294 12/12/2022
1.0.0 351 11/4/2022