infobar

package
v0.5.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 7 Imported by: 0

README

infobar

infobar is a top contact/location bar component displaying contact information items (phone, email, address, working hours) with SVG icons.

Usage

import "github.com/tinywasm/components/infobar"

bar := &infobar.InfoBar{
    Items: []infobar.InfoItem{
        {Icon: infobar.IconPhone, Text: "+56 9 1234 5678", Href: "tel:+56912345678"},
        {Icon: infobar.IconMail, Text: "contacto@clinica.cl", Href: "mailto:contacto@clinica.cl"},
        {Icon: infobar.IconPin, Text: "Av. Providencia 1234"},
        {Icon: infobar.IconClock, Text: "Lun-Vie 8:00 - 20:00"},
    },
}

Documentation

Index

Constants

View Source
const (
	PartItem = widget.Part("item")
	PartIcon = widget.Part("icon")
	PartText = widget.Part("text")
)
View Source
const (
	IconPhone = svg.Icon("infobar-phone")
	IconMail  = svg.Icon("infobar-mail")
	IconPin   = svg.Icon("infobar-pin")
	IconClock = svg.Icon("infobar-clock")
)

Default icons provided by infobar (geometry provided in svg.go).

View Source
const NameInfoBar = widget.Name("infobar")

NameInfoBar is the widget name for infobar.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoBar

type InfoBar struct {
	Element
	Items []InfoItem
}

InfoBar renders a top strip of contact and location information.

func (*InfoBar) IconSvg

func (ib *InfoBar) IconSvg() *sprite.Sprite

IconSvg registers default icons for contact items (phone, email, pin, clock).

func (*InfoBar) Render

func (ib *InfoBar) Render() *Element

func (*InfoBar) RenderCSS

func (ib *InfoBar) RenderCSS() *css.Stylesheet

RenderCSS defines the stylesheet for infobar.

func (*InfoBar) WidgetKind

func (ib *InfoBar) WidgetKind() widget.Kind

func (*InfoBar) WidgetName

func (ib *InfoBar) WidgetName() widget.Name

type InfoItem

type InfoItem struct {
	Icon svg.Icon
	Text string
	Href string
}

InfoItem represents an entry in the contact/information bar.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL