add component base
All checks were successful
Deploy Application / deploy (push) Successful in 5s

This commit is contained in:
2025-06-12 02:10:43 +04:00
parent fb85eb8e7b
commit 05ecc605df
4 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,45 @@
<template>
<component
:is="as"
class="text-gray-900"
:class="[
{
'text-2xl lg:text-3xl 2xl:text-4xl': size === '600',
}, // 24px
{
'text-xl lg:text-2xl 2xl:text-3xl': size === '500',
}, // 20px
{
'text-lg lg:text-xl 2xl:text-2xl': size === '400',
}, // 18px
{
'text-base lg:text-lg': size === '300',
}, // 16px
{
'text-sm': size === '200',
}, // 14px
]"
>
<slot />
</component>
</template>
<script setup lang="ts">
import { toRefs } from 'vue'
const props = defineProps({
as: {
type: String,
default: 'p',
},
/**
* Tailwind text size from 600 to 200
*/
size: {
type: String,
default: '300',
},
})
const { size, as } = toRefs(props)
</script>