forked from thepassle/generic-components
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
96 lines (87 loc) · 3.78 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="Description" content="Put your description here.">
<link rel="stylesheet" type="text/css" href="./demo/styles.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;900&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/themes/prism-okaidia.css">
<script src="https://unpkg.com/[email protected]/prism.js"></script>
<title>generic-components</title>
</head>
<body>
<div class="app">
<div class="nav">
<h1 class="title"><a href="/index.html">generic</a></h1>
<nav>
<ul>
<li>
<a href="/demo/demo-app.html">showcase app</a>
</li>
<li>
<a href="/generic-accordion/demo/index.html">generic-accordion</a>
</li>
<li>
<a href="/generic-alert/demo/index.html">generic-alert</a>
</li>
<li>
<a href="/generic-dialog/demo/index.html">generic-dialog</a>
</li>
<li>
<a href="/generic-disclosure/demo/index.html">generic-disclosure</a>
</li>
<li>
<a href="/generic-listbox/demo/index.html">generic-listbox</a>
</li>
<li>
<a href="/generic-radio/demo/index.html">generic-radio</a>
</li>
<li>
<a href="/generic-skiplink/demo/index.html">generic-skiplink</a>
</li>
<li>
<a href="/generic-switch/demo/index.html">generic-switch</a>
</li>
<li>
<a href="/generic-tabs/demo/index.html">generic-tabs</a>
</li>
<li>
<a href="/generic-visually-hidden/demo/index.html">generic-visually-hidden</a>
</li>
<li>
<a href="https://github.com/thepassle/generic-components">Github</a>
</li>
</ul>
</nav>
</div>
<main class="content">
<h1>generic-components</h1>
<p>A collection of generic web components with a focus on:</p>
<ul>
<li>🚹 Accessibility</li>
<li>🏗 Easy to use</li>
<li>🎨 Easy to style</li>
</ul>
<h2>Goal</h2>
<p>The goal of this project is to create a common library of generic web components, that are accessible,
framework agnostic, easy to style, and easy to consume.</p>
<p>All components in these repo extend from HTMLElement and dont use any libraries or framework.</p>
<p>You can think of these components like using a native `button` element, you get all the functionality, and
accessibility, keyboard nav, etc for free, you just have to style the button to your liking.</p>
<p>You can use these components to build an app, or compose them and build your own components with them.</p>
<h2>Usage</h2>
<h3>Via npm</h3>
<p>Components can be installed via npm</p>
<pre><code class="language-bash">npm i --save @generic-components/components</code></pre>
<p>And imported in your code via ES imports:</p>
<pre><code class="language-js">import '@generic-components/components/switch.js';</code></pre>
<h3>Via CDN</h3>
<p>Alternatively you can load the components from a CDN and drop them in your HTML file as a script tag</p>
<pre><code class="language-markup"><script type="prism-html-markup"><script src="https://unpkg.com/@generic-components/[email protected]/switch.js" type="module"></script></script></code></pre>
Use the component in your HTML file:
<pre><code class="language-markup"><script type="prism-html-markup"><generic-switch></generic-switch></script></code></pre>
</div>
</main>
</body>
</html>