0.0.7 • Published 5 months ago

dot-matrix-display v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Dot Matrix Display

A React component that creates a dot matrix display effect for transitioning between text patterns. Perfect for creating retro-style animated displays or information boards.

Try it out here.

Installation

npm install dot-matrix-display

Usage

import MatrixDisplay from 'dot-matrix-display';

const App = () => {
  const texts = [
    {
      pattern: "HELLO",
      secondary_text: "Welcome Message"
    },
    {
      pattern: "WORLD",
      secondary_text: "Second Message"
    }
  ];

  return (
    <MatrixDisplay 
      texts={texts} 
      duration={5000} // Optional: defaults to 5000ms
    />
  );
};

Props

PropTypeDefaultDescription
textsTextItem[]RequiredArray of text items to display
durationnumber5000Time in milliseconds between transitions

TextItem Interface

import MatrixDisplay, { TextItem } from 'dot-matrix-display';

const App = () => {
  const texts:TextItem = [
    {
      pattern: "HELLO",
      secondary_text: "Welcome Message"
    },
    {
      pattern: "WORLD",
      secondary_text: "Second Message"
    }
  ];

  return (
    <MatrixDisplay 
      texts={texts} 
      duration={5000} // Optional: defaults to 5000ms
    />
  );
};

Pattern Constraints

  • Maximum length: 6 characters
  • Supported characters: A-Z, a-z, and space

Features

  • Smooth transition effects between texts
  • Customizable transition timing
  • Supports only A-Z, a-z and space
  • Secondary text display
  • Retro dot matrix display style
  • Responsive design

Styling

The component comes with default styling that can be customized using CSS. The main classes are:

  • .facts-wrapper: Container for the entire component
  • .pattern-grid: Grid container for the dot matrix
  • .pattern-row: Individual rows in the matrix
  • .pattern-cell: Individual dots (active/inactive states)
  • .facts-secondary-text: Style for the secondary text

License

MIT

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago