OneScript

TextEditor

Edit long, multiline text.

A controlled, scrollable text area for notes and other long text. Give it a height with frame.

import { Modifier, TextEditor, useState } from "onescript/views"

function NotesEditor() {
  const [notes, setNotes] = useState("")
  return (
    <TextEditor
      value={notes}
      onChange={setNotes}
      modifier={Modifier.frame({ height: 160 })}
    />
  )
}
PropTypeDescription
valuestringCurrent text value.
onChange(value: string) => voidRuns when the user changes the text.

TextEditor has no placeholder. For a short text that grows with its content, use a TextField with axis="vertical" instead.

Also accepts Modifiers. It is only available in App and Action view sessions; widgets reject it with an unsupported view type error.

How is this guide?

Last updated on