forked from
npmx.dev/npmx.dev
[READ-ONLY]
a fast, modern browser for the npm registry
1<script setup lang="ts">
2const props = withDefaults(
3 defineProps<{
4 as?: string | Component
5 variant?: 'ghost' | 'default'
6
7 classicon?: string
8 }>(),
9 { as: 'span', variant: 'default' },
10)
11</script>
12
13<template>
14 <component
15 :is="as"
16 class="bg-bg-muted text-fg-muted inline-flex gap-x-1 items-center justify-center font-mono border border-gray-400 dark:border-gray-500 rounded-md text-xs px-2 py-0.5"
17 :class="{ 'opacity-80 border-dashed': variant === 'ghost' }"
18 >
19 <span v-if="classicon" class="size-[1em]" :class="classicon" aria-hidden="true" />
20 <slot />
21 </component>
22</template>