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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<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_kxc' 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_kxc'>
<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'>
<button aria-controls='usa-nav__submenu_kxw' aria-expanded='false' class='usa-accordion__button usa-nav__link'>
<span>Section</span>
</button>
<ul class='usa-nav__submenu' id='usa-nav__submenu_kxw'>
<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>
</ul>
<form class="usa-search usa-search--small" role="search">
<label class="usa-sr-only" for="basic-search-field-en-small">
Search
</label>
<input class="usa-input" id="basic-search-field-en-small" type="search" name="search"/>
<button class="usa-button" type="submit">
<img src="https://cdn.jsdelivr.net/npm/uswds@2.13.0/dist/img/usa-icons-bg/search--white.svg" class="usa-search__submit-icon" alt="Search"/>
</button>
</form>
</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
24
25
26
27
28
29
30
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(title: 'Section') 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')
raw('
<form class="usa-search usa-search--small" role="search">
<label class="usa-sr-only" for="basic-search-field-en-small">
Search
</label>
<input class="usa-input" id="basic-search-field-en-small" type="search" name="search"/>
<button class="usa-button" type="submit">
<img src="https://cdn.jsdelivr.net/npm/uswds@2.13.0/dist/img/usa-icons-bg/search--white.svg" class="usa-search__submit-icon" alt="Search"/>
</button>
</form>')
end