TextArea
The TextArea
control provides your component a string
value that is editable in the Makeswift
builder.
AnchorExamples
AnchorA simple paragraph
In this example we register a simple Paragraph
component with its children
prop controlled by a
TextArea
control.
import { ReactRuntime } from '@makeswift/runtime/react'
import { TextArea } from '@makeswift/runtime/controls'
function Paragraph({ children }) {
return <p>{children}</p>
}
ReactRuntime.registerComponent(Paragraph, {
type: 'paragraph',
label: 'Paragraph',
props: {
children: TextArea({ label: 'Paragraph text', defaultValue: '' }),
},
})
AnchorAPI
AnchorParameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
label | string | no | 'Text' | Text for the panel lable. |
defaultValue | string | no | undefined | Will be used when the value isn't set. |
AnchorProvided value
The TextArea
control provides a string
value to your component—or undefined
if there's no
value set. Use defaultValue
if you never want your component to receive undefined
.