HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/flowbite-vue/src/components/Typography/FwbHeading.vue
<template>
  <component
    :is="componentTag"
    v-bind="$attrs"
    :class="headingClasses"
  >
    <slot />
  </component>
</template>

<script setup lang="ts">
import { twMerge } from 'tailwind-merge'
import { useAttrs } from 'vue'

defineOptions({
  inheritAttrs: false,
})

interface HeadingProps {
  tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
  color?: string
  customSize?: string
}

const props = withDefaults(defineProps<HeadingProps>(), {
  tag: 'h1',
  color: 'text-gray-900 dark:text-white',
  customSize: '',
})

const textSizes: Record<string, string> = {
  h1: 'text-5xl font-extrabold',
  h2: 'text-4xl font-bold',
  h3: 'text-3xl font-bold',
  h4: 'text-2xl font-bold',
  h5: 'text-xl font-bold',
  h6: 'text-lg font-bold',
}
const attrs = useAttrs()
const headingClasses = twMerge(
  'w-full',
  textSizes[props.tag],
  props.color,
  props.customSize,
  attrs.class as string,
)
const componentTag = props.tag
</script>