Skip to content

capitalize

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

formatted value: String value
vue
<template>
  <MazInput v-model="stringValue" />

  <div
    style="padding: 16px; margin-top: 16px; background-color: var(--maz-color-bg-lighter);"
  >
    {{ stringFormatted }}
  </div>
</template>

<script lang="ts" setup>
  import { capitalize } from 'maz-ui'
  import { ref, computed } from 'vue'

  const stringValue = ref('string value')

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