Infer dark mode
Infer dark mode based on system preferences.
import { Tldraw } from 'tldraw'
import 'tldraw/tldraw.css'
export default function InferDarkModeExample() {
return (
<div className="tldraw__editor">
<Tldraw inferDarkMode />
</div>
)
}
When the Tldraw component's inferDarkMode is true, the editor will infer its initial theme based on the user's system preferences, if available. You can toggle the dark mode by pressing Command + /.
Is this page helpful?
Prev
Force mobile layoutNext
Toggle dark mode