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.

Paragraph text area panel

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

ParameterTypeRequiredDefaultDescription
labelstringno'Text'Text for the panel lable.
defaultValuestringnoundefinedWill 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.