Text

Text component display a text.

The text supports emoji shortcodes: :tada: renders as 🎉.

API

func Text(c *tgframe.Container, text string, conf ...*TextConf)
  • c is Parent container.
  • text is the text.
  • conf is an optional configuration, at most one.
// TextConf is the configuration for the Text component.
type TextConf struct {
	tgframe.Base // ID
}

Example

	tgcomp.Text(p.Main, "Text")
tgcomp.Text(p.Main, "Text", &tgcomp.TextConf{ID: "greeting"})

Components are placed by position rather than by identity, so the same text written twice shows twice:

	tgcomp.Text(p.Main, "written twice")
	tgcomp.Text(p.Main, "written twice")

text component