Dark Input by codepeek
Zoom
Saved
1 line⌘Z Undo
1<!--2 Author: @codepeek3 License: MIT4 Tags: #dark #form #hover #keyboard #mechanical5-->6<label class="kcs">7 <svg class="kcs__icon" viewBox="0 0 24 24" aria-hidden="true">8 <circle cx="11" cy="11" r="6.5"/>9 <path d="m16 16 4.5 4.5"/>10 </svg>11 <span class="kcs__sr">Search docs</span>12 <input class="kcs__in" type="search" placeholder="Search docs, commands, people" autocomplete="off">13 <span class="kcs__keys" aria-hidden="true">14 <span class="kcs__key" style="--kcs-i: 0">⌘</span>15 <span class="kcs__key" style="--kcs-i: 1">K</span>16 </span>17 <span class="kcs__enter" aria-hidden="true">18 open19 <span class="kcs__key">↵</span>20 </span>21</label>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!--
Author: @codepeek
License: MIT
Tags: #dark #form #hover #keyboard #mechanical
-->
<label class="kcs">
<svg class="kcs__icon" viewBox="0 0 24 24" aria-hidden="true">
<circle cx="11" cy="11" r="6.5"/>
<path d="m16 16 4.5 4.5"/>
</svg>
<span class="kcs__sr">Search docs</span>
<input class="kcs__in" type="search" placeholder="Search docs, commands, people" autocomplete="off">
<span class="kcs__keys" aria-hidden="true">
<span class="kcs__key" style="--kcs-i: 0">⌘</span>
<span class="kcs__key" style="--kcs-i: 1">K</span>
</span>
<span class="kcs__enter" aria-hidden="true">
open
<span class="kcs__key">↵</span>
</span>
</label>1/* * Author: @codepeek * License: MIT * Tags: #dark #form #hover #keyboard #mechanical */2.kcs {3 position: relative;4 display: flex;5 align-items: center;6 gap: 10px;7 width: 380px;8 height: 54px;9 padding: 0 12px 0 16px;10 box-sizing: border-box;11 border-radius: 12px;12 background: #1b1b1b;13 box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 0 0 1px #3a3a3a, 0 16px 30px -14px rgb(0 0 0 / 0.8);14 color: #d8d2c6;15 font-family: system-ui, sans-serif;16 cursor: text;17 transition: box-shadow 0.25s;18}19.kcs:focus-within {20 box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 0 0 1px #e3b23c, 0 0 0 5px rgb(227 178 60 / 0.16), 0 16px 30px -14px rgb(0 0 0 / 0.8);21}22.kcs__icon {23 flex: none;24 width: 18px;25 height: 18px;26 fill: none;27 stroke: #8a847a;28 stroke-width: 2;29 stroke-linecap: round;30 transition: stroke 0.2s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);31}32.kcs:focus-within .kcs__icon {33 stroke: #e3b23c;34 transform: rotate(-14deg) scale(1.08);35}36.kcs__sr {37 position: absolute;38 width: 1px;39 height: 1px;40 overflow: hidden;41 clip-path: inset(50%);42 white-space: nowrap;43}44.kcs__in {45 flex: 1;46 min-width: 0;47 height: 100%;48 padding: 0;49 border: 0;50 background: transparent;51 color: #f3ece0;52 font: 15px/1 system-ui, sans-serif;53 caret-color: #e3b23c;54 outline: none;55}56.kcs__in::placeholder {57 color: #6f6a62;58}59.kcs__in::-webkit-search-cancel-button {60 -webkit-appearance: none;61}62.kcs__keys, .kcs__enter {63 display: flex;64 align-items: center;65 gap: 5px;66 transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);67}68.kcs__key {69 display: grid;70 place-items: center;71 min-width: 26px;72 height: 26px;73 padding: 0 6px;74 box-sizing: border-box;75 border-radius: 6px;76 background: linear-gradient(#3b3b3b, #2b2b2b);77 box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.13), 0 3px 0 #0f0f0f, 0 4px 6px rgb(0 0 0 / 0.45);78 color: #e8e2d6;79 font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;80 transition: transform 0.12s, box-shadow 0.12s;81 transition-delay: calc(var(--kcs-i, 0) * 70ms);82}83.kcs:focus-within .kcs__key {84 transform: translateY(2px);85 box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 1px 0 #0f0f0f, 0 1px 2px rgb(0 0 0 / 0.4);86}87.kcs__enter {88 position: absolute;89 right: 12px;90 color: #8a847a;91 font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;92 opacity: 0;93 transform: translateY(8px);94 pointer-events: none;95}96.kcs__enter .kcs__key {97 background: #e3b23c;98 color: #1b1b1b;99 box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 3px 0 #8c6a14;100}101.kcs:has(.kcs__in:not(:placeholder-shown)) .kcs__keys {102 opacity: 0;103 transform: translateY(-8px);104}105.kcs:has(.kcs__in:not(:placeholder-shown)) .kcs__enter {106 opacity: 1;107 transform: none;108}109@media (prefers-reduced-motion: reduce) {110 .kcs__icon, .kcs__keys, .kcs__enter, .kcs__key {111 transition: none;112 }113}
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
/* * Author: @codepeek * License: MIT * Tags: #dark #form #hover #keyboard #mechanical */
.kcs {
position: relative;
display: flex;
align-items: center;
gap: 10px;
width: 380px;
height: 54px;
padding: 0 12px 0 16px;
box-sizing: border-box;
border-radius: 12px;
background: #1b1b1b;
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 0 0 1px #3a3a3a, 0 16px 30px -14px rgb(0 0 0 / 0.8);
color: #d8d2c6;
font-family: system-ui, sans-serif;
cursor: text;
transition: box-shadow 0.25s;
}
.kcs:focus-within {
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 0 0 1px #e3b23c, 0 0 0 5px rgb(227 178 60 / 0.16), 0 16px 30px -14px rgb(0 0 0 / 0.8);
}
.kcs__icon {
flex: none;
width: 18px;
height: 18px;
fill: none;
stroke: #8a847a;
stroke-width: 2;
stroke-linecap: round;
transition: stroke 0.2s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kcs:focus-within .kcs__icon {
stroke: #e3b23c;
transform: rotate(-14deg) scale(1.08);
}
.kcs__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.kcs__in {
flex: 1;
min-width: 0;
height: 100%;
padding: 0;
border: 0;
background: transparent;
color: #f3ece0;
font: 15px/1 system-ui, sans-serif;
caret-color: #e3b23c;
outline: none;
}
.kcs__in::placeholder {
color: #6f6a62;
}
.kcs__in::-webkit-search-cancel-button {
-webkit-appearance: none;
}
.kcs__keys, .kcs__enter {
display: flex;
align-items: center;
gap: 5px;
transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kcs__key {
display: grid;
place-items: center;
min-width: 26px;
height: 26px;
padding: 0 6px;
box-sizing: border-box;
border-radius: 6px;
background: linear-gradient(#3b3b3b, #2b2b2b);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.13), 0 3px 0 #0f0f0f, 0 4px 6px rgb(0 0 0 / 0.45);
color: #e8e2d6;
font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
transition: transform 0.12s, box-shadow 0.12s;
transition-delay: calc(var(--kcs-i, 0) * 70ms);
}
.kcs:focus-within .kcs__key {
transform: translateY(2px);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 1px 0 #0f0f0f, 0 1px 2px rgb(0 0 0 / 0.4);
}
.kcs__enter {
position: absolute;
right: 12px;
color: #8a847a;
font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
opacity: 0;
transform: translateY(8px);
pointer-events: none;
}
.kcs__enter .kcs__key {
background: #e3b23c;
color: #1b1b1b;
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 3px 0 #8c6a14;
}
.kcs:has(.kcs__in:not(:placeholder-shown)) .kcs__keys {
opacity: 0;
transform: translateY(-8px);
}
.kcs:has(.kcs__in:not(:placeholder-shown)) .kcs__enter {
opacity: 1;
transform: none;
}
@media (prefers-reduced-motion: reduce) {
.kcs__icon, .kcs__keys, .kcs__enter, .kcs__key {
transition: none;
}
}Changes made here are only a live preview and will not be saved.
Save to GitHub
GitHub opens a new file in your repository with this element filled in. Review it there and press Commit changes. Nothing is sent from codepeek and no GitHub access is needed.
◉ 1 views
Build it with AIA ready prompt with the code, the credit and how to adapt it to your project.
A command bar search with real-looking ⌘ K keycaps. Focusing presses the keys down in sequence; once you type they slide away for a lit return key.
Choose where to donate
Select a platform to continue.
Community
Comments 0
Code copied
SUPPORT THE CREATOR
Would you like to donate to the creator to help them keep creating content?
You need to sign in before you can write a comment.