Hi, @smith.adriane — is there any sample code on how to emulate an HTML textarea input box, where you can edit text across multiple lines? I’m trying to build something that assembles a bunch of LLM prompts, and just need textareas to put text in, and some buttons trigger actions. Thank you!!!!
Literally the equivalent to https://www.w3schools.com/tags/tag_textarea.asp Is something like this available in Skia? Or maybe in Cljfx? Thx!
There's membrane.basic-components/textarea, but you do have to opt into the membrane.component stuff
https://github.com/phronmophobic/membrane/blob/master/src/membrane/example/todo.cljc may be a good starting point
Thx so much! I was just studying the TODO example — is there a way to set the # of rows or vertical size of the textarea? (Or do you do it by putting it in a layout object?) Keep up all the amazing work!
Not currently.
Roger roger!!!
And thx!
Are you just trying to make it easier to click to focus? Or just a minimum size?
Some prompt elements might be thousands of lines, so I'd want to set {:rows 50} or even 20. Others prompt elements are super intricate, and I'd want to user to have 50 lines to see a bigger part of the prompt. In my ideal, a starting layout would be: • column left ◦ user prompt: 50 lines ◦ user context: 10 line (might be quite large, not mostly paste and forget) ◦ project prompt: 20 lines ◦ project context: 10 lines (thousands of lines: paste and forget) • column right ◦ response from Claude: 50 lines (entire vertical space of window) Purely FYI — just trying to find the easiest way to write an app like this.
Ok, it's helpful to know what folks are trying to do to help prioritize future development. A text input designed for editing thousands of lines of text is currently beyond the scope of any of the builtin components. It's something I would eventually like to have, but it doesn't exist yet.
Editing dozens of lines of text is workable. You can wrap the textarea in a scrollview to limit the size.
It would also be possible to make a component that is a text input for <50 lines of text and becomes a component that shows the first 20 lines (non-editable) otherwise.
I realize that might not be enough to fit your requirements, but happy to help try to make it work if you're interested.