Skip to content

Vue Barangay Search

A Vue 3 component for searching Philippine Barangays using the api.gis.ph service.

Install via your preferred package manager:

Terminal window
# Using bun (recommended)
bun add vue-barangay-search
# Using npm
npm install vue-barangay-search
# Using pnpm
pnpm add vue-barangay-search
<script setup>
import { ref } from 'vue'
import { BarangaySearch } from 'vue-barangay-search'
import 'vue-barangay-search/dist/vue-barangay-search.css'
const selectedBarangay = ref(null)
const accessToken = 'YOUR_GIS_PH_API_KEY' // Get one at https://gis.ph
</script>
<template>
<BarangaySearch
v-model="selectedBarangay"
:accessToken="accessToken"
placeholder="Search for a barangay..."
@select="(b) => console.log('Selected:', b)"
/>
</template>
PropTypeDefaultDescription
accessTokenStringundefinedRequired. Your API Key or Token from gis.ph.
municipalityStringundefinedOptional: filter results to a specific municipality.
placeholderStringSearch for a barangay...Input placeholder text.
modelValueObjectundefinedv-model binding for the selected barangay.
EventPayloadDescription
update:modelValueObjectEmitted when a selection is made.
selectObjectEmitted with the full barangay object on selection.
errorErrorEmitted when an API or network error occurs.