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
<%# With caption %><div> <strong>NOTE: </strong>The <pre style="display: inline">FormControl </pre>component cannot automatically connect the label to the provided input. Please take care to pass the <pre style="display: inline">for:</pre> attribute to <pre style="display: inline">FormControl</pre>, eg: <pre style="display: inline">Primer::Alpha::FormControl.new(label_arguments: { for: "field-name-or-id" })</pre>. - Your friendly neighborhood accessibility team.</div><br><%= form_with(url: "/foo") do |f| %> <%= render(Primer::Alpha::FormControl.new(**system_arguments, label_arguments: { for: "bar" })) do |component| %> <% component.with_input do |input_arguments| %> <%= f.text_field(:bar, **input_arguments) %> <% end %> <% end %><% end %><%# With validation message %><div> <strong>NOTE: </strong>The <pre style="display: inline">FormControl </pre>component cannot automatically connect the label to the provided input. Please take care to pass the <pre style="display: inline">for:</pre> attribute to <pre style="display: inline">FormControl</pre>, eg: <pre style="display: inline">Primer::Alpha::FormControl.new(label_arguments: { for: "field-name-or-id" })</pre>. - Your friendly neighborhood accessibility team.</div><br><%= form_with(url: "/foo") do |f| %> <%= render(Primer::Alpha::FormControl.new(**system_arguments, label_arguments: { for: "bar" })) do |component| %> <% component.with_input do |input_arguments| %> <%= f.text_field(:bar, **input_arguments) %> <% end %> <% end %><% end %><%# Required %><div> <strong>NOTE: </strong>The <pre style="display: inline">FormControl </pre>component cannot automatically connect the label to the provided input. Please take care to pass the <pre style="display: inline">for:</pre> attribute to <pre style="display: inline">FormControl</pre>, eg: <pre style="display: inline">Primer::Alpha::FormControl.new(label_arguments: { for: "field-name-or-id" })</pre>. - Your friendly neighborhood accessibility team.</div><br><%= form_with(url: "/foo") do |f| %> <%= render(Primer::Alpha::FormControl.new(**system_arguments, label_arguments: { for: "bar" })) do |component| %> <% component.with_input do |input_arguments| %> <%= f.text_field(:bar, **input_arguments) %> <% end %> <% end %><% end %><%# With visually hidden label %><div> <strong>NOTE: </strong>The <pre style="display: inline">FormControl </pre>component cannot automatically connect the label to the provided input. Please take care to pass the <pre style="display: inline">for:</pre> attribute to <pre style="display: inline">FormControl</pre>, eg: <pre style="display: inline">Primer::Alpha::FormControl.new(label_arguments: { for: "field-name-or-id" })</pre>. - Your friendly neighborhood accessibility team.</div><br><%= form_with(url: "/foo") do |f| %> <%= render(Primer::Alpha::FormControl.new(**system_arguments, label_arguments: { for: "bar" })) do |component| %> <% component.with_input do |input_arguments| %> <%= f.text_field(:bar, **input_arguments) %> <% end %> <% end %><% end %>