The current selection is highlighted in the tree and the matching ancestor groups stay open so
users never lose context inside a dense information hierarchy.
-
-
Route
-
{activePath}
+
+
Route
+
{activePath}
-
-
Presentation
-
{compact ? "Mobile drawer" : "Desktop sidebar"}
+
+
Presentation
+
{compact ? "Mobile drawer" : "Desktop sidebar"}
-
-
Open sections
-
+
+
Open sections
+
{Object.values(expanded).filter(Boolean).length}
-
-
Preview content
-
+
+
Preview content
+
This layout is designed for admin panels and content-heavy applications. The recursive tree can
support additional levels without changing the rendering model, and the mobile drawer preserves
usable navigation in narrow screens.
@@ -276,7 +312,9 @@ export default function ResponsiveMultiLevelNavigation() {
key={path}
onClick={() => selectPath(path)}
className={`rounded-2xl px-4 py-3 text-left text-sm transition ${
- path === activePath ? "bg-slate-900 text-white" : "bg-slate-50 hover:bg-slate-100"
+ path === activePath
+ ? "bg-slate-900 text-white dark:bg-white dark:text-slate-900"
+ : "bg-slate-50 hover:bg-slate-100 dark:bg-slate-800 dark:hover:bg-slate-700/80 text-slate-700 dark:text-slate-200"
}`}
>
{path}
diff --git a/src/index.css b/src/index.css
index 99ecbf72..6ca7a387 100644
--- a/src/index.css
+++ b/src/index.css
@@ -105,3 +105,18 @@ html, body {
* {
min-width: 0;
}
+
+/* Responsive media */
+img, video {
+ max-width: 100%;
+ height: auto;
+}
+
+/* Prevent horizontal scroll on mobile */
+html, body {
+ overflow-x: hidden;
+}
+
+* {
+ min-width: 0;
+}