Edit this page

+bodyAttributes

Environment: server
type Value = Record<string, string>
type BodyAttributes = Value | ((pageContext) => Value)

Global
Cumulative
Provided by: vike-react/vike-vue/vike-solid

You need vike-react/vike-vue/vike-solid to be able to use this setting.

The bodyAttributes setting adds attributes to the <body> tag.

// pages/+config.ts
 
import type { Config } from 'vike/types'
 
export default {
  // <body class="dark">
  bodyAttributes: { class: 'dark' }
} satisfies Config

See also