@8x8/oxygen-textarea
v3.1.0
Published
Oxygen - Textarea
Downloads
308
Keywords
Readme
8x8 Oxygen - Textarea
Installation
$ yarn add @8x8/oxygen-textarea$ npm install @8x8/oxygen-textareaUsage
import Textarea from '@8x8/oxygen-textarea';<Textarea />Props
Textarea
interface TextareaPropsExternal
| Name | Type | Default | Description |
| :-------------- | :-------------------------------------------------------------------------------- | :----------- | :---------------------------------------------------------------------------------- |
| theme? | Partial<TextareaTheme> | undefined | Overrides applied on top of the light or dark settings resolved by OxygenProvider |
| ref? | React.Ref<HTMLTextAreaElement> | null | Ref forwarded to the underlying textarea DOM element |
| id? | string | undefined | The ID for textarea |
| name? | string | undefined | The name for textarea |
| placeholder? | string | undefined | The content for textarea placeholder |
| autoComplete? | string | 'off' | Define autocomplete attribute for Textarea |
| autoFocus? | boolean | false | Define autofocus attribute for Textarea |
| value? | string | undefined | The textarea content value |
| rows? | number | 3 | Describe number of rows in textarea |
| cols? | number | undefined | Describe number of columns in textarea |
| minLength? | number | undefined | The textarea minimum characters number |
| maxLength? | number | undefined | The textarea maximum characters number |
| resize? | 'auto' \| 'vertical' \| 'horizontal' \| 'both' \| 'none' \| 'block' \| 'inline' | 'vertical' | Type of resize textarea |
| testId? | string | 'TEXTAREA' | Id for automated tests |
| isDisabled? | boolean | false | Tell if the textarea is disabled |
| isReadOnly? | boolean | false | Tell if the textarea is readonly |
| hasError? | boolean | false | Tell if value of textarea is valid |
| onBlur? | React.FocusEventHandler<HTMLTextAreaElement> | noop | Handler to be called when the textarea is blurred |
| onChange? | React.ChangeEventHandler<HTMLTextAreaElement> | noop | Handler to be called when the textarea changes |
| onFocus? | React.FocusEventHandler<HTMLTextAreaElement> | noop | Handler to be called when the textarea is focused |
| onKeyUp? | React.KeyboardEventHandler<HTMLTextAreaElement> | noop | Handler to be called when the key up |
| onKeyDown? | React.KeyboardEventHandler<HTMLTextAreaElement> | noop | Handler to be called when the key down |
Available styled components
- TextareaWrapper
Extend styling
You can extend/override any of the styles by importing the styled components directly.
import { Styled } from '@8x8/oxygen-textarea';
import styled from 'styled-components';
const CustomTextarea = styled(Styled.TextareaWrapper)`
color: blue;
`;