File: main.go

package info (click to toggle)
golang-github-charmbracelet-huh 0.5.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: makefile: 15
file content (32 lines) | stat: -rw-r--r-- 610 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main

import (
	"github.com/charmbracelet/huh"
)

func main() {
	var file string

	huh.NewForm(
		huh.NewGroup(
			huh.NewInput().
				Title("Name").
				Description("What's your name?"),

			huh.NewInput().
				Title("Username").
				Description("Select your username."),

			huh.NewFilePicker().
				Title("Profile").
				Description("Select your profile picture.").
				AllowedTypes([]string{".png", ".jpeg", ".webp", ".gif"}).
				Value(&file),

			huh.NewInput().
				Title("Password").
				EchoMode(huh.EchoModePassword).
				Description("Set your Password."),
		),
	).WithShowHelp(true).Run()
}