82 lines
1.9 KiB
Plaintext
82 lines
1.9 KiB
Plaintext
// Code generated by wa-generator. DO NOT EDIT.
|
|
// Source: Web Awesome wa-carousel-item
|
|
|
|
package wa
|
|
|
|
import (
|
|
"github.com/a-h/templ"
|
|
)
|
|
|
|
// A carousel item represent a slide within a carousel.
|
|
//
|
|
// Web Awesome component: <wa-carousel-item>
|
|
|
|
// CarouselItemProps holds all properties for the wa-carousel-item component
|
|
type CarouselItemProps struct {
|
|
|
|
// Events
|
|
|
|
// Slots contains named slot content
|
|
Slots CarouselItemSlots
|
|
|
|
// Attrs contains additional HTML attributes
|
|
Attrs templ.Attributes
|
|
}
|
|
|
|
// CarouselItemBuilder provides a fluent API for constructing CarouselItemProps
|
|
type CarouselItemBuilder struct {
|
|
props CarouselItemProps
|
|
}
|
|
|
|
// NewCarouselItem creates a new builder for wa-carousel-item
|
|
func NewCarouselItem() *CarouselItemBuilder {
|
|
return &CarouselItemBuilder{}
|
|
}
|
|
|
|
// Attr adds a custom HTML attribute
|
|
func (b *CarouselItemBuilder) Attr(name, value string) *CarouselItemBuilder {
|
|
if b.props.Attrs == nil {
|
|
b.props.Attrs = templ.Attributes{}
|
|
}
|
|
b.props.Attrs[name] = value
|
|
return b
|
|
}
|
|
|
|
// Attrs merges multiple attributes
|
|
func (b *CarouselItemBuilder) Attrs(attrs templ.Attributes) *CarouselItemBuilder {
|
|
if b.props.Attrs == nil {
|
|
b.props.Attrs = templ.Attributes{}
|
|
}
|
|
for k, v := range attrs {
|
|
b.props.Attrs[k] = v
|
|
}
|
|
return b
|
|
}
|
|
|
|
// Props returns the built properties
|
|
func (b *CarouselItemBuilder) Props() CarouselItemProps {
|
|
return b.props
|
|
}
|
|
|
|
// Build returns the props (alias for Props for semantic clarity)
|
|
func (b *CarouselItemBuilder) Build() CarouselItemProps {
|
|
return b.props
|
|
}
|
|
|
|
// CarouselItem renders the wa-carousel-item component
|
|
templ CarouselItem(props CarouselItemProps) {
|
|
<wa-carousel-item
|
|
{ props.Attrs... }
|
|
>
|
|
{ children... }
|
|
</wa-carousel-item>
|
|
}
|
|
|
|
// CarouselItemFunc renders with a builder function for inline configuration
|
|
templ CarouselItemFunc(fn func(*CarouselItemBuilder)) {
|
|
{{ b := NewCarouselItem(); fn(b) }}
|
|
@CarouselItem(b.Props()) {
|
|
{ children... }
|
|
}
|
|
}
|