1.0.1 • Published 1 year ago

@ibrahimstudio/textarea v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@ibrahimstudio/textarea, a reusable, highly customizable <textarea> component for React applications. This component allows developers to create beautiful, functional text areas with advanced styling, accessibility options, and a wide range of configurations for different use cases.

The custom <textarea> component provides an enhanced text area for React applications. It supports dynamic customization, accessibility features, and integrations with form management systems. Designed with flexibility in mind, this component helps developers implement complex features without sacrificing ease of use.

Code by Ibrahim Space Studio, Design by Ibrahim Design Studio.

1. Features

  • Customizable Styling: Define border radius, colors, and more with dedicated props.
  • Accessibility Support: Includes attributes like aria-label, autocomplete, and more.
  • Validation Features: Show error or additional messages dynamically.
  • Responsive Input Handling: Supports flexible configurations like minlength, maxlength, and word wrapping.
  • Flexible Dimensions: Adjust the number of visible rows easily.

2. Installation

You can install this package via npm:

npm i @ibrahimstudio/textarea

or via yarn:

yarn add @ibrahimstudio/textarea

3. Usage

Import the Textarea component in your React application:

import { Textarea } from "@ibrahimstudio/textarea";

Custom Styling

You can customize the appearance of the component by passing style-related props like radius, bcolor (background color), pcolor (primary color), and scolor (secondary color)

Handling Validation

Use the errormsg and additmsg props to display error or additional information dynamically.

4. API

Textarea Props

AttributeTypeRequiredDescriptionDepend ToDefault
idstringYesA unique identifier for the component.-'@ibrahimstudio/textarea'
formstring-Associates the textarea with a <form> element via its id.--
namestringYesThe name of the textarea, used in form submissions.-'textarea'
placeholderstring-Placeholder text displayed inside the textarea when it's empty.-'Typing in here now ...'
valuestring numberYesThe current value of the textarea.-''
autocomplete'on' 'off' string-Specifies whether autocomplete is enabled.--
autocapitalizestring-Determines capitalization behavior for text input.--
autocorrect'on' 'off'-Specifies whether autocorrect is enabled.--
spellcheckboolean-Enables spellchecking for the textarea.--
wrap'hard' 'soft' 'off'-Specifies how text is wrapped in the textarea.--
minlengthnumber-Minimum number of characters allowed.--
maxlengthnumber-Maximum number of characters allowed.--
radius'none' 'sm' 'md' 'lg' 'full' string-Border radius for the textarea.-'md'
bcolorstring-Background color for the textarea.-'var(--theme-color-base)'
pcolorstring-Primary color, often used for text or border highlights.-'var(--theme-color-primary)'
scolorstring-Secondary color for hover or focus states.-'var(--theme-color-secondary)'
labeledboolean-Determines if the textarea includes a label.-true
labelstringYesText for the label when labeled is true.labeled='true''ISS Textarea'
requiredboolean-Marks the textarea as required for form submission.-false
readonlyboolean-Makes the textarea read-only, disabling user input.-false
disabledboolean-Disables the textarea entirely.-false
errormsgstring-Error message displayed below the textarea.--
additmsgstring-Additional information or helper text displayed below the textarea.--

Textarea Event(s)

AttributeTypeRequiredDescriptionDepend To
onChangeReact.ChangeEventHandlerYesCallback fired when the value of the textarea changes.-

5. Contributing

Contributions are welcome! If you have any improvements, bug fixes, or features, feel free to open an issue or create a pull request on GitHub.

6. License

This project is licensed under the MIT License - see the LICENSE file for details.

1.0.1

1 year ago

1.0.0

1 year ago