Edit this page

+htmlAttributes

Environment: server
type Value = Record<string, string>
type HtmlAttributes = 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 htmlAttributes setting adds attributes to the <html> tag.

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

See lang if you merely want to set the <html lang> attribute.

See also