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
<!-- Size small --><segmented-control> <ul aria-label="Billing duration" role="list" data-view-component="true" class="SegmentedControl--small SegmentedControl"> <li class="SegmentedControl-item" role="listitem" data-targets="segmented-control.items"> <button data-action="click:segmented-control#select" aria-current="false" type="button" data-view-component="true" class="Button--invisible Button--small Button Button--invisible-noVisuals"> <span class="Button-content"> <span class="Button-label">Monthly</span> </span> </button> </li> <li class="SegmentedControl-item SegmentedControl-item--selected" role="listitem" data-targets="segmented-control.items"> <button data-action="click:segmented-control#select" aria-current="true" type="button" data-view-component="true" class="Button--invisible Button--small Button"> <span class="Button-content"> <span class="Button-label">Yearly</span> <span class="Button-visual Button-trailingVisual"> <span data-view-component="true" class="Label Label--accent">-8%</span> </span> </span> </button> </li> </ul></segmented-control><!-- Size medium --><segmented-control> <ul aria-label="Billing duration" role="list" data-view-component="true" class="SegmentedControl--medium SegmentedControl"> <li class="SegmentedControl-item" role="listitem" data-targets="segmented-control.items"> <button data-action="click:segmented-control#select" aria-current="false" type="button" data-view-component="true" class="Button--invisible Button--medium Button Button--invisible-noVisuals"> <span class="Button-content"> <span class="Button-label">Monthly</span> </span> </button> </li> <li class="SegmentedControl-item SegmentedControl-item--selected" role="listitem" data-targets="segmented-control.items"> <button data-action="click:segmented-control#select" aria-current="true" type="button" data-view-component="true" class="Button--invisible Button--medium Button"> <span class="Button-content"> <span class="Button-label">Yearly</span> <span class="Button-visual Button-trailingVisual"> <span data-view-component="true" class="Label Label--accent">-8%</span> </span> </span> </button> </li> </ul></segmented-control>
No notes provided.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Size smallrender(Primer::Alpha::SegmentedControl.new("aria-label": "Billing duration", size: :small)) do |component| component.with_item(label: "Monthly") component.with_item(label: "Yearly", selected: true) do |button| button.with_trailing_visual_label(scheme: :accent) { "-8%" } endend# Size mediumrender(Primer::Alpha::SegmentedControl.new("aria-label": "Billing duration", size: :medium)) do |component| component.with_item(label: "Monthly") component.with_item(label: "Yearly", selected: true) do |button| button.with_trailing_visual_label(scheme: :accent) { "-8%" } endend
No params configured.