feat(new component): Initial typography (#199)
* feat: typography * feat: typography * feat: typography * Update docs/components/heading.md * Update src/components/Typography/A.vue * Update src/components/Typography/Heading.vue * Update src/components/Typography/Img.vue * Update src/components/Typography/P.vue --------- Co-authored-by: Ilya Artamonov <ilya.sosidka@gmail.com>
This commit is contained in:
34
src/components/Typography/Img.vue
Normal file
34
src/components/Typography/Img.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div>
|
||||
<figure v-if="caption" :class="figClass">
|
||||
<img :src="src" :alt="alt" :class="[size, alignment, imgClass]" />
|
||||
<figcaption :class="captionClass">{{ caption }}</figcaption>
|
||||
</figure>
|
||||
|
||||
<img v-else :src="src" :alt="alt" :class="[size, alignment, imgClass]" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
interface ImageProps {
|
||||
caption?: string
|
||||
src?: string
|
||||
size?: string
|
||||
alt?: string
|
||||
imgClass?: string
|
||||
alignment?: string
|
||||
captionClass?: string
|
||||
figClass?: string
|
||||
}
|
||||
|
||||
withDefaults(defineProps<ImageProps>(), {
|
||||
caption: '',
|
||||
src: '',
|
||||
size: 'max-w-full',
|
||||
alt: '',
|
||||
imgClass: 'h-auto',
|
||||
alignment: '',
|
||||
captionClass: 'mt-2 text-sm text-center text-gray-500 dark:text-gray-400',
|
||||
figClass: 'max-w-lg',
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user