1.0.4 • Published 2 years ago

textarea-notebook v1.0.4

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

textarea-notebook - A ReactJS component

Use notebook like styles in your textarea components. It will auto adapt line sizes according to the font-size.

Live Demo

https://brunogimenes.github.io/textarea-notebook

npm.io

Install

npm

npm install textarea-notebook

yarn

yarn textarea-notebook

Usage

import { TextareaNotebook } from "textarea-notebook";

<TextareaNotebook
    value={value}
    onChange={(e) => setValue(e.target.value}}
    style={{
        minHeight: 400,
    }}
    options={{
		verticalLineColor: "#d0a090",
		lineColor: "#fcf9cc",
		lineBorderColor: "#ccd",
		verticalLineWidth: 2,
		fontSize: 18,
		marginLeft: 50,
	}}
/>

Options

You can customize colors, margins and sizes using the options attribute of the component.

TextareaNotebook accepts all the same props as a regular textarea element, like value, onChange, style, className, etc...

PropertyTypeDescriptionDefault
verticalLineColorstringThe left vertical line color"#d0a090"
lineColorstringThe horizontal lines background"#fcf9cc"
lineBorderColorstringThe horizontal lines border color"#ccd"
verticalLineWidthnumberThe width of the left vertial line2
fontSizenumberThe fontSize for the component. line-height will be calculated based on this value. If you use custom classes or styles, be sure to use the same value here as the computed style18,
marginLeftnumberThe margin between the left of the element and the text. Also defines where the vertical line will be50
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago