Socket
Socket
Sign inDemoInstall

ink-progress-bar

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ink-progress-bar

a customizable progress bar for ink


Version published
Weekly downloads
2.3K
decreased by-63.02%
Maintainers
1
Install size
162 kB
Created
Weekly downloads
 

Readme

Source

ink-progress-bar

Build Status

Progress bar component for Ink.

Install

$ npm install ink-progress-bar

Usage

See examples/basic.js for an example app. Run it with ./examples/run basic.

import React, { Component } from 'react';
import { Color } from 'ink';
import ProgressBar from 'ink-progress-bar';

class MyProgress extends Component {
	render() {
		return (
			<>
				<Color red>
				<ProgressBar
					left={text.length}
					percent={this.state.done / TASKS}
				/>
				</Color>
			</>
		);
	}
}

Props

All props except the ones below are passed to <Text> as-is.

character

Type: string
Default: '█'

The character to use for each step.

percent

Type: number
Default: 0

The percentage (between 0 and 1) of progress.

left

right

Type: number
Default: 0

The number of characters to subtract from each side of the progress bar. Commonly used if you want text before/after the progress bar on the same line. See examples/basic.js for an example.

License

MIT © Frankie Bagnardi

FAQs

Last updated on 12 Apr 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc