development
Keycap icon
Keycap is an original glyphfox icon from the development set, drawn on the 24 by 24 grid with 4 shapes. Its closed shapes also give it a solid style, generated at build time. Tags: keycap, key, mechanical keyboard, switch.
Sizes, weights and styles
Every glyphfox icon renders along three axes. The stroke grows a little below 24 px so small icons keep their presence.
Sizes
Weights
Styles
Copy the code
Pick a format. Each snippet uses the package entry point for that stack; the props work the same everywhere.
App.jsx
import { KeycapIcon } from 'glyphfox/react'; <KeycapIcon />
App.vue
<script setup> import { KeycapIcon } from 'glyphfox/vue'; </script> <template> <KeycapIcon /> </template>
App.svelte
<script> import { KeycapIcon } from 'glyphfox/svelte'; </script> <KeycapIcon />
app.component
import { GlyphFoxIcon, provideGlyphFox } from 'glyphfox-angular'; <gf-icon name="keycap"></gf-icon>
index.html
<glyph-fox name="keycap"></glyph-fox>
index.html
<script src="https://cdn.jsdelivr.net/npm/glyphfox@1"></script> <glyph-fox name="keycap"></glyph-fox>
index.html
<span class="gf-keycap" aria-hidden="true"></span>
keycap.svg
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="glyphfox glyphfox-keycap" aria-hidden="true"><rect x="2" y="2" width="20" height="20" rx="3"/><rect x="5.5" y="5" width="13" height="11" rx="2"/><path d="M5.9 15.6L3 21"/><path d="M18.1 15.6L21 21"/></svg>
data URI
data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='glyphfox glyphfox-keycap' aria-hidden='true'%3E%3Crect x='2' y='2' width='20' height='20' rx='3'/%3E%3Crect x='5.5' y='5' width='13' height='11' rx='2'/%3E%3Cpath d='M5.9 15.6L3 21'/%3E%3Cpath d='M18.1 15.6L21 21'/%3E%3C/svg%3E
index.html
<!-- copy node_modules/glyphfox/dist/sprite.svg to your public folder --> <svg width="24" height="24" aria-hidden="true"> <use href="/sprite.svg#gf-keycap"></use> </svg>
index.html
<!-- main.js: import 'glyphfox/runtime'; --> <i data-glyph="keycap"></i>
icon.js
import { renderToString } from 'glyphfox/core'; import iconKeycap from 'glyphfox/icons/keycap'; const svg = renderToString(iconKeycap, { size: 24 }); // or, with every icon registered by name: // import { toSvg } from 'glyphfox'; // toSvg('keycap', { size: 24 });
Details
| Name | keycap |
|---|---|
| React, Vue and Svelte component | KeycapIcon |
| Icon data export | iconKeycap |
| Categories | development |
| Tags | keycap key mechanical keyboard switch |
| Styles | Outline, Duotone (fill of the closed shapes), Solid |
| Shapes | 4 |
| License | MIT |
With a modifier badge
Add a badge in any corner with modifier or the name syntax. The icon is cut around the badge, so the result still passes the icon rules.
keycap+checkkeycap+pluskeycap+xkeycap+alertUse it in your stack
Guides with the install, the props and the pitfalls for each stack: