Method: Primer::Beta::NavList::Heading#initialize

Defined in:
app/components/primer/beta/nav_list/heading.rb

#initialize(title:, id: self.class.generate_id, heading_level: 2, **system_arguments) ⇒ Heading

Returns a new instance of Heading.

Parameters:

  • title (String)

    The text content of the heading.

  • id (String) (defaults to: self.class.generate_id)

    The value of the ID HTML attribute. Auto-generated by default.

  • heading_level (Integer) (defaults to: 2)

    The heading level, i.e. 2 for an ‘<h2>`, 3 for an `<h3>`, etc.

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>

[View source]

16
17
18
19
20
21
# File 'app/components/primer/beta/nav_list/heading.rb', line 16

def initialize(title:, id: self.class.generate_id, heading_level: 2, **system_arguments)
  @title = title
  @id = id
  @heading_level = heading_level
  @system_arguments = system_arguments
end