Skip to content

react-pretty-duration is a reactjs package converting numbered duration to user friendly duration text.

License

Notifications You must be signed in to change notification settings

AbdulRehman3/react-pretty-duration

Repository files navigation

react-pretty-duration

npm bundle size npm npm NPM

react-pretty-duration is a reactjs package converting numbered duration to user friendly duration text.

Installation

Use the npm to install react-pretty-duration.

npm install react-pretty-duration

Usage

import React from 'react';
import PrettyDuration from 'react-pretty-duration';

const App = () => {
	return (
		// provide total minutes
		<PrettyDuration duration={200} />
	)
}
// result => 3hr 20min

Demo

react-pretty-duration

Props

props type default description required
duration number 0 numbered duration in minutes, must be greater than 0 true
className string 0 className for element styling false
style style object 0 object for inline styling false

Notice

This package uses react hooks, so would works with [email protected] or greater

License

MIT

About

react-pretty-duration is a reactjs package converting numbered duration to user friendly duration text.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published