Skip to content

capitalize ​

The module capitalize is a function that adds a capital letter to a string

formatted value: String value
vue
<script lang="ts" setup>
import { capitalize } from '@maz-ui/utils'
import { computed, ref } from 'vue'

const stringValue = ref('string value')

const stringFormatted = computed(() =>
  capitalize(stringValue.value),
)
</script>

<template>
  <MazInput v-model="stringValue" />

  <div
    class="flex flex-center rounded-md gap-0.5 p-4 mt-16 bg-surface-300"
  >
    {{ stringFormatted }}
  </div>
</template>