Settings @giro3d/piero
Adds a panel to change user ettings such as dark/light color mode.
Usage with createPieroApp
js
import { panels } from '@giro3d/piero/modules';
createPieroApp({
...
modules: [
panels.Settings
...
]
})Usage
This module adds a settings panel to the application that allows users to save their own settings, such as the color theme.
Switching between dark and light color modes
Piero uses the Bootstrap framework. Changing the color mode is done through the data-bs-theme attribute.
This attribute will be set on the DOM element that contains the Piero instance (the root element that was passed when creating the app with createPieroApp().)
TIP
You can set the data-bs-theme attribute yourself directly on the DOM element before calling createPieroApp(), for example :
js
element.setAttribute('data-bs-theme', 'dark');This is useful if you don't intend to let users change the color mode or if you want to use a different UI to do so.