Skip to content

Note: no newline between Next button and description text #338

Open
@FusionFont

Description

Screenshot:

(Without this newline, the Next button show on the same line after the description, looks weird)

image

Code:

func Note() (string, error) {
	theme := huh.ThemeCharm()
	keymap := huh.NewDefaultKeyMap()

	choice := true

	err := huh.NewForm(
		huh.NewGroup(
			huh.NewNote().
				Title("This is title or rather header").
				Description("Some words to show").
				Next(true).
				NextLabel("ACK").
				Height(5),
		),
	).
		WithWidth(Width).
		WithHeight(Height).
		WithTheme(theme).
		WithKeyMap(keymap).
		WithShowHelp(ShowHelp).
		// WithTimeout(5 * time.Second).
		//WithProgramOptions(tea.WithAltScreen()).
		Run()

	// run
	fmt.Println("Value:", choice)
	if err != nil {
		isAbortErr := errors.Is(err, huh.ErrUserAborted)
		if isAbortErr {
			return "ABORTED", nil
		}
		return es, err
	}
	return fmt.Sprintf("%t", choice), nil
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnote

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions