All Projects → igeligel → react-in-out-textarea

igeligel / react-in-out-textarea

Licence: MIT license
A simple React.js User Interface Component that is like Google Translate with full TypeScript Support

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-in-out-textarea

college-management-react
This is a College management web app in MERN stack.
Stars: ✭ 42 (+50%)
Mutual labels:  yarn, hacktoberfest2021
medly-components
🧩 Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.
Stars: ✭ 66 (+135.71%)
Mutual labels:  storybook, hacktoberfest2021
React-Native-Web-TypeScript-Prettier-Boilerplate
A starterkit to work with nextjs, react-native, storybook… all with prettified typescript and in a monorepo
Stars: ✭ 16 (-42.86%)
Mutual labels:  yarn, storybook
chic-ui
Lightweight CSS-in-JS styled UI Component Library for React
Stars: ✭ 39 (+39.29%)
Mutual labels:  storybook, hacktoberfest2021
Synp
Convert yarn.lock to package-lock.json and vice versa
Stars: ✭ 510 (+1721.43%)
Mutual labels:  converter, yarn
ts-lib-scripts
以 🚀 速度创建零配置 TypeScript 库项目的命令行工具
Stars: ✭ 56 (+100%)
Mutual labels:  yarn
Stardust
🎨Tiller Design System
Stars: ✭ 19 (-32.14%)
Mutual labels:  storybook
SpotMusicGen
A Program that creates a Spotify playlist from a YouTube Playlist
Stars: ✭ 47 (+67.86%)
Mutual labels:  hacktoberfest2021
yarn-plugin-workspace-since
모노레포를 위한 yarn berry plugin
Stars: ✭ 120 (+328.57%)
Mutual labels:  yarn
xml-to-json
Simple API that converts dynamic XML feeds to JSON through a URL or pasting the raw XML data. Made 100% in PHP.
Stars: ✭ 38 (+35.71%)
Mutual labels:  converter
ipynb-py-convert
Convert .py files runnable in VSCode or Atom/Hydrogen to Jupyter .ipynb notebooks and vice versa
Stars: ✭ 38 (+35.71%)
Mutual labels:  converter
Hacktoberfest2021
Hacktoberfest is open to everyone in our global community. Whether you’re a seasoned contributor or looking for projects to contribute to for the first time, you’re welcome to participate.
Stars: ✭ 9 (-67.86%)
Mutual labels:  hacktoberfest2021
google-translate-anki
No description or website provided.
Stars: ✭ 28 (+0%)
Mutual labels:  google-translate
react-ecommerce
E-commerce monorepo application using NextJs, React, React-native, Design-System and Graphql with Typescript
Stars: ✭ 136 (+385.71%)
Mutual labels:  storybook
ogrants
Open grants list
Stars: ✭ 96 (+242.86%)
Mutual labels:  hacktoberfest2021
form-data-json
A zero dependency, cross browser library to easily get or set/manipulate form input values as/from a json object.
Stars: ✭ 37 (+32.14%)
Mutual labels:  converter
google translate desktop
Unofficial Google Translate Desktop Mac App
Stars: ✭ 15 (-46.43%)
Mutual labels:  google-translate
clojurescript-amplified
Examples on how to setup a ClojureScript web app with tools from the JavaScript ecosystem.
Stars: ✭ 59 (+110.71%)
Mutual labels:  storybook
klee
A personnal UI library made as an excuse to have a published UI package
Stars: ✭ 19 (-32.14%)
Mutual labels:  storybook
Resume-Maker
Resume Maker is tool where you can generate your resume for free. It has functionality like dynamic preview, color themes, responsive ,etc.
Stars: ✭ 40 (+42.86%)
Mutual labels:  hacktoberfest2021

react-in-out-textarea

A simple React.js component that is like Google Translate

Features

react-in-out-textarea is a highly customisable React component, for all of your input and output text needs.

Some of the unique features this component offers include:

  • Textarea fields for input and output
  • Customisable input and output labels
  • Selection of input and output types
  • Dropdown to show all your labels when they won't fit on one line
  • Fully controllable
  • Ability to copy the output text to your clipboard
  • Minimalistic, visually pleasing style
  • Variable content length

Used by

Mentioned In

Installation

Install via NPM
npm install --save react-in-out-textarea
# You might want to install react-tooltip if you activate the max length option
npm install --save react-tooltip
Install via yarn
yarn add react-in-out-textarea
# You might want to install react-tooltip if you activate the max length option
yarn add react-tooltip

Props

Name Type Required Description
inValue string ✔️ The value that is shown on the left-handed side.
outValue string ✔️ The value that is shown on the right-handed side.
inOptions array ✔️ An array of options filled with names marked true or false
onInInput function ✔️ Called to listen to when the text on the left-hand side changes
onInOptionsUpdate function ✔️ Updated with new options as the parameter when inOptions language clicked
outOptions array ✔️ An array of options filled with names marked true or false and an activeClicked boolean
onOutOptionsUpdate function ✔️ Updated with new options as the parameter when outOptions language clicked
maxContentLength number Value that defines the maximum number of characters allowed in the text area.
maxContentLengthIndicator Object An Object describing how the length indicator is shown.
onCopy function A function that is called when you have copied the content of InOutTextarea.
autoCloseMenuOnOptionSelection boolean Boolean that defines whether an option menu should self-close after selection.

Usage

React + TypeScript

CodeSandbox Example

Code Example:

import React, { useState } from 'react';
import { InOutTextarea, InOptions, OutOptions } from 'react-in-out-textarea';

export const ExampleComponent = () => {
  const [inValue, setInValue] = useState<string>('');
  const [outValue, setOutValue] = useState<string>('');
  const [inOptions, setInOptions] = useState<InOptions>([
    {
      name: 'English',
      active: true,
    },
    {
      name: 'German',
      active: false,
    },
  ]);
  const [outOptions, setOutOptions] = useState<OutOptions>([
    {
      name: 'Chinese',
      active: true,
      activeClicked: false,
    },
  ]);

  return (
    <InOutTextarea
      inValue={inValue}
      outValue={outValue}
      onInInput={(newValue) => {
        setInValue(newValue);
        setOutValue(newValue);
      }}
      inOptions={inOptions}
      onInOptionsUpdate={(newInOptions) => {
        setInOptions(newInOptions);
      }}
      outOptions={outOptions}
      onOutOptionsUpdate={(newOutOptions) => {
        setOutOptions(newOutOptions);
      }}
    />
  );
};
React + Javascript

CodeSandbox Example

Code Example:

import React, { useState } from "react";
import { InOutTextarea } from "react-in-out-textarea";

export const ExampleComponent = () => {
  const [inValue, setInValue] = useState("");
  const [outValue, setOutValue] = useState("");
  const [inOptions, setInOptions] = useState([
    {
      name: "English",
      active: true
    },
    {
      name: "German",
      active: false
    }
  ]);
  const [outOptions, setOutOptions] = useState([
    {
      name: "Chinese",
      active: true,
      activeClicked: false
    }
  ]);

  return (
    <InOutTextarea
      inValue={inValue}
      outValue={outValue}
      onInInput={(newValue) => {
        setInValue(newValue);
        setOutValue(newValue);
      }}
      inOptions={inOptions}
      onInOptionsUpdate={(newInOptions) => {
        setInOptions(newInOptions);
      }}
      outOptions={outOptions}
      onOutOptionsUpdate={(newOutOptions) => {
        setOutOptions(newOutOptions);
      }}
    />
  );
};

Development

To start developing you need the following tools installed:

After installing all the tools, you can install all dependencies by using in your terminal

yarn

After that just type:

yarn storybook

And open http://localhost:6006/. That should give you the storybook preview.

Storybook

Storybook is an open source tool for developing UI components in isolation for React, Vue, Angular, and more. It makes building stunning UIs organized and efficient.

Storybook is a tool used here for easy development of components for the web. Since this project uses React.js, the decision for storybook was kind of easy. It makes the development workflow seamless.

Our stories are saved under the ./stories directory. Feel free to have a look.

License

The code is licensed under MIT.

Contributors

Thanks goes to these wonderful people (emoji key):


Kevin Peters

💼 💻 🎨 🚇 🚧 💬 👀

Amber

💻

Katie

💻

chorongbali

💻

Santosh Viswanatham

💻 🚇

xen0m29

💻

merelj

💻

Tom Scott

💻 📖

aman601

📖

dasshield

💻

Aashwin Vaish

💻

Thomas Siller

💻

Gabrijel Golubić

📖

Tom Shamp

💻

Bink

💻

Gabriel Paixão

💻

rohitgeddam

🔧 💻

G.H.B.Emalsha Rasad

🔧 📖

Emma Dawson

💻

Sameer Waskar

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].