Mono Button by codepeek
Zoom
Saved
1 line⌘Z Undo
1<!--2 Author: @codepeek3 License: MIT4 Tags: #button #mono #press #svg #terminal5-->6<button class="ccb" type="button" aria-label="Copy install command: npm i @peek/ui">7 <span class="ccb__cmd" aria-hidden="true">8 <span class="ccb__sigil">$</span>9 npm i @peek/ui10 </span>11 <span class="ccb__icon" aria-hidden="true">12 <svg class="ccb__copy" viewBox="0 0 24 24">13 <rect x="8" y="8" width="11" height="12" rx="2"/>14 <path class="ccb__back" d="M5 15V6a2 2 0 0 1 2-2h8"/>15 </svg>16 <svg class="ccb__check" viewBox="0 0 24 24">17 <path d="m5 12.5 4.5 4.5L19 7.5"/>18 </svg>19 </span>20 <span class="ccb__tip" aria-hidden="true">Copied</span>21</button>
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: #button #mono #press #svg #terminal
-->
<button class="ccb" type="button" aria-label="Copy install command: npm i @peek/ui">
<span class="ccb__cmd" aria-hidden="true">
<span class="ccb__sigil">$</span>
npm i @peek/ui
</span>
<span class="ccb__icon" aria-hidden="true">
<svg class="ccb__copy" viewBox="0 0 24 24">
<rect x="8" y="8" width="11" height="12" rx="2"/>
<path class="ccb__back" d="M5 15V6a2 2 0 0 1 2-2h8"/>
</svg>
<svg class="ccb__check" viewBox="0 0 24 24">
<path d="m5 12.5 4.5 4.5L19 7.5"/>
</svg>
</span>
<span class="ccb__tip" aria-hidden="true">Copied</span>
</button>1/* * Author: @codepeek * License: MIT * Tags: #button #mono #press #svg #terminal */2.ccb {3 position: relative;4 display: inline-flex;5 align-items: stretch;6 width: 260px;7 height: 50px;8 padding: 0;9 border: 1.5px solid #2a2724;10 border-radius: 8px;11 background: #efe6d2;12 color: #2a2724;13 font: 500 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;14 cursor: pointer;15 box-shadow: 0 3px 0 #2a2724;16 transition: transform 90ms ease, box-shadow 90ms ease, background 200ms ease;17}18.ccb:hover {19 background: #f4ecdb;20}21.ccb:active {22 transform: translateY(2px);23 box-shadow: 0 1px 0 #2a2724;24}25.ccb:focus-visible {26 outline: 2px solid #a0703a;27 outline-offset: 4px;28}29.ccb__cmd {30 flex: 1;31 display: flex;32 align-items: center;33 gap: 10px;34 padding: 0 14px;35}36.ccb__sigil {37 color: #a0703a;38}39.ccb__icon {40 display: grid;41 place-items: center;42 width: 50px;43 border-radius: 0 6px 6px 0;44 background: #2a2724;45 color: #efe6d2;46}47.ccb__icon svg {48 grid-area: 1 / 1;49 width: 20px;50 height: 20px;51 overflow: visible;52 fill: none;53 stroke: currentColor;54 stroke-width: 1.8;55 stroke-linecap: round;56 stroke-linejoin: round;57}58.ccb__back {59 transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);60}61.ccb:hover .ccb__back {62 transform: translate(-1.5px, -1.5px);63}64.ccb__copy {65 transition: opacity 160ms ease 1.4s, transform 160ms ease 1.4s;66}67.ccb__check {68 stroke: #e8c46a;69 stroke-dasharray: 22;70 stroke-dashoffset: 22;71 transition: stroke-dashoffset 200ms ease 1.4s;72}73.ccb:active .ccb__copy {74 opacity: 0;75 transform: scale(0.6);76 transition-duration: 80ms;77 transition-delay: 0s;78}79.ccb:active .ccb__check {80 stroke-dashoffset: 0;81 transition: stroke-dashoffset 240ms ease 0s;82}83.ccb__tip {84 position: absolute;85 right: 0;86 bottom: calc(100% + 10px);87 padding: 6px 9px;88 border-radius: 4px;89 background: #2a2724;90 color: #efe6d2;91 font-size: 12px;92 opacity: 0;93 transform: translateY(4px);94 pointer-events: none;95 transition: opacity 180ms ease 1.4s, transform 180ms ease 1.4s;96}97.ccb__tip::after {98 content: "";99 position: absolute;100 top: 100%;101 right: 19px;102 border: 5px solid transparent;103 border-top-color: #2a2724;104}105.ccb:active .ccb__tip {106 opacity: 1;107 transform: none;108 transition-delay: 0s;109}
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
/* * Author: @codepeek * License: MIT * Tags: #button #mono #press #svg #terminal */
.ccb {
position: relative;
display: inline-flex;
align-items: stretch;
width: 260px;
height: 50px;
padding: 0;
border: 1.5px solid #2a2724;
border-radius: 8px;
background: #efe6d2;
color: #2a2724;
font: 500 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
cursor: pointer;
box-shadow: 0 3px 0 #2a2724;
transition: transform 90ms ease, box-shadow 90ms ease, background 200ms ease;
}
.ccb:hover {
background: #f4ecdb;
}
.ccb:active {
transform: translateY(2px);
box-shadow: 0 1px 0 #2a2724;
}
.ccb:focus-visible {
outline: 2px solid #a0703a;
outline-offset: 4px;
}
.ccb__cmd {
flex: 1;
display: flex;
align-items: center;
gap: 10px;
padding: 0 14px;
}
.ccb__sigil {
color: #a0703a;
}
.ccb__icon {
display: grid;
place-items: center;
width: 50px;
border-radius: 0 6px 6px 0;
background: #2a2724;
color: #efe6d2;
}
.ccb__icon svg {
grid-area: 1 / 1;
width: 20px;
height: 20px;
overflow: visible;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
stroke-linecap: round;
stroke-linejoin: round;
}
.ccb__back {
transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ccb:hover .ccb__back {
transform: translate(-1.5px, -1.5px);
}
.ccb__copy {
transition: opacity 160ms ease 1.4s, transform 160ms ease 1.4s;
}
.ccb__check {
stroke: #e8c46a;
stroke-dasharray: 22;
stroke-dashoffset: 22;
transition: stroke-dashoffset 200ms ease 1.4s;
}
.ccb:active .ccb__copy {
opacity: 0;
transform: scale(0.6);
transition-duration: 80ms;
transition-delay: 0s;
}
.ccb:active .ccb__check {
stroke-dashoffset: 0;
transition: stroke-dashoffset 240ms ease 0s;
}
.ccb__tip {
position: absolute;
right: 0;
bottom: calc(100% + 10px);
padding: 6px 9px;
border-radius: 4px;
background: #2a2724;
color: #efe6d2;
font-size: 12px;
opacity: 0;
transform: translateY(4px);
pointer-events: none;
transition: opacity 180ms ease 1.4s, transform 180ms ease 1.4s;
}
.ccb__tip::after {
content: "";
position: absolute;
top: 100%;
right: 19px;
border: 5px solid transparent;
border-top-color: #2a2724;
}
.ccb:active .ccb__tip {
opacity: 1;
transform: none;
transition-delay: 0s;
}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 sand and charcoal install-command chip. Pressing it swaps the copy icon for a drawn check and a Copied tag that linger, then fade on their own.
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.