Background
Description
Multi-line text input that allows manual resizing
User stories
- As a user, I need to enter a long text that exceeds one line (multiline).
History
Known as MultilineTextInputWidget in OOUI. Should use native <textarea> component and follow its attributes as much as possible.
Known use cases
VE publish dialog | |
Text area use cases in Growth | |
Existing components
Wikimedia community:
- WVUI: Multiline Text Input exists
- WiKit: TextArea
- OOUI: Textarea demo
- ContentTranslation: MWInput, also for textarea
External libraries:
- Vuetify: VTextarea
- Buefy: Input, also for textarea
- Other design systems
Wikimedia Design Style Guide links:
Codex implementation
Component task owners
- Designer: @bmartinezcalvo
- Developer: @lwatson
Open questions
- Clearable action: it will not be included as we have in TextInput since it's not a common use case in text area and we would need extra padding. We will include it just if needed. (More info)
- Character counter: helper text and character counter will be created as separated elements in the Field component. They won't be added in this Text area MVP task.
- Text editing: it won't be implemented in this MVP task.
Design spec
Anatomy
The initial component will include the following properties:
Icons:
- Text-only (no icon)
- Start icon (customizable icon)
- End icon (customizable icon)
Size:
- Fixed-size (min-size 64px)
- Grabber (customizable size)
- Autosize (height will grow with the length of the text)
Style
The initial component will present the following visual features:
- Textarea will use the same styles (colors, paddings, borders, text) as TextInput component.
Interaction
The initial component will follow these interaction specifications:
- Default
- Hover
- Active-Focus
- Filled in
- Disabled
- Read-only
- Error
- Error focus (same focus style as in the Focus state)
- Error filled
Documentation
- Structure: Describe where the component will live in the sidebar hierarchy, e.g. a new sidebar item or within a group.
- Content: Describe the content of the demo page. Aim to use a configurable demo for as many features as possible, then add standalone demos where needed.
Acceptance criteria
Minimum viable product
This task covers the minimum viable product (MVP) version of this component. MVP includes basic layout, default states, and most important functionality.
MVP scope
- <textarea> element with styles matching the Figma spec sheet
- Start and end icons
- Prop for enabling autosize
- All states documented in the spec sheet
- RTL behavior documented in the spec sheet
- All keyboard navigation documented in the spec sheet
Design
- Design the Figma spec sheet and add a link to it in this task
- Publish the component in the Figma library. This step will be done by a DST member.
Code
- Implement the component in Codex
Future work
- Enabling character count when used with the Field component