type Profile struct {
Name string
Email string
Saved bool
}
func ProfileForm(profile *Profile) {
Container(Attrs(Expand, Pad(18), Gap(8)), func() {
Label("Profile", FontSize(22),
FontWeight(WeightBold))
Label("Name")
TextInput(&profile.Name)
Label("Email")
TextInput(&profile.Email)
Container(Attrs(Row, CrossMid, Gap(10)), func() {
if Button(SymITick, "Save") {
profile.Saved = true
}
if profile.Saved {
Label("All changes saved",
FontSize(12),
TextColor(145, 55, 34, 1))
}
})
})
}

GitHub



















