Previews

No matching results.

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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!-- With caption -->
<div data-view-component="true" class="FormControl">
<label data-view-component="true" class="FormControl-label">
Best character
</label> <segmented-control>
<ul aria-label="Best character" aria-describedby="caption-form-control-5d481f1a-5523-4570-97bf-4de9f2891a52" role="list" data-view-component="true" class="SegmentedControl--medium SegmentedControl">
<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 Button--invisible-noVisuals"> <span class="Button-content">
<span class="Button-label">Han Solo</span>
</span>
</button>
</li>
<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">Luke Skywalker</span>
</span>
</button>
</li>
<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">Leia Organa</span>
</span>
</button>
</li>
</ul>
</segmented-control>
<span class="FormControl-caption" id="caption-form-control-5d481f1a-5523-4570-97bf-4de9f2891a52">
May the force be with you
</span>
</div>
<!-- With validation message -->
<div data-view-component="true" class="FormControl">
<label data-view-component="true" class="FormControl-label">
Best character
</label> <segmented-control>
<ul aria-label="Best character" aria-describedby="validation-form-control-99e12f08-e024-46e7-a395-4323f5e1f2c9" role="list" data-view-component="true" class="SegmentedControl--medium SegmentedControl">
<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 Button--invisible-noVisuals"> <span class="Button-content">
<span class="Button-label">Han Solo</span>
</span>
</button>
</li>
<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">Luke Skywalker</span>
</span>
</button>
</li>
<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">Leia Organa</span>
</span>
</button>
</li>
</ul>
</segmented-control>
<div id="validation-form-control-99e12f08-e024-46e7-a395-4323f5e1f2c9" data-view-component="true" class="FormControl-inlineValidation">
<span class="FormControl-inlineValidation--visual"><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill">
<path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path>
</svg></span>
<span>Something went wrong</span>
</div>
</div>
<!-- Required -->
<div data-view-component="true" class="FormControl">
<label data-view-component="true" class="FormControl-label">
Best character
<span aria-hidden="true">*</span>
</label> <segmented-control>
<ul aria-label="Best character" role="list" data-view-component="true" class="SegmentedControl--medium SegmentedControl">
<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 Button--invisible-noVisuals"> <span class="Button-content">
<span class="Button-label">Han Solo</span>
</span>
</button>
</li>
<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">Luke Skywalker</span>
</span>
</button>
</li>
<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">Leia Organa</span>
</span>
</button>
</li>
</ul>
</segmented-control>
</div>
<!-- With visually hidden label -->
<div data-view-component="true" class="FormControl">
<label data-view-component="true" class="FormControl-label sr-only">
Best character
</label> <segmented-control>
<ul aria-label="Best character" role="list" data-view-component="true" class="SegmentedControl--medium SegmentedControl">
<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 Button--invisible-noVisuals"> <span class="Button-content">
<span class="Button-label">Han Solo</span>
</span>
</button>
</li>
<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">Luke Skywalker</span>
</span>
</button>
</li>
<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">Leia Organa</span>
</span>
</button>
</li>
</ul>
</segmented-control>
</div>
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
<%# With caption %>
<%= render(Primer::Alpha::FormControl.new(**system_arguments)) do |component| %>
<% component.with_input do |input_arguments| %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": "Best character", **input_arguments)) do |seg| %>
<% seg.with_item(label: "Han Solo", selected: true) %>
<% seg.with_item(label: "Luke Skywalker") %>
<% seg.with_item(label: "Leia Organa") %>
<% end %>
<% end %>
<% end %>
<%# With validation message %>
<%= render(Primer::Alpha::FormControl.new(**system_arguments)) do |component| %>
<% component.with_input do |input_arguments| %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": "Best character", **input_arguments)) do |seg| %>
<% seg.with_item(label: "Han Solo", selected: true) %>
<% seg.with_item(label: "Luke Skywalker") %>
<% seg.with_item(label: "Leia Organa") %>
<% end %>
<% end %>
<% end %>
<%# Required %>
<%= render(Primer::Alpha::FormControl.new(**system_arguments)) do |component| %>
<% component.with_input do |input_arguments| %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": "Best character", **input_arguments)) do |seg| %>
<% seg.with_item(label: "Han Solo", selected: true) %>
<% seg.with_item(label: "Luke Skywalker") %>
<% seg.with_item(label: "Leia Organa") %>
<% end %>
<% end %>
<% end %>
<%# With visually hidden label %>
<%= render(Primer::Alpha::FormControl.new(**system_arguments)) do |component| %>
<% component.with_input do |input_arguments| %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": "Best character", **input_arguments)) do |seg| %>
<% seg.with_item(label: "Han Solo", selected: true) %>
<% seg.with_item(label: "Luke Skywalker") %>
<% seg.with_item(label: "Leia Organa") %>
<% end %>
<% end %>
<% end %>

No assets to display.