How can i change the dat.GUI text for "Open controls and "Close Controls

Hello Team,

I would like the dynamically change dat.GUI text for “Open Controls” and “Close Controls” by putting an up arrow and down arrow next to it. So it would be like:

“Open Controls V”, and “Close Controls ^”. Basically i want to put an up arrow and down arrow indicators next to the text for better UX experience. If those can be icons then that is even better.


dat.gui is quite a barebones GUI - to do custom stuff with it, it’s likely best to either copy the repo and apply changes in the code of dat.gui directly (repo is no longer maintained, so you won’t be missing any updates by forking it), or just hack around a little, ex.:

gui.domElement.querySelector('.close-button').innerHTML = 'New Label';
1 Like
dat.GUI.TEXT_OPEN = "Please, open me";
dat.GUI.TEXT_CLOSED = "No, don't click";

var gui = new dat.GUI();
gui.add( data, 'k', 0, 1 );

1 Like

Thank you so much for the good advice @PavelBoytchev and @mjurczyk. I will definitely try both solutions and see which one works better for me.


1 Like