Skip to content
Discussion options

You must be logged in to vote

Hi @madinah-arabic !

I think you will have to initialize the Sidenav via JS, since you want to use a condition for setting the width of the sidenav. Remove the data-twe-sidenav-init attribute and change the fixed class to relative (in the nav element). Then you can use the js to initialize the sidenav:

import { Sidenav } from "tw-elements";

const sidenavEl = document.getElementById("sidenav-1");
const condition = true;

const instance = new Sidenav(sidenavEl, {
  sidenavAccordion: !1,
  sidenavBackdrop: !1,
  sidenavCloseOnEsc: !1,
  sidenavColor: "success",
  sidenavContent: "#content",
  sidenavScrollContainer: "",
  sidenavHidden: !1,
  sidenavMode: "side",
  sidenavPosition: "relativ…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@madinah-arabic
Comment options

@juujisai
Comment options

@madinah-arabic
Comment options

@juujisai
Comment options

@madinah-arabic
Comment options

Answer selected by madinah-arabic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants