All Projects → codedailyio → react-native-animated-bar

codedailyio / react-native-animated-bar

Licence: other
Responsive React Native Animated Progress Bar

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to react-native-animated-bar

Alive Progress
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
Stars: ✭ 2,940 (+6291.3%)
Mutual labels:  progress-bar, animated
Boxloaderview
Stars: ✭ 76 (+65.22%)
Mutual labels:  progress-bar, animated
haraka
Stateful animations in React Native.
Stars: ✭ 71 (+54.35%)
Mutual labels:  animated
react-native-animated-circular-progress
No description or website provided.
Stars: ✭ 16 (-65.22%)
Mutual labels:  animated
gifterm
View animated .GIF files in a text console. Linux/Mac/Windows
Stars: ✭ 14 (-69.57%)
Mutual labels:  animated
smoothr
A custom React router that leverages the Web Animations API and CSS animations.
Stars: ✭ 28 (-39.13%)
Mutual labels:  animated
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-43.48%)
Mutual labels:  progress-bar
vue-typical
🐡 Vue Animated typing in ~400 bytes of JavaScript
Stars: ✭ 121 (+163.04%)
Mutual labels:  animated
react-native-giphy
Integrate GIPHY into your React Native project (works with react-native-gifted-chat)
Stars: ✭ 25 (-45.65%)
Mutual labels:  animated
fl animated linechart
Animated line chart for flutter
Stars: ✭ 48 (+4.35%)
Mutual labels:  animated
Loaders
Process dialogs, loading bars, etc.
Stars: ✭ 23 (-50%)
Mutual labels:  progress-bar
pbapply
Adding progress bar to '*apply' functions in R
Stars: ✭ 115 (+150%)
Mutual labels:  progress-bar
react-native-animated-menu
Top-down animated menu transition concept
Stars: ✭ 56 (+21.74%)
Mutual labels:  animated
LineProgressbar
A light weight jquery progressbar plugin
Stars: ✭ 34 (-26.09%)
Mutual labels:  progress-bar
react-native-animated-carousel
🦄 A wonderful animated carsouel hooks component for React-Native
Stars: ✭ 16 (-65.22%)
Mutual labels:  animated
suru
A tqdm-style progress bar in Nim
Stars: ✭ 40 (-13.04%)
Mutual labels:  progress-bar
rich
Rich is a Python library for rich text and beautiful formatting in the terminal.
Stars: ✭ 36,988 (+80308.7%)
Mutual labels:  progress-bar
sosoito
Progress layout collection for Android
Stars: ✭ 14 (-69.57%)
Mutual labels:  progress-bar
animated interpolation
A flutter interpolation plugin inspired by the React Native interpolation animation
Stars: ✭ 20 (-56.52%)
Mutual labels:  animated
pqdm
Comfortable parallel TQDM using concurrent.futures
Stars: ✭ 118 (+156.52%)
Mutual labels:  progress-bar

Responsive React Native Animated Bar

Install

npm install react-native-animated-bar --save

yarn add react-native-animated-bar

Live Demo

https://snack.expo.io/Hk03E4Avb

Configuration Options

  • height - Configure the height. Default: 10. AutoSize height of bar set to null (height={null})
  • borderColor - Configures the border color. Default: #000.
  • borderWidth - Configures the width of the border. Default: 1.
  • borderRadius - Configures border radius. Default: 0.
  • barColor - Configures the color of the progress bar. Default: #FFF.
  • fillColor - Configures color behind progress bar. Default: rgba(0,0,0,.5).
  • duration - Configures length of time in milliseconds the change in progress should take. Default: 100.
  • animate - Configures whether or not change in progress should be animated. Default: true
  • onAnimate - Callback listener for the animated value. Default: undefined
  • style - Pass in any styling for the outer containing view. This defines the general layout of the bar for column, row, and the height prop.
  • wrapStyle - Add arbitrary styling to the wrapping view. This is where borderColor, borderWidth, and borderRadius stylings are applied.
  • fillStyle - Add arbitrary styling to inner fill(behind the bar), this is what fillColor is applied to.
  • barStyle - Add arbitrary styling to the bar, this si what barColor is applied to.

Any color above can be an animated interpolated value

Example Usage

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

import AnimatedBar from "react-native-animated-bar";

export default class example extends Component {
  render() {
    return (
      <View style={styles.container}>
        <AnimatedBar />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

AppRegistry.registerComponent('example', () => example);

The Big Examples

import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View } from "react-native";

import AnimatedBar from "react-native-animated-bar";

export default class example extends Component {
  state = {
    progress: 0,
  };

  componentDidMount() {
    const interval = setInterval(() => {
      if (this.state.progress > 0.9) return clearInterval(interval);

      this.setState(state => {
        return {
          progress: state.progress + 0.1,
        };
      });
    }, 1000);
  }

  render() {
    return (
      <View style={styles.container}>
        <View>
          <Text>No configuration</Text>
          <AnimatedBar progress={this.state.progress} />
        </View>

        <View>
          <Text>Config Options</Text>
          <AnimatedBar
            progress={this.state.progress}
            height={50}
            borderColor="#DDD"
            fillColor="tomato"
            barColor="red"
            borderRadius={5}
          />
        </View>

        <View>
          <Text>No Animation. No Border</Text>
          <AnimatedBar
            progress={this.state.progress}
            height={20}
            borderColor="#DDD"
            barColor="tomato"
            borderRadius={5}
            borderWidth={0}
            animate={false}
          />
        </View>
        <View>
          <Text>Auto Sizing in a Column</Text>
          <AnimatedBar
            progress={this.state.progress}
            height={null}
            borderColor="#DDD"
            barColor="tomato"
            borderRadius={5}
            borderWidth={5}
            duration={500}
          >
            <View style={[styles.row, styles.center]}>
              <Text style={[styles.barText, { fontSize: 30 }]}>
                {Math.round(this.state.progress * 100)}%
              </Text>
            </View>
          </AnimatedBar>
        </View>

        <View>
          <Text>Longer duration on transition</Text>
          <AnimatedBar
            progress={this.state.progress}
            height={20}
            borderColor="#DDD"
            barColor="tomato"
            borderRadius={5}
            borderWidth={5}
            duration={500}
          />
        </View>
        <View style={styles.row}>
          <Text style={styles.rowText}>Progress with Children: </Text>
          <AnimatedBar
            progress={this.state.progress}
            height={40}
            borderColor="#DDD"
            barColor="tomato"
            borderRadius={5}
            borderWidth={5}
            duration={500}
            row
          >
            <View style={[styles.row, styles.center, { flex: 1 }]}>
              <Text style={styles.barText}>
                {Math.round(this.state.progress * 100)}%
              </Text>
            </View>
          </AnimatedBar>
        </View>

        <View style={styles.row}>
          <Text style={styles.rowText}>Auto Sizing to Children on Row: </Text>
          <AnimatedBar
            progress={this.state.progress}
            height={null}
            borderColor="#DDD"
            barColor="tomato"
            borderRadius={5}
            borderWidth={5}
            duration={500}
            row
          >
            <View style={[styles.row, styles.center]}>
              <Text style={[styles.barText, { fontSize: 30 }]}>
                {Math.round(this.state.progress * 100)}%
              </Text>
            </View>
          </AnimatedBar>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: 30,
    paddingHorizontal: 30,
    justifyContent: "space-around",
  },
  rowText: {
    marginRight: 20,
  },
  row: {
    flexDirection: "row",
  },
  center: {
    justifyContent: "center",
    alignItems: "center",
  },
  barText: {
    backgroundColor: "transparent",
    color: "#FFF",
  },
});

AppRegistry.registerComponent("example", () => example);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].