diff --git a/src/components/form-textarea/README.md b/src/components/form-textarea/README.md index ec0b5d0cec4..9e1453d7e4e 100644 --- a/src/components/form-textarea/README.md +++ b/src/components/form-textarea/README.md @@ -29,30 +29,59 @@ export default { ``` -## Displayed rows +## Control sizing +Set text height using the `size` prop to `sm` or `lg` for small or large respectively. -`` automaticlly adjusts its height (text rows) to fit the content, -even as the user enters text. For a textarea with no content, the number of rows -starts at `1`. +To control width, place the input inside standard Bootstrap grid column. -To set the initial minimum height (in rows), set the `rows` prop to the desired -number of lines. If no value is provided to `rows`, then it will default to `1`. +```html + + + + + + + + + + + + + + + + + + + + + + +``` -To limit the maximum rows that the text area will grow to (before showing a scrollbar), -set the `max-rows` prop to the maximum number of lines of text. -To keep the text-area at a set height, set both `rows` and `max-rows` to the same value. +## Displayed rows +To set the height of ``, set the `rows` prop to the desired number of +rows. If no value is provided to `rows`, then it will default to `2` (the browser +default and minimum acceptable value). Setting it to null or a value below 2 will +result in the default of `2` being used. -**Note:** auto rows will only work when the user explicitly enters newlines in the textarea. +### Disable resize handle +Some web browsers will allow the user to re-size the height of the textarea. +To disable this feature, set the `no-resize` prop to `true`. -### Disable resize +### Auto height +`` can also automatically adjust its height (text rows) to fit the content, +even as the user enters text. -Note that some web browsers will allow the user to re-size the hight of the textarea. -To disable this, set the `no-resize` prop to `true`. +To set the initial minimum height (in rows), set the `rows` prop to the desired +number of lines (or leave it at the default of `2`). +To limit the maximum rows that the text area will grow to (before showing a scrollbar), +set the `max-rows` prop to the maximum number of lines of text. -## Contextual states +## Textarea contextual states Bootstrap includes validation styles for `valid` and `invalid` states on most form controls. Generally speaking, you’ll want to use a particular state for specific types of feedback: @@ -61,16 +90,16 @@ Generally speaking, you’ll want to use a particular state for specific types o - `null` Displays no validation state To apply one of the contextual state icons on ``, set the `state` prop to: -- `'invalid'` or `false` to apply invalid styling) -- `'valid'` or `true` to apply valid highlighting, +- The string `'invalid'` or Boolean `false` to apply invalid styling +- The string `'valid'` or Boolean `true` to apply valid styling - `null` for no validation contextual state ```html @@ -88,7 +117,6 @@ export default { ``` ### Conveying contextual state to assistive technologies and colorblind users - Using these contextual states to denote the state of a form control only provides a visual, color-based indication, which will not be conveyed to users of assistive technologies - such as screen readers - or to colorblind users. @@ -98,11 +126,10 @@ include a hint about state in the form control's `