MenuLibrary 1.0.7

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

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

Quality Gate Status

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 297 11/17/2023
1.1.23 119 11/17/2023
1.1.22 124 11/17/2023
1.1.21 126 11/17/2023
1.1.20 134 11/17/2023
1.1.19 132 11/17/2023
1.1.18 111 11/17/2023
1.1.17 128 11/17/2023
1.1.16 128 11/17/2023
1.1.15 204 5/9/2023
1.1.14 208 5/2/2023
1.1.13 160 5/2/2023
1.1.12 210 4/17/2023
1.1.11 211 4/11/2023
1.1.10 212 4/3/2023
1.1.9 242 3/27/2023
1.1.8 236 3/21/2023
1.1.7 217 3/21/2023
1.1.6 226 3/14/2023
1.1.5 212 3/14/2023
1.1.4 326 1/23/2023
1.1.2 295 1/23/2023
1.1.1 304 1/20/2023
1.0.18 310 1/20/2023
1.0.17 304 1/20/2023
1.0.16 309 1/20/2023
1.0.15 310 1/20/2023
1.0.14 309 1/20/2023
1.0.13 279 1/20/2023
1.0.12 304 1/20/2023
1.0.11 296 1/19/2023
1.0.10 322 1/4/2023
1.0.9 303 1/3/2023
1.0.8 304 1/3/2023
1.0.7 311 1/3/2023
1.0.6 308 12/12/2022
1.0.5 303 12/12/2022
1.0.4 313 12/28/2022
1.0.3 327 12/28/2022
1.0.2 340 12/28/2022
1.0.1 295 12/12/2022
1.0.0 352 11/4/2022