1.1.0-candidate.1 • Published 2 years ago

react-fake-code v1.1.0-candidate.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Fake Code language

A React component that generates random (or predefined), customizable, colorful skeleton code purposed for beautiful tech landing pages.

Table of Contents

Installation

npm i react-fake-code

Usage

You can use the component prop-emptied. This will generate random fake code based on the default props.

import { FakeCode } from "react-fake-code";

function MyComponent() {
  return <FakeCode />;
}

Options

Prop nameProp typeDescription
animationTimenumberTotal duration in seconds of the fake typing animation.Default value: 2
colorsstring[]Colors of the fake words.Default value: ["#ffb86c", "#ff79c6", "#50fa7b", "#bd93f9", "#ff5555"] (Dracula theme colors)
minLinesnumberMinimum number of lines of code.Default value: 5
maxLinesnumberMaximum number of lines of code.Default value: 8
minWordsPerLinenumberMinimum number of fake words per line.Default value: 2
maxWordsPerLinenumberMaximum number of fake words per line.Default value: 5
minWordWidthnumberMinimum width of words.Default value: 15
maxWordsPerLinenumberMaximum width of words.Default value: 45
maxIndentnumberMaximum indentation of lines.Default value: 45
predefinedLinesLineType[]You can ignore the random fake code generator and use your own fake code object.Example: [{ indent: 0, words: [{ width: 45, color: "#ffb86c" }] }, { indent: 1, words: [{ width: 34, color: "#ff79c6" }, { width: 40, color: "#50fa7b" }] }]
tabWidthnumberWidth of fake indentation tab.Default value: 20
wordStyleReact.CSSPropertiesIncrement or override the fake word style.Example: { height: 20, borderRadius: 14 }

License

MIT © Luiz Fernando Schiestl Alexandre