vue3-time-duration

UI Widget to set a time duration. This is a component for vue 3
2,035
Install
npm install vue3-time-duration
Latest Version:0.4.4
Vue:3
License:MIT
Last Updated:Mar 17, 2026
Links: GitHub  ·  npm
Maintainer: lentarev

vue3-time-duration

UI Widget to set a time duration. This is a component for vue 3

Getting started

Install the component:

npm install --save vue3-time-duration

Use the component directly:

Options API
<template>
  <div>
    <vue3-time-duration :init-start="start" :init-end="end" v-on:duration="onHandleDuration" />
  </div>
</template>

<script lang="ts">
  import "vue3-time-duration/dist/vue3-time-duration.css";
  import Vue3TimeDuration from "vue3-time-duration";

  export default defineComponent({
    name: "FormLogin",
    components: { Vue3TimeDuration },
    
    data() {
      return {
        start: "",
        end: ""
      }
    },
    
    mounted() {
      this.start = "10:00"
      this.end = "10:05";
    },
    
    methods() {
      onHandleDuration(val: { start: string; end: string }) {
        this.start = val.start;
        this.end = val.end;
      }
    }
  });
</script>
Composition API
<script setup lang="ts">
  import "vue3-time-duration/dist/vue3-time-duration.css";
  import Vue3TimeDuration from "vue3-time-duration";

  const start: Ref<string | undefined> = ref("");
  const end: Ref<string | undefined> = ref("");

  /**
   * Hook onMounted
   */
  onMounted(() => {
    start.value = "10:00";
    end.value = "10:05";
  });

  const onHandleDuration = (val: { start: string; end: string }) => {
    start.value = val.start;
    end.value = val.end;
  };
</script>

<template>
  <div>
    <vue3-time-duration :init-start="start" :init-end="end" v-on:duration="onHandleDuration" />
  </div>
</template>
If you want to customize the component styles. For example:
/* style.css file */

.vue3-time-duration {
	--bg-element: #ffffff;
	--bg-selected: #f3f3f3;
	--color-font: #333;
	--color-border: rgb(223, 230, 238);
	--size-font: 14px;
}

License

Copyright (c) 2025 Egor Lentarev. Released under the MIT License.

Related Packages

@clalarco/vue3-plotly

Vue 3 component for plotly.js, with Typescript support

28,421
bump-ui

Bump-UI for Vue 3+

713
youtube-vue3

Youtube player component for vue.js 3.x

141,913 26
verte-vue3

Vue Color Picker

48,073 6

Version History

Version Released Vue License
0.4.4 ^3.5.13 MIT
0.4.3 ^3.5.13 MIT
0.4.2 ^3.5.13 MIT
0.4.1 ^3.5.13 MIT
0.4.0 ^3.5.13 MIT