ui.Badge 用胶囊形背景显示短文本,例如侧边栏条目旁的未读消息数:
ui.SidebarItem(c, "inbox", inboxIcon, "Inbox").Children(func() {
ui.Badge(c, fmt.Sprint(app.unread))
})
Go
返回的元素可用 Background 和 TextColor 设置颜色,例如用强调色徽标标示需要注意的内容。
ui.Badge(c, "New").Background(t.Accent).TextColor(t.AccentText)
Go
辅助技术在读取它所在的条目时一并读出它的文本。