bodyAttributes
Type: object | (pageContext) => object
Kind: global.
Environment: server.
Implemented 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.
Global
This setting is global: its value always applies to all your pages. In other words, it doesn't support config inheritance.
You cannot set it at
pages/some-page/+config.js
: you have to set it atpages/+config.js
(or some other global location) instead.
If you want to set different values for different pages, then consider creating a custom setting as shown at Guides >
<head>
tags > Custom settings.