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.
style keep it off any
version-specific API.deps.edn:
{:deps {io.github.jramosg/reagent-mui-nested-menu {:mvn/version "0.1.0"}
reagent/reagent {:mvn/version "2.0.1"}}}
npm install reagent-mui-nested-menu
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"
}
}
(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.
The full guide and the API reference live on cljdoc:
Public API: the single namespace reagent-mui-nested-menu.core.
Build, test, publish and demo instructions live in DEVELOPMENT.md.
Port of mui-nested-menu by steviebuilds.
MIT.
Can you improve this documentation? These fine people already did:
Jon, Jon Ramos & j-ramosEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |