Skip to main content
TextEditor(props: { text: string; setText: (text: string) => void }): Component

Parameters

props
{ text: string; setText: (text: string) => void }
Configuration object for the text editor.

Support

Usage

Basic text editor

const [content, setContent] = useState("")

return TextEditor({ text: content, setText: setContent })
    .frame({ minHeight: 200 })

Note-taking app

    const [noteContent, setNoteContent] = useState("Start typing your note...")

    return VStack([
        Text("My Notes")
            .font("title")
            .padding("bottom", 20),

        TextEditor({ text: noteContent, setText: setNoteContent })
            .frame({ minHeight: 300 })
            .border({ style: Color("gray"), width: 1 })
            .cornerRadius(8)
            .padding(12)
    ])