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
<tab-container data-view-component="true"> <div data-view-component="true" class="UnderlineNav"> <ul role="tablist" aria-label="Test navigation" data-view-component="true" class="UnderlineNav-body list-style-none"> <li role="presentation" data-view-component="true" class="d-inline-flex"> <button id="tab-1" type="button" role="tab" aria-controls="panel-tab-1" aria-selected="true" data-view-component="true" class="UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star UnderlineNav-octicon"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <span data-view-component="true">Tab 1</span> <span title="5" data-view-component="true" class="Counter">5</span> </button></li> <li role="presentation" data-view-component="true" class="d-inline-flex"> <button id="tab-2" type="button" role="tab" aria-controls="panel-tab-2" data-view-component="true" class="UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star UnderlineNav-octicon"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <span data-view-component="true">Tab 2</span> <span title="10" data-view-component="true" class="Counter">10</span> </button></li> <li role="presentation" data-view-component="true" class="d-inline-flex"> <button id="tab-3" type="button" role="tab" aria-controls="panel-tab-3" data-view-component="true" class="UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star UnderlineNav-octicon"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <span data-view-component="true">Tab 3</span> <span title="15" data-view-component="true" class="Counter">15</span> </button></li> </ul> </div> <div id="panel-tab-1" role="tabpanel" tabindex="0" aria-labelledby="tab-1" data-view-component="true">Panel 1</div> <div id="panel-tab-2" role="tabpanel" tabindex="0" hidden="hidden" aria-labelledby="tab-2" data-view-component="true">Panel 2</div> <div id="panel-tab-3" role="tabpanel" tabindex="0" hidden="hidden" aria-labelledby="tab-3" data-view-component="true">Panel 3</div></tab-container>
1
2
3
4
5
6
7
8
9
10
render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component| Array.new(number_of_panels || 3) do |i| component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab| tab.with_panel { "Panel #{i + 1}" } tab.with_text { "Tab #{i + 1}" } tab.with_icon(icon: :star) tab.with_counter(count: (i + 1) * 5) end endend
No notes provided.
Param | Description | Input |
---|---|---|
— |
|
|
— |
|
No assets to display.