mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 12:39:35 +01:00
32 lines
760 B
Vue
32 lines
760 B
Vue
<script lang="ts">
|
|
import { tv } from 'tailwind-variants'
|
|
import type { AppConfig } from '@nuxt/schema'
|
|
import _appConfig from '#build/app.config'
|
|
import theme from '#build/ui/skeleton'
|
|
|
|
const appConfig = _appConfig as AppConfig & { ui: { skeleton: Partial<typeof theme> } }
|
|
|
|
const skeleton = tv({ extend: tv(theme), ...(appConfig.ui?.skeleton || {}) })
|
|
|
|
export interface SkeletonProps {
|
|
/**
|
|
* The element or component this component should render as.
|
|
* @defaultValue 'div'
|
|
*/
|
|
as?: any
|
|
class?: any
|
|
}
|
|
</script>
|
|
|
|
<script setup lang="ts">
|
|
import { Primitive } from 'radix-vue'
|
|
|
|
const props = defineProps<SkeletonProps>()
|
|
</script>
|
|
|
|
<template>
|
|
<Primitive :as="as" :class="skeleton({ class: props.class })">
|
|
<slot />
|
|
</Primitive>
|
|
</template>
|