Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Flip Countdown Timer implementation in React Native

License

NotificationsYou must be signed in to change notification settings

ChromeQ/react-native-flip-countdown-timer

 
 

Repository files navigation

A Flip timer implementation in React Native

For a Normal Timer application you can checkoutreact-native-flip-timer repository.

Show Cases

IOSAndroid
IOSAndroid

Getting Started

Installation

$ npm i react-native-flip-countdown-timer --save

Basic Usage

import React, { Component } from 'react';import {  StyleSheet, View, TouchableOpacity, Text,} from 'react-native';import { CountdownTimer, FlipNumber } from 'react-native-flip-countdown-timer';export default class App extends Component {  state = {    play: true,  }  play = () => {    this.setState(({ play }) => ({ play: !play }));  }  render() {    const { play } = this.state;    return (      <View style={styles.container}>        <CountdownTimer time={500} play={play} />        <TouchableOpacity style={styles.button} onPress={this.play}>          <Text style={styles.text}>{play ? 'Pause' : 'Play'}</Text>        </TouchableOpacity>      </View>    );  }}const styles = StyleSheet.create({  container: {    flex: 1,    backgroundColor: 'white',    alignItems: 'center',    justifyContent: 'center',  },  button: {    height: 40,    backgroundColor: '#333333',    width: 120,    alignItems: 'center',    justifyContent: 'center',  },  text: {    fontSize: 16,    fontWeight: 'bold',    color: '#cccccc',  },});

Properties

CountdownTimer Props

PropDefaultTypeDescription
timerequiredstring / numberTime (in seconds)
playtrueboolPlay the timer
wrapperStyle{}objectWrapper for the CountdownTimer
flipNumberProps{...}defaultsFlip Number Props

Flip Number Props

PropDefaultTypeDescription
numberrequiredstring / numberNumber Input
unitsecondshours / minutes / secondsNumber Input Unit
sizenumberdeviceWidth / 6Size of the card
perspective250numberPerspective
numberWrapperStyle{}objectWrapper Style
cardStyle{}objectCard Style
flipCardStyle{}objectFlip Card Style
numberStyle{}objectNumber Style

Todos

  • Full Coverage Tests for the Components
  • Support for Labels

Contribution

Questions

Feel free tocontact me orcreate an issue

About

A Flip Countdown Timer implementation in React Native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript86.4%
  • Objective-C7.2%
  • Starlark3.8%
  • Java2.6%

[8]ページ先頭

©2009-2025 Movatter.jp