|
52 | 52 | <p class="docs-copy">Toggles switches can be extended to choose between two or more states where each state is represented by an icon. Using the <code>__multiple</code> toggle instead of a radio group and making sure labels follow their inputs in this case is important.</p> |
53 | 53 | <div class="docs-preview"> |
54 | 54 | {% highlight html %} |
55 | | -<div class="d-flex ai-center g8"> |
56 | | - <label class="s-label c-default">…</label> |
57 | | - <div class="s-toggle-switch s-toggle-switch__multiple"> |
58 | | - <input type="radio" name="group1" id="input-1" checked value="value1"> |
59 | | - <label for="input-1" aria-label="First value" title="First value">@Svg.Icon1</label> |
60 | | - <input type="radio" name="group1" id="input-2" value="value2"> |
61 | | - <label for="input-2" aria-label="Second value" title="Second value">@Svg.Icon2</label> |
62 | | - <input type="radio" name="group1" id="input-3" value="value3"> |
63 | | - <label for="input-3" aria-label="Third value" title="Third value">@Svg.Icon3</label> |
| 55 | +<fieldset> |
| 56 | + <div class="d-flex ai-center g8"> |
| 57 | + <legend class="s-label c-default">…</legend> |
| 58 | + <div class="s-toggle-switch s-toggle-switch__multiple"> |
| 59 | + <input type="radio" name="group1" id="input-1" checked value="value1"> |
| 60 | + <label for="input-1" aria-label="First value" title="First value">@Svg.Icon1</label> |
| 61 | + <input type="radio" name="group1" id="input-2" value="value2"> |
| 62 | + <label for="input-2" aria-label="Second value" title="Second value">@Svg.Icon2</label> |
| 63 | + <input type="radio" name="group1" id="input-3" value="value3"> |
| 64 | + <label for="input-3" aria-label="Third value" title="Third value">@Svg.Icon3</label> |
| 65 | + </div> |
64 | 66 | </div> |
65 | | -</div> |
| 67 | +</fieldset> |
66 | 68 | {% endhighlight %} |
67 | 69 | <div class="docs-preview--example d-flex fd-column g24"> |
68 | | - <div class="d-flex ai-center g8"> |
69 | | - <label class="c-default s-label">Search Style</label> |
70 | | - <div class="s-toggle-switch s-toggle-switch__multiple"> |
71 | | - <input type="radio" name="example1" id="assistant" checked value="ai"> |
72 | | - <label for="assistant" aria-label="AI Search" title="AI Search">{% icon "Assistant" %}</label> |
73 | | - <input type="radio" name="example1" id="search" value="lexical"> |
74 | | - <label for="search" aria-label="Lexical Search" title="Lexical Search">{% icon "Search" %}</label> |
| 70 | + <fieldset> |
| 71 | + <div class="d-flex ai-center g8"> |
| 72 | + <legend class="c-default s-label">Search Style</legend> |
| 73 | + <div class="s-toggle-switch s-toggle-switch__multiple"> |
| 74 | + <input type="radio" name="example1" id="assistant" checked value="ai"> |
| 75 | + <label for="assistant" aria-label="AI Search" title="AI Search">{% icon "Assistant" %}</label> |
| 76 | + <input type="radio" name="example1" id="search" value="lexical"> |
| 77 | + <label for="search" aria-label="Lexical Search" title="Lexical Search">{% icon "Search" %}</label> |
| 78 | + </div> |
75 | 79 | </div> |
76 | | - </div> |
77 | | - <div class="d-flex ai-center g8"> |
78 | | - <label class="c-default s-label">Export Type</label> |
79 | | - <div class="s-toggle-switch s-toggle-switch__multiple"> |
80 | | - <input type="radio" name="example2" id="xml" value="xml"> |
81 | | - <label for="xml" aria-label="XML" title="XML">{% icon "CodeDocument" %}</label> |
82 | | - <input type="radio" name="example2" id="pdf" checked value="pdf"> |
83 | | - <label for="pdf" aria-label="PDF" title="PDF">{% icon "Document" %}</label> |
84 | | - <input type="radio" name="example2" id="json" value="json"> |
85 | | - <label for="json" aria-label="JSON" title="JSON">{% icon "ComposeDocument" %}</label> |
| 80 | + </fieldset> |
| 81 | + <fieldset> |
| 82 | + <div class="d-flex ai-center g8"> |
| 83 | + <legend class="c-default s-label">Export Type</legend> |
| 84 | + <div class="s-toggle-switch s-toggle-switch__multiple"> |
| 85 | + <input type="radio" name="example2" id="xml" value="xml"> |
| 86 | + <label for="xml" aria-label="XML" title="XML">{% icon "CodeDocument" %}</label> |
| 87 | + <input type="radio" name="example2" id="pdf" checked value="pdf"> |
| 88 | + <label for="pdf" aria-label="PDF" title="PDF">{% icon "Document" %}</label> |
| 89 | + <input type="radio" name="example2" id="json" value="json"> |
| 90 | + <label for="json" aria-label="JSON" title="JSON">{% icon "ComposeDocument" %}</label> |
| 91 | + </div> |
86 | 92 | </div> |
87 | | - </div> |
| 93 | + </fieldset> |
88 | 94 | </div> |
89 | 95 | </div> |
90 | 96 | </section> |
0 commit comments