@br-validators/vue
Vue 3 composables for Brazilian document validators — delegates to @br-validators/core
9,803
8
| Install | |
|---|---|
npm install @br-validators/vue@1.10.0 |
|
| Latest Version: | 1.10.0 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 22, 2026 |
| Links: | GitHub · npm |
Maintainer: br-validators
@br-validators/vue
Vue 3 composables that delegate validation and formatting to @br-validators/core v1.10.0.
Install
pnpm add @br-validators/vue @br-validators/core vue
Peer dependencies: vue ^3.5.0, @br-validators/core
Generic composable
<script setup lang="ts">
import { useBrValidator } from '@br-validators/vue';
const cpf = useBrValidator('cpf');
</script>
<template>
<input v-model="cpf.value" />
<p v-if="cpf.error">{{ cpf.error }}</p>
<p v-else-if="cpf.isValid">Formatted: {{ cpf.formatted }}</p>
</template>
Named composables (v1)
| Composable | Core delegate |
|---|---|
useCpf() |
validateCpf / formatCpf |
useCnpj() |
validateCnpj / formatCnpj |
useCep() |
validateCep / formatCep |
useTelefone() |
validateTelefone / formatTelefone |
usePix() |
validatePixKey / formatPixKey |
useInscricaoEstadual({ uf }) |
validateInscricaoEstadual / formatInscricaoEstadual |
Each composable exposes reactive value, error, formatted, isValid, and validate().
Inscrição Estadual with UF ref
import { ref } from 'vue';
import { useInscricaoEstadual } from '@br-validators/vue';
const uf = ref<'SP' | 'RJ'>('SP');
const ie = useInscricaoEstadual({ uf });
PIX type constraint
import { usePix } from '@br-validators/vue';
const pix = usePix({ pixType: 'email' });
Invalid values surface the same message string returned by core validate*.
Official algorithm sources: docs/OFFICIAL-SOURCES.md.
License
MIT
Related Packages
vuetify-mask-with-slots
Vuetify 2 text-field masks with working slots (money, percent, CPF/CNPJ/CEP, dat...
9,897
0
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.10.0 | ^3.5.0 | MIT | |
| 1.9.0 | ^3.5.0 | MIT | |
| 1.8.3 | ^3.5.0 | MIT | |
| 1.8.2 | ^3.5.0 | MIT | |
| 1.8.1 | ^3.5.0 | MIT | |
| 1.8.0 | ^3.5.0 | MIT | |
| 1.7.0 | ^3.5.0 | MIT | |
| 1.6.2 | ^3.5.0 | MIT | |
| 1.6.1 | ^3.5.0 | MIT | |
| 1.6.0 | ^3.5.0 | MIT |
Pre-releases (47)
| Version | Released | Vue | License |
|---|---|---|---|
| 1.10.0-data.46 | ^3.5.0 | MIT | |
| 1.10.0-data.45 | ^3.5.0 | MIT | |
| 1.10.0-data.44 | ^3.5.0 | MIT | |
| 1.10.0-data.43 | ^3.5.0 | MIT | |
| 1.10.0-data.42 | ^3.5.0 | MIT | |
| 1.10.0-data.41 | ^3.5.0 | MIT | |
| 1.10.0-data.40 | ^3.5.0 | MIT | |
| 1.10.0-data.39 | ^3.5.0 | MIT | |
| 1.10.0-data.38 | ^3.5.0 | MIT | |
| 1.10.0-data.37 | ^3.5.0 | MIT | |
| 1.10.0-data.36 | ^3.5.0 | MIT | |
| 1.10.0-data.35 | ^3.5.0 | MIT | |
| 1.10.0-data.34 | ^3.5.0 | MIT | |
| 1.10.0-data.33 | ^3.5.0 | MIT | |
| 1.10.0-data.32 | ^3.5.0 | MIT | |
| 1.10.0-data.31 | ^3.5.0 | MIT | |
| 1.10.0-data.30 | ^3.5.0 | MIT | |
| 1.10.0-data.29 | ^3.5.0 | MIT | |
| 1.10.0-data.28 | ^3.5.0 | MIT | |
| 1.10.0-data.27 | ^3.5.0 | MIT | |
| 1.10.0-data.26 | ^3.5.0 | MIT | |
| 1.10.0-data.25 | ^3.5.0 | MIT | |
| 1.10.0-data.24 | ^3.5.0 | MIT | |
| 1.10.0-data.23 | ^3.5.0 | MIT | |
| 1.10.0-data.22 | ^3.5.0 | MIT | |
| 1.10.0-data.21 | ^3.5.0 | MIT | |
| 1.10.0-data.20 | ^3.5.0 | MIT | |
| 1.10.0-data.19 | ^3.5.0 | MIT | |
| 1.10.0-data.18 | ^3.5.0 | MIT | |
| 1.10.0-data.17 | ^3.5.0 | MIT |
Showing the latest 30 of 47. See every release on npm