Class: DsfrComponent::HeaderComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/dsfr_component/header_component.rb

Defined Under Namespace

Classes: DirectLinkComponent, DirectLinkDropdownComponent, OperatorImageComponent, ToolLinkComponent

Constant Summary

Constants inherited from Base

Base::HEADING_LEVELS, Base::SIZES

Instance Attribute Summary

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Constructor Details

#initialize(logo_text:, title: nil, href: "/", tagline: nil, html_attributes: {}) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.

Parameters:

  • logo_text (String)

    Ce texte obligatoire sera affiché en dessous de la Marianne et au dessus de la devise française. C’est généralement un nom de ministère ou d’administration.

  • title (String) (defaults to: nil)

    Le nom du service numérique, titre principal du site (optionnel).

  • href (String) (defaults to: "/")

    L’URL de la page d’accueil du site. Par défaut “/”. Passer nil pour ne pas rendre de lien.

  • tagline (String) (defaults to: nil)

    La description du service numérique, sous-titre du site (optionnelle).



15
16
17
18
19
20
21
22
# File 'app/components/dsfr_component/header_component.rb', line 15

def initialize(logo_text:, title: nil, href: "/", tagline: nil, html_attributes: {})
  @logo_text = logo_text
  @title = title
  @href = href
  @tagline = tagline

  super(html_attributes: html_attributes)
end