aboutsummaryrefslogtreecommitdiff
path: root/htmx/static/pico-1.5.11/docs/src/navs.html
blob: f109deb96231efa68f2ef3f6647e1d78a947d18b (plain) (blame)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!doctype html>
<html lang="en">
  <head>
    ${require('./_head.html') 
      title=`Navs`
      description=`The essential navbar component in pure semantic HTML.`
      canonical=`navs.html`
    }
  </head>

  <body>
    ${require('./_nav.html')}
    
    <main class="container" id="docs">
      ${require('./_sidebar.html') active=`navs-link`}
      
      <div role="document">
        <section id="navs">
          <hgroup>
            <h1>Navs</h1>
            <h2>The essential navbar component in pure semantic HTML.</h2>
          </hgroup>
          <article aria-label="Nav example">
            <nav>
              <ul>
                <li><strong>Brand</strong></li>
              </ul>
              <ul>
                <li><a href="#" onclick="event.preventDefault()">Link</a></li>
                <li><a href="#" onclick="event.preventDefault()">Link</a></li>
                <li><a href="#" onclick="event.preventDefault()" role="button">Button</a></li>
              </ul>
            </nav>
            <footer class="code">

<pre><code>&lt;<b>nav</b>&gt;
  &lt;<b>ul</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>strong</b>&gt;Brand&lt;/<b>strong</b>&gt;&lt;/<b>li</b>&gt;
  &lt;/<b>ul</b>&gt;
  &lt;<b>ul</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Link&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Link&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u>&gt;Button&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
  &lt;/<b>ul</b>&gt;
&lt;/<b>nav</b>&gt;</code></pre>

            </footer>
          </article>
          <p><code>&lt;<b>ul</b>&gt;</code> are automatically distributed horizontally.</p>
          <p><code>&lt;<b>li</b>&gt;</code> are unstyled and inlined.</p>
          <article aria-label="Nav example">
            <nav>
              <ul>
                <li>
                  <a href="#" onclick="event.preventDefault()" class="secondary" aria-label="Menu">
                    <svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="16px" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                      <line x1="3" y1="12" x2="21" y2="12">
                      </line><line x1="3" y1="6" x2="21" y2="6">
                      </line><line x1="3" y1="18" x2="21" y2="18">
                      </line>
                    </svg>
                  </a>
                </li>
              </ul>
              <ul>
                <li><strong>Brand</strong></li>
              </ul>
              <ul>
                <li>
                  <a href="#" onclick="event.preventDefault()" class="secondary" aria-label="Twitter">
                    <svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="16px" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                      <path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path>
                    </svg>
                  </a>
                </li>
              </ul>
            </nav>
            <footer class="code">

<pre><code>&lt;<b>nav</b>&gt;
  &lt;<b>ul</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>class</i>=<u>"secondary"</u>&gt;…&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
  &lt;/<b>ul</b>&gt;
  &lt;<b>ul</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>strong</b>&gt;Brand&lt;/<b>strong</b>&gt;&lt;/<b>li</b>&gt;
  &lt;/<b>ul</b>&gt;
  &lt;<b>ul</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>class</i>=<u>"secondary"</u>&gt;…&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
  &lt;/<b>ul</b>&gt;
&lt;/<b>nav</b>&gt;</code></pre>

            </footer>
          </article>
          <p>Inside <code>&lt;<b>aside</b>&gt;</code>, navs are stacked vertically.</p>
          <article aria-label="Vertical nav example">
            <aside>
              <nav>
                <ul>
                  <li><a href="#" onclick="event.preventDefault()">Link</a></li>
                  <li><a href="#" onclick="event.preventDefault()">Link</a></li>
                  <li><a href="#" onclick="event.preventDefault()">Link</a></li>
                </ul>
              </nav>
            </aside>
            <footer class="code">

<pre><code>&lt;<b>aside</b>&gt;
  &lt;<b>nav</b>&gt;
    &lt;<b>ul</b>&gt;
      &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Link&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
      &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Link&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
      &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Link&lt;/<b>a</b>&gt;&lt;/<b>li</b>&gt;
    &lt;/<b>ul</b>&gt;
  &lt;/<b>nav</b>&gt;
&lt;/<b>aside</b>&gt;</code></pre>

          </footer>
        </article>

        <p>With <code><i>aria-label</i>=<u>"breadcrumb"</u></code>, you can turn a nav into a breadcrumb.</p>

        <article aria-label="Breadcrumb example">
          <nav aria-label="breadcrumb">
            <ul>
              <li>
                <a href="#" onclick="event.preventDefault()">Home</a>
              </li>
              <li>
                <a href="#" onclick="event.preventDefault()">Category</a>
              </li>
              <li>Page</li>
            </ul>
          </nav>

          <footer class="code">

<pre><code>&lt;<b>nav</b> <i>aria-label</i>=<u>"breadcrumb"</u>&gt;
  &lt;<b>ul</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Home&lt;<b>/a</b>&gt;&lt;<b>/li</b>&gt;
    &lt;<b>li</b>&gt;&lt;<b>a</b> <i>href</i>=<u>"#"</u>&gt;Category&lt;<b>/a</b>&gt;&lt;<b>/li</b>&gt;
    &lt;<b>li</b>&gt;Page&lt;<b>/li</b>&gt;
  &lt;<b>/ul</b>&gt;
&lt;/<b>nav</b>&gt;</code></pre>

          </footer>
        </article>

      </section>

      ${require('./_footer.html')}

    </div>
  </main>
  <script src="js/commons.min.js"></script>
</body>

</html>