diff --git a/README.md b/README.md
index 4d72ead..5242b6b 100755
--- a/README.md
+++ b/README.md
@@ -59,9 +59,11 @@ Vue.use(VueCompositionAPI);
## APIs
- Sensors
+ - [`useGeolocation`](./src/components/useGeolocation/stories/useGeolocation.md) — tracks geolocation state of user's device.
+ [](https://microcipcip.github.io/vue-use-kit/?path=/story/sensors-usegeolocation--demo)
- [`useHover`](./src/components/useHover/stories/useHover.md) — tracks mouse hover state of a given element.
[](https://microcipcip.github.io/vue-use-kit/?path=/story/sensors-usehover--demo)
- - [`useIntersection`](./src/components/useIntersection/stories/useIntersection.md) — tracks intersection of target element with an ancestor element.
+ - [`useIntersection`](./src/components/useIntersection/stories/useIntersection.md) — tracks intersection of target element with an ancestor element.
[](https://microcipcip.github.io/vue-use-kit/?path=/story/sensors-useintersection--demo)
[](https://microcipcip.github.io/vue-use-kit/?path=/story/sensors-useintersection--advanced-demo)
- [`useMedia`](./src/components/useMedia/stories/useMedia.md) — tracks state of a CSS media query.
diff --git a/src/components/useFullscreen/useFullscreen.spec.ts b/src/components/useFullscreen/useFullscreen.spec.ts
index 7796818..52850ec 100755
--- a/src/components/useFullscreen/useFullscreen.spec.ts
+++ b/src/components/useFullscreen/useFullscreen.spec.ts
@@ -21,7 +21,7 @@ const testComponent = () => ({
})
describe('useFullscreen', () => {
- it('should not be fullscreen when initialized', () => {
+ it('should not be fullscreen onMounted', () => {
const wrapper = mount(testComponent())
expect(wrapper.find('#isFullscreen').exists()).toBe(false)
})
diff --git a/src/components/useGeolocation/index.ts b/src/components/useGeolocation/index.ts
new file mode 100755
index 0000000..2b68ac8
--- /dev/null
+++ b/src/components/useGeolocation/index.ts
@@ -0,0 +1 @@
+export * from './useGeolocation'
diff --git a/src/components/useGeolocation/stories/UseGeolocationDemo.vue b/src/components/useGeolocation/stories/UseGeolocationDemo.vue
new file mode 100755
index 0000000..d8be26c
--- /dev/null
+++ b/src/components/useGeolocation/stories/UseGeolocationDemo.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
Prop
+
Value
+
+
+
+
+
geo
+
+
{{ JSON.stringify(geo, null, 2) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/useGeolocation/stories/useGeolocation.md b/src/components/useGeolocation/stories/useGeolocation.md
new file mode 100755
index 0000000..0058731
--- /dev/null
+++ b/src/components/useGeolocation/stories/useGeolocation.md
@@ -0,0 +1,74 @@
+# useGeolocation
+
+Vue function that tracks geolocation state of user's device, based on the [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API).
+
+## Reference
+
+```typescript
+interface UseGeolocation {
+ loading: boolean
+ accuracy: number | null
+ altitude: number | null
+ altitudeAccuracy: number | null
+ heading: number | null
+ latitude: number | null
+ longitude: number | null
+ speed: number | null
+ timestamp: number | null
+ error?: Error | PositionError
+}
+```
+
+```typescript
+useGeolocation(
+ options?: PositionOptions,
+ runOnMount?: boolean
+): {
+ isTracking: Ref;
+ geo: Ref;
+ start: () => void;
+ stop: () => void;
+}
+```
+
+### Parameters
+
+- `options: PositionOptions` the [geolocation position options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions)
+- `runOnMount: boolean` whether to run the geolocation tracking on mount, `true` by default
+
+### Returns
+
+- `isTracking: Ref` whether the function is tracking the user's location or not
+- `geo: Ref` the geolocation object
+- `start: Function` the function used for starting the geolocation tracking
+- `stop: Function` the function used for stopping the geolocation tracking
+
+## Usage
+
+```html
+
+