Textarea¶
Textarea
component can be used to create a textarea element for long text inputs.
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import INKAPI from './inkapi.js'
INKAPI.ready(async () => {
const UI = INKAPI.ui;
const sidebarObj = await UI.create({
type: "Sidebar",
sidebarTitle: "Personal Sidebar",
icon: "./sample.svg",
children: [``
{
type: "Textarea",
id: "myTxt",
rows: 4, // default 5
placeholder: "write your special message.",
styles: {
borderRadius: 5,
}
},
],
});
console.log(sidebarObj);
});
|
Options¶
Name |
Type |
Description |
---|---|---|
id? |
|
You can assign a unique id to the component. It will be helpful for listening to events and removing component in future. If |
type |
|
This field should be passed |
rows? |
|
Number of rows in textarea element. Defaults to 5 |
placeholder? |
|
Placeholder value for the textarea element. |
styles? |
|
Custom styles for the element. |
Shadow Methods¶
Methods |
Arguments |
Description |
---|---|---|
setValue |
value: |
This function is used to set value of the textarea component. |
getValue |
|
This function is used to get the current value of the textarea component. |