Class: DsfrComponent::ModalComponent

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

Constant Summary

Constants inherited from Base

Base::HEADING_LEVELS

Instance Attribute Summary

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Constructor Details

#initialize(title:, opened: false, classes: [], html_attributes: {}) ⇒ ModalComponent

Returns a new instance of ModalComponent.

Parameters:

  • title (String)

    Titre de la modale

  • opened (Boolean) (defaults to: false)

    Ouvre la modale dès le chargement de la page



8
9
10
11
12
13
14
# File 'app/components/dsfr_component/modal_component.rb', line 8

def initialize(title:, opened: false, classes: [], html_attributes: {})
  @title = title
  @opened = opened

  @id = html_attributes[:id]
  super(classes: classes, html_attributes: html_attributes)
end