1.1.2 • Published 4 years ago

react-bulleted-textarea v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-bulleted-textarea

React component for bulleted textarea

NPM JavaScript Style Guide

Check out live demo

Install

npm install --save react-bulleted-textarea

Usage

Default Bulleted Text Area

Bulleted text area build with styled components library. (Gets buggy when used with material-ui)

import React from 'react'

import { BulletedTextArea } from 'react-bulleted-textarea'

class Example extends Component {
  render() {
    const values = ['a', 'b', 'c']
    const handleChange = (values) => {
      console.log(values) // [a, b, c]
    }
    const bulletChar = '-' // optional
    return (
      <BulletedTextArea
        onChange={handleChange}
        values={values}
        bulletChar={bulletChar}
      />
    )
  }
}

Material-UI Bulleted Text Area

Bulleted Text Area used with material ui components

import React from 'react'

import { MuiBulletedTextArea } from 'react-bulleted-textarea'

class Example extends Component {
  render() {
    const values = ['a', 'b', 'c']
    const handleChange = (values) => {
      console.log(values) // [a, b, c]
    }
    const bulletChar = '-' // optional
    return (
      <MuiBulletedTextArea
        onChange={handleChange}
        values={values}
        bulletChar={bulletChar}
      />
    )
  }
}

Props

Prop NameTypeRequiredDefault ValueDescription
onChange(values: string[]) => voidtruen/aFunction that is called everytime the user writes something in the text area
valuesstring[]false Initial values for the text area
bulletCharstringfalse-Character used as bullet points

License

MIT © chrisrabe