0.0.1 • Published 4 years ago

@reactuniversal/material-indicators v0.0.1

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

All 4 material indicators (Indeterminate and Determinate ProgressBar and ProgressCircle) built in React Native that works on iOS, Android, Web, Electron, and other platforms. These components are a part of the React Universal ecosystem of universal React and React Native components. Checkout the React Universal docs to learn more.

Storybook Demos

Installation

npm i @reactuniversal/material-indicators --save

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-indicators';

export default 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-indicators';

export default 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-indicators';

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