diff --git a/docs/content/2.components/textarea.md b/docs/content/2.components/textarea.md new file mode 100644 index 0000000..b170db2 --- /dev/null +++ b/docs/content/2.components/textarea.md @@ -0,0 +1,182 @@ +--- +description: Create a textarea component +since: 1.3.5 +--- + +## Usage + +The basic usage. + +::ComponentPreview +--- +privateProps: + placeholder: Description +--- +:: + +### Sizes + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + size: sm +--- +:: + +### Colors + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + color: primary +--- +:: + +### Variants + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + variant: outline +--- +:: + +### Placeholder + +You can also set a placeholder. + +::ComponentPreview +--- +props: + placeholder: "Description here..." +--- +:: + +### Padded + +::ComponentPreview +--- +privateProps: + placeholder: Description + variant: plain +props: + padded: false +--- +:: + +### Rows + +Set the number of rows of the textarea. + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + rows: 4 +--- +:: + +### Resize + +Enable the resize control. + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + resize: true +--- +:: + +### Auto Resize + +The `autosize` prop enables the auto resizing of the textarea. The textarea will grow in height as the user types. + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + autosize: true +--- +:: + +The `maxrows` prop can be used to set the maximum number of rows the textarea can grow to. + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + autosize: true + maxrows: 8 +--- +:: + +### Disabled + +::ComponentPreview +--- +privateProps: + placeholder: Description +props: + disabled: true +--- +:: + +### Model Modifiers + +#### .trim + +The `.trim` modifier trims the input value. + +```vue [page] + + + +``` + +#### .number + +The `.number` modifier converts the input value to a number. Non-numeric values are ignored. + +```vue [page] + + + +``` + +#### .lazy + +The `.lazy` modifier syncs the input value with the model only on `change` event. + +```vue [page] + + + +``` + +## Config + +::ComponentDefaults +:: diff --git a/src/runtime/components/forms/Textarea.vue b/src/runtime/components/forms/Textarea.vue new file mode 100644 index 0000000..e9b5025 --- /dev/null +++ b/src/runtime/components/forms/Textarea.vue @@ -0,0 +1,192 @@ + + +