0.0.1 • Published 3 years ago

native-circular-status v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Native Circular Status

NPM version NPM downloads NPM license run in expo snack Codecov Travis Bundle size

About

Progress bar modeled on the animation from Apple Music and App Store on iOS

Similar Projects

How to Install

First, install the library in your project by npm:

npm install native-circular-status

Or Yarn:

yarn add native-circular-status

Getting Started

Connect the library with the project using ES6 import:

import NativeCircularStatus from 'native-circular-status'

Options

Component extends TouchableOpacityProps

NameTypeDefaultDescription
progressnumberProgress value
iconPauseIonicon icon name or icon name for other selected icon typesquareIcon visible when paused status is true
iconPlayIonicon icon name or icon name for other selected icon typepauseIcon visible when paused status is false
pausedbooleanfalseProp to play/pause progress action
renderContent(progress: number, paused: boolean) => React.ReactNodeundefinedCustom content renderer
variant'normal' or 'compact'normalProp to define progress variant - normal, compact
animatedbooleantrueProp to enable/disable animation
colorstring#fb2c53Color for the progress element
placeholderColorstring#eeeeefColor for the placeholder element
onPause() => voidundefinedCallback when status changed from play to pause
onPlay() => voidundefinedCallback when status changed from pause to play
onStatusChanged(paused: boolean) => voidundefinedCallback when status changed from play to pause or pause to play
thinkingbooleanfalseProp to enable/disable thinking (loading) animation
contentPropsViewProps{}Props for the content element
iconPropsIconProps{}Props for the icon element
placeholderPropsViewProps{}Props for the placeholder element
progressPropsCirclePropTypes{}Props for the progress element

Example

import React, { useState } from 'react'
import NativeCircularStatus from 'native-circular-status'

const App = () => {
  const [paused, setPaused] = useState(false)

  return (
    <NativeCircularStatus
      progress={0.4}
      paused={paused}
      onPlay={() => setPaused(false)}
      onPause={() => setPaused(true)}
    />
  )
}

export default App

License

This project is licensed under the MIT License © 2021-present Jakub Biesiada