example

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 5 Imported by: 0

README

Dynamic Textarea Example

This example demonstrates the dynamic height functionality of the bubble-textarea component.

Running the Example

go run main.go

What to Try

  1. Type text: Watch the textarea grow as you type
  2. Add newlines: Press Enter to see hard line breaks expand the height
  3. Long lines: Type very long lines to see soft wrapping in action
  4. Reach the limit: Keep typing until you hit the MaxHeight (5 lines) and see scrolling take over
  5. Delete content: Remove text and watch the textarea shrink back down

Key Features Demonstrated

  • Dynamic height starting from 1 line
  • Maximum height of 5 lines with viewport scrolling
  • Debug information showing:
    • Current visual height
    • Maximum height setting
    • Hard line count (actual newlines)
    • Content length
    • Window width
  • Custom prompt styling
  • Border styling

Controls

  • Ctrl+C or Esc: Quit the application
  • Enter: Insert newline
  • Backspace/Delete: Remove characters
  • Standard text navigation keys work as expected

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL