An open API service indexing awesome lists of open source software.

https://github.com/jarekdanielak/monospace-loader

Monospace font-based, Pac-Man style progress bar. Works everywhere.
https://github.com/jarekdanielak/monospace-loader

loader monospace pacman progress-bar web-component

Last synced: about 2 months ago
JSON representation

Monospace font-based, Pac-Man style progress bar. Works everywhere.

Awesome Lists containing this project

README

          

# monospace-loader

Monospace font-based, Pac-Man style progress bar built as a framework-agnostic Web Component.

Works in plain HTML, React, Vue, or any other framework.

![demo](./showcase/demo.gif)

## Install

```bash
npm install monospace-loader
```

## Usage

### Plain HTML

```html

import 'monospace-loader';

```

### React

```tsx
import MonospaceLoader from 'monospace-loader';

```

## Properties

| HTML attribute | React prop | Type | Default | Description |
|----------------|--------------|----------|-----------|-------------------------------------|
| `progress` | `progress` | `number` | `0` | Fill amount, 0–100 |
| `cols` | `cols` | `number` | `32` | Total character width |
| `color` | `color` | `string` | `#d35400` | Color of the Pac-Man character |
| `track-color` | `trackColor` | `string` | inherited | Color of brackets, dashes, and dots |
| `forever` | `forever` | `boolean` | `false` | Loops indefinitely, ignores `progress` |

All properties can also be set as JS properties:

```js
const el = document.querySelector('monospace-loader');
el.progress = 75;
el.color = 'steelblue';
```

## Showcase

The repo includes a React app that demonstrates all props and variants.

```bash
git clone https://github.com/jarekdanielak/monospace-loader
cd monospace-loader
npm install
npm run dev
```

## License

MIT