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 CSS & React built Split Flap or Solari display

License

NotificationsYou must be signed in to change notification settings

robonyong/react-split-flap-display

Repository files navigation

A React component that mimics a Split-Flap/Solari display, cos I like Solari boards & wanted to practice creating NPM modules.

NPM

Live Demo + Docs

Install

npm install --save react-split-flap-display

Usage

importReactfrom'react';importSplitFlapDisplayfrom'react-split-flap-display';exportdefaultfunctionDisplay(){return<SplitFlapDisplaycharacterSet={['1','2','3','4',':']}value="12:34"/>;}

Props

KeyTypeDefaultDescription
backgroundstring'#000000'Hex or rgb() string for the display's background
borderColorstring'#dddddd'Hex or rgb() string for the color of the border between characters
borderWidthstring'1px'Any valid CSS width value for the width of the border between characters
characterSetArray of strings (required)nullThe array of characters for the display to flip through
characterWidthstring'1em'Any valid CSS width value for the width of each character. Useful with non-monospaced fonts
minLengthnumber0Minimum # of characters in the display
padDirectionstring'left'If minLength > number of characters currently displayed, append blank characters to left or right side
splitWidthstring'1px'Any valid CSS width value for the width of the "axis" between the top and bottom of a character
stepnumber200Sets the speed (ms) of flips
textColorstring'#dddddd'Hex or rgb() string for color of the display characters
valuestring (required)''The string of characters to display or flip to
withSoundboolean or stringnullOptionally load and play a sound with every flip.
Sound duration must be less than or equal tostep duration.
true loads an mp3 I recorded of a single Vestaboard bit flipping

ForcharacterSet, there are three convenience constants that ship with this component fromreact-split-flap-display/constants (you can see how they might be used in the example):

NUMERIC:[0-9]
ALPHA: whitespace' ' +[A-Z]
PUNCTUATION: the non-alphanumeric characters found in aVesta Board

This component inherits the font family and font size from its parents. If you want to control those properties specifically for this display, wrap it in a container or pass aclassName with those properties defined.

License

MIT ©Robin Yang

About

A CSS & React built Split Flap or Solari display

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp