0.0.2 • Published 5 years ago

react-native-material-indicators v0.0.2

Weekly downloads
111
License
MIT
Repository
github
Last release
5 years ago

react-native-material-indicators

All 4 material indicators(Indeterminate and Determinate ProgressBar and ProgressCircle) build in React Native that works on iOS, Android, Web, Electron, and other platforms. If you need more cross-platform material components, check out Material Bread.

Storybook Demos

Table of Contents

Installation

npm install react-native-material-indicators --save

Progress Bar

Progress Bar Indeterminate

import React, { Component } from 'react';
import { ProgressBar } from 'react-native-material-indicator';

class App extends Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
      <ProgressBar visible color={"#E91E63"} />
    );
  }
}

Progress Bar Determinate

import React, { Component } from 'react';
import { ProgressBar } from 'react-native-material-indicator';

class App extends Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
      <ProgressBar
         determinate
          value={50}
          color={"#009688"}
          animationDuration={500}
          trackStyle={{ marginBottom: 40 }}
          visible
      />
    );
  }
}

Props

NameDescriptionTypeDefault
animationDurationLength of each animation loop in msnumber1000
colorColor of barstring
determinateWhether bar continues to animate or notbool
easingEasing function for bar animationfunc
heightHeight of track and indicatornumber4
indcatorStartPositionWhere the indicator starts before the animation beginsnumber0
styleStyles root elementobject
trackStyleStyles track containing the indicatorobject
valuePercent out of 100 the indicator should fill in determinate modenumber
visibleWhether bar is visible or notbool

Progress Circle

Progress Circle Indeterminate

import React, { Component } from 'react';
import { ProgressCircle } from 'react-native-material-indicator';

class App extends Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
      <ProgressCircle />
    );
  }
}

Progress Circle Determinate

import React, { Component } from 'react';
import { ProgressCircle } from 'react-native-material-indicator';

class App extends Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
      <ProgressCircle
          value={25}
          size={48}
          thickness={4}
          color="#E91E63"
          animationMethod="timing"
          animationConfig={{ duration: 1000 }}
          shouldAnimateFirstValue
          determinate
        />
    );
  }
}

Props

NameDescriptionTypeDefault
animationDurationLength of each animation loop in msnumber1000
animationEasingEasing function for indeterminatefuncEasing.linear
colorColor of circlestring
determinateWhether Circle continues to animate or notbool
easingEasing function for determinate animationfunc
indcatorStartPositionWhere the indicator starts before the animation beginsnumber0
shouldAnimateFirstValueWether the determinate value should animate at startbooltrue
sizeDiameter of circlenumber48
styleStyles root elementobject
trackStyleStyles track containing the indicatorobject
valuePercent out of 100 the indicator should fill in determinate modenumber
visibleWhether circle is visible or notbool