Skip to content

useTheme()

const { name, variables, styles, setVariable } = useTheme()
setVariable('--rs-accent', '#ff5722')

setVariable updates a single variable at runtime. Other variables stay merged with the original theme.

defineTheme(theme)

Identity helper for type-checked theme literals.

import { defineTheme } from '@react-slides/themes'
export const ocean = defineTheme({
name: 'ocean',
variables: {
'--rs-bg': '#001f3f',
'--rs-fg': '#7fdbff',
'--rs-accent': '#39cccc',
},
})

Reset CSS

<ThemeProvider> includes the reset unless you pass reset={false}. Without a ThemeProvider, import it directly:

import '@react-slides/themes/reset.css'