npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-dot-matrix-text

v1.0.3

Published

A lightweight Expo-compatible React Native component library for rendering customizable 5x5 dot-matrix text using pure View-based glyphs.

Readme

expo-dot-matrix-text

A lightweight Expo-compatible React Native component library for rendering customizable 5x5 dot-matrix text using pure View-based glyphs.

The package has no native code and does not depend on Skia, SVG, Canvas, Reanimated, or Expo-specific APIs. It works in Expo Go, development builds, plain React Native apps, and React Native Web.

INSTALL UNKIND rendered with dot matrix text

Preview

Animated dot matrix text demo

Dot matrix text variants showcase

Installation

npm install expo-dot-matrix-text
yarn add expo-dot-matrix-text

Quick Start

import { DotMatrixText } from 'expo-dot-matrix-text';

export function InstallBanner() {
  return <DotMatrixText text="INSTALL UNKIND" />;
}

With custom styling:

<DotMatrixText
  text="INSTALL UNKIND"
  color="#f97316"
  dotSize={5}
  dotGap={1}
  letterSpacing={5}
  variant="dots"
/>

Usage

Basic Text

import { DotMatrixText } from 'expo-dot-matrix-text';

<DotMatrixText text="INSTALL UNKIND" />;

Sizes

Control the size of each dot with dotSize, and the spacing around each dot with dotGap.

<DotMatrixText text="INSTALL UNKIND" dotSize={3} dotGap={1} />

<DotMatrixText text="INSTALL UNKIND" dotSize={6} dotGap={2} />

Colors

color controls active cells. Inactive cells use the active color with reduced opacity by default.

<DotMatrixText text="INSTALL UNKIND" color="#22c55e" />

Use inactiveOpacity to make inactive cells more or less visible:

<DotMatrixText
  text="INSTALL UNKIND"
  color="#38bdf8"
  inactiveOpacity={0.06}
/>

Use inactiveColor when you want inactive cells to have a separate color:

<DotMatrixText
  text="INSTALL UNKIND"
  color="#facc15"
  inactiveColor="#1f2937"
/>

Variants

The variant prop controls the shape of each active and inactive cell.

<DotMatrixText text="INSTALL UNKIND" variant="dots" />
<DotMatrixText text="INSTALL UNKIND" variant="square" />
<DotMatrixText text="INSTALL UNKIND" variant="rounded" />

Available variants:

| Variant | Shape | | --- | --- | | dots | Circular dots | | square | Sharp square cells | | rounded | Rounded square cells |

Multiline Text

Use \n to render multiple lines.

<DotMatrixText
  text={'INSTALL\nUNKIND'}
  color="#c084fc"
  dotSize={5}
  lineHeight={12}
/>

Alignment

Use align with a constrained container width.

<DotMatrixText
  text={'INSTALL\nUNKIND'}
  align="center"
  style={{ width: 260 }}
/>
<DotMatrixText
  text="INSTALL UNKIND"
  align="right"
  style={{ width: 320 }}
/>

Wrapping

Wrapping is enabled by default. Set wrap={false} for a single unwrapped row.

<DotMatrixText
  text="INSTALL UNKIND"
  wrap={false}
/>

For wrapping text, constrain the container width:

<DotMatrixText
  text="INSTALL UNKIND"
  style={{ width: 180 }}
/>

Presets

Use DOT_MATRIX_PRESETS for common sizes.

import { DOT_MATRIX_PRESETS, DotMatrixText } from 'expo-dot-matrix-text';

<DotMatrixText text="INSTALL UNKIND" {...DOT_MATRIX_PRESETS.small} />;

<DotMatrixText
  text="INSTALL UNKIND"
  color="#a3e635"
  {...DOT_MATRIX_PRESETS.medium}
/>;

<DotMatrixText
  text="INSTALL UNKIND"
  color="#facc15"
  {...DOT_MATRIX_PRESETS.large}
/>;

Current presets:

| Preset | dotSize | dotGap | | --- | ---: | ---: | | small | 2 | 1 | | medium | 4 | 1 | | large | 6 | 2 |

Styling Each Dot

Use dotStyle to apply additional React Native styles to every cell.

<DotMatrixText
  text="INSTALL UNKIND"
  color="#14b8a6"
  dotStyle={{
    borderWidth: 1,
    borderColor: '#ffffff33',
  }}
/>

Styling the Container

Use style for the outer container.

<DotMatrixText
  text="INSTALL UNKIND"
  color="#f8fafc"
  style={{
    backgroundColor: '#020617',
    padding: 16,
  }}
/>

Accessibility

The component is accessible by default and uses text as the accessibility label unless you provide accessibilityLabel.

<DotMatrixText
  text="INSTALL UNKIND"
  accessibilityLabel="Install Unkind"
/>

Testing

Use testID on the outer container.

<DotMatrixText
  text="INSTALL UNKIND"
  testID="install-unkind-dot-matrix"
/>

API

import {
  DotMatrixChar,
  DotMatrixText,
  DOT_MATRIX_PRESETS,
  GLYPHS,
  getGlyph,
  registerGlyphs,
} from 'expo-dot-matrix-text';

import type {
  DotMatrixCharProps,
  DotMatrixGlyph,
  DotMatrixPreset,
  DotMatrixTextProps,
} from 'expo-dot-matrix-text';

DotMatrixText

DotMatrixText is the primary component. It renders each character as a 5x5 glyph.

| Prop | Type | Default | Description | | --- | --- | --- | --- | | text | string | Required | Text to render. Supports \n for multiple lines. | | color | string | '#10b981' | Active cell color. | | inactiveColor | string | undefined | Optional color for inactive cells. | | inactiveOpacity | number | 0.13 | Opacity for inactive cells when inactiveColor is not set. | | dotSize | number | 2 | Width and height of each cell. | | dotGap | number | 1 | Space around each cell. Internally applied as margin: dotGap / 2. | | letterSpacing | number | 4 | Space between rendered characters. | | lineHeight | number | 6 | Space between rendered lines. | | align | 'left' \| 'center' \| 'right' | 'left' | Horizontal alignment of each line inside the container. | | wrap | boolean | true | Allows characters to wrap inside a constrained width. | | variant | 'dots' \| 'square' \| 'rounded' | 'rounded' | Cell shape. | | dotStyle | StyleProp<ViewStyle> | undefined | Extra style applied to every cell. | | style | StyleProp<ViewStyle> | undefined | Style applied to the outer container. | | glyphs | Record<string, DotMatrixGlyph> | undefined | Per-component glyph overrides. | | fallbackChar | string | '?' | Character used when no glyph exists for a given input character. | | testID | string | undefined | Test id for the outer container. | | accessibilityLabel | string | text | Accessibility label for the rendered text. |

Custom Glyphs

A glyph is an array of strings. Each string is one row. The built-in glyphs use 5 rows and 5 columns.

import type { DotMatrixGlyph } from 'expo-dot-matrix-text';

const customA: DotMatrixGlyph = [
  '11111',
  '10001',
  '11111',
  '10001',
  '10001',
];

Only 1 is treated as active. Any other character is treated as inactive.

Per-Component Glyphs

Use the glyphs prop to override characters for one component instance.

const glyphs = {
  A: ['11111', '10001', '11111', '10001', '10001'],
};

<DotMatrixText text="INSTALL UNKIND" glyphs={glyphs} />;

Global Glyph Registration

Use registerGlyphs to register custom glyphs globally.

import { registerGlyphs } from 'expo-dot-matrix-text';

registerGlyphs({
  '~': ['00000', '01010', '10100', '00000', '00000'],
});

Then any DotMatrixText can render the character:

<DotMatrixText text="INSTALL UNKIND ~" />

Custom glyph keys are normalized to uppercase.

getGlyph

getGlyph returns the glyph for a single character.

import { getGlyph } from 'expo-dot-matrix-text';

const glyph = getGlyph('I');

Resolution order:

  1. Registered custom glyph
  2. Built-in glyph
  3. Built-in ? fallback glyph

Lowercase input is normalized:

getGlyph('i') === getGlyph('I');

DotMatrixChar

DotMatrixChar renders one glyph. Most apps should use DotMatrixText, but this lower-level component is available for custom composition.

import { DotMatrixChar, getGlyph } from 'expo-dot-matrix-text';

<DotMatrixChar
  glyph={getGlyph('U')}
  color="#22c55e"
  inactiveOpacity={0.13}
  dotSize={4}
  dotGap={1}
  variant="rounded"
/>;

Built-In Characters

The built-in glyph map includes:

  • Uppercase letters A-Z
  • Digits 0-9
  • Space
  • Common punctuation: . , : ; ! ? ' " - _ + = / \ |
  • Brackets: ( ) [ ] { } < >
  • Symbols: @ # $ % & *
  • Special symbols: ♥ ★ • ↑ ↓ ← →

Unsupported characters fall back to ? unless you provide fallbackChar or custom glyphs.

Expo and React Native Compatibility

This library is pure React Native UI. It can be used in:

  • Expo Go
  • Expo development builds
  • EAS builds
  • Bare React Native apps
  • React Native Web

No native install step is required.

License

MIT