herobanner

package
v0.5.30 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 6 Imported by: 0

README

herobanner

herobanner is a prominent header component for site landing pages, featuring background images, main title, subtitle, and call-to-action buttons.

Usage

import (
    "github.com/tinywasm/components/actionbutton"
    "github.com/tinywasm/components/herobanner"
)

hero := &herobanner.HeroBanner{
    Title:    "Salud y Cuidado Integral",
    Subtitle: "Especialistas dedicados a tu bienestar y el de tu familia.",
    Images:   []string{"/images/hero1.jpg", "/images/hero2.jpg"},
    Actions: []dom.Component{
        &actionbutton.ActionButton{Text: "Reserva tu hora", Variant: "primary"},
        &actionbutton.ActionButton{Text: "Ver especialidades", Variant: "secondary"},
    },
}

Nota sobre Images: El campo Images recibe rutas base sin sufijo de variante (por ejemplo, /images/hero1.jpg). La renderización genera automáticamente los atributos srcset con las tres variantes (.S.jpg, .M.jpg, .L.jpg) y sizes="100vw".

Documentation

Index

Constants

View Source
const (
	PartMedia    = widget.Part("media")
	PartContent  = widget.Part("content")
	PartTitle    = widget.Part("title")
	PartSubtitle = widget.Part("subtitle")
	PartActions  = widget.Part("actions")
)
View Source
const NameHeroBanner = widget.Name("herobanner")

NameHeroBanner is the widget name for herobanner.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeroBanner

type HeroBanner struct {
	Element
	Title    string
	Subtitle string
	Images   []string
	Actions  []Component
}

HeroBanner displays a prominent header banner with text, background image(s), and actions.

func (*HeroBanner) Render

func (h *HeroBanner) Render() *Element

func (*HeroBanner) RenderCSS

func (h *HeroBanner) RenderCSS() *css.Stylesheet

RenderCSS defines the visual stylesheet for herobanner.

func (*HeroBanner) WidgetKind

func (h *HeroBanner) WidgetKind() widget.Kind

func (*HeroBanner) WidgetName

func (h *HeroBanner) WidgetName() widget.Name

Jump to

Keyboard shortcuts

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