x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<header class='usa-header usa-header--basic'>
<div class='usa-nav-container'>
<div class='usa-navbar'>
<div class='usa-logo' id='basic-logo'>
<em class='usa-logo__text'>
<a title="Project Title" href="#">Project Title
</a></em>
</div>
<button class='usa-menu-btn'>Menu</button>
</div>
<nav aria-label='Primary navigation' class='usa-nav'>
<button class='usa-nav__close'>
<img alt='Close' role='img' src='https://cdn.jsdelivr.net/npm/uswds@2.13.0/dist/img/usa-icons/close.svg'>
</button>
<ul class='usa-nav__primary usa-accordion'>
<li class='usa-nav__primary-item'>
<button aria-controls='usa-nav__submenu_l18' aria-expanded='false' class='usa-accordion__button usa-nav__link usa-current'>
<span>Current Section</span>
</button>
<ul class='usa-nav__submenu' id='usa-nav__submenu_l18'>
<li class='usa-nav__submenu-item'>
<a href="">Navigation link
</a></li>
<li class='usa-nav__submenu-item'>
<a href="">Navigation link
</a></li>
<li class='usa-nav__submenu-item'>
<a href="">Navigation link
</a></li>
</ul>
</li>
<li class='usa-nav__primary-item'>
<a class="usa-nav__link" href="#"><span>Simple link</span>
</a></li>
<li class='usa-nav__primary-item'>
<form>
<button class="width-full">
Sign out
</button>
</form>
</li>
</ul>
</nav>
</div>
</header>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
render UswdsComponents::BasicHeaderComponent.new(
image_path: 'https://cdn.jsdelivr.net/npm/uswds@2.13.0/dist/img',
) do |header|
header.with_logo(href: '#', title: 'Project Title')
header.with_primary_item(title: 'Current Section', current: true) do |item|
item.with_submenu_item(href: '', name: 'Navigation link')
item.with_submenu_item(href: '', name: 'Navigation link')
item.with_submenu_item(href: '', name: 'Navigation link')
end
header.with_primary_item(href: '#', title: 'Simple link')
header.with_primary_item do
raw('
<form>
<button class="width-full">
Sign out
</button>
</form>
')
end
end