Helmet API

The Helmet API is an API to manipulate elements resided in the <head /> element.

Elements can be applied with the Helmet component.

fn main() {
html! {
        // The title of current page.
        <title>{"page a title"}</title>

The Helmet API supports the following elements:

  • title
  • style
  • script
  • base
  • link
  • meta

The Helmet API supports setting attributes of the following elements:

  • html
  • body

Helmet Bridge

The <HelmetBridge /> component is used to customise the behaviour and responsible of reconciling the elements to the <head /> element.

fn main() {
html! {
        <HelmetBridge default_title="default title" />
        // other components.

The Helmet Bridge component accepts two properties, a default_title which will be applied when no other title elements are registered and a format_title function which is used to format the title before it is passed to the document.

API Reference: