Liking cljdoc? Tell your friends :D

reagent-mui-nested-menu

Clojars Project npm cljdoc License: MIT

Nested MUI menus for Reagent/ClojureScript and React: a dropdown, a right-click context menu, per-item icons, custom labels and keyboard navigation. A ClojureScript port of mui-nested-menu by steviebuilds.

  • No CSS to import. Pointer-events and the caret rotation ship inline.
  • MUI v5 to v9. Subpath imports and inline style keep it off any version-specific API.
  • Clojars and npm. One source builds the Reagent jar and the React package.

Live demo →

Example GIF

Install

ClojureScript (Clojars)

deps.edn:

{:deps {io.github.jramosg/reagent-mui-nested-menu {:mvn/version "0.1.0"}
        reagent/reagent {:mvn/version "2.0.1"}}}

React (npm)

npm install reagent-mui-nested-menu

Peer dependencies

MUI and React are peers (you provide them). MUI v5 and v6 need Emotion; v7 and later make it optional.

{
  "peerDependencies": {
    "@mui/material": ">=5 <10",
    "react": ">=17 <20",
    "react-dom": ">=17 <20",
    "@emotion/react": ">=11",
    "@emotion/styled": ">=11"
  }
}

Quick start (CLJS)

(ns my.app
  (:require [reagent-mui-nested-menu.core :refer [nested-menu]]))

[nested-menu
 {:button-props {:label "Open"}
  :items [{:label "New file" :callback (fn [_e _item] (prn "new"))}
          {:label "Export"
           :items [{:label "PDF"  :callback (fn [_e _item] (prn "pdf"))}
                   {:label "JSON" :callback (fn [_e _item] (prn "json"))}]}]}]

No CSS import needed.

Documentation

The full guide and the API reference live on cljdoc:

  • Menus from data: components, item maps, nesting, icons, selection and the context menu.
  • React usage: the npm package and JSX examples.
  • Styling: class hooks and per-item styles.

Public API: the single namespace reagent-mui-nested-menu.core.

Development

Build, test, publish and demo instructions live in DEVELOPMENT.md.

Credits

Port of mui-nested-menu by steviebuilds.

License

MIT.

Can you improve this documentation? These fine people already did:
Jon, Jon Ramos & j-ramos
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close