tabs

package
v0.0.0-...-8815ff5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

templ: version: v0.3.960

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tabs

func Tabs(args TabsArgs) templ.Component

Tabs is the root container component that manages tab state

func TabsContent

func TabsContent(args TabsContentArgs) templ.Component

TabsContent displays the content for the active tab

func TabsList

func TabsList(args TabsListArgs) templ.Component

TabsList contains the tab triggers

func TabsTrigger

func TabsTrigger(args TabsTriggerArgs) templ.Component

TabsTrigger is a clickable tab button

Types

type TabsArgs

type TabsArgs struct {
	// ID is a unique identifier for this tabs instance (required for signal management)
	ID string

	// DefaultValue sets the initial active tab
	DefaultValue string

	// Value controls the active tab (for controlled usage)
	Value string

	// Class allows additional CSS classes to be added
	Class string

	// Attributes allows additional HTML attributes to be added
	Attributes templ.Attributes
}

TabsArgs defines the properties for the Tabs root component

type TabsContentArgs

type TabsContentArgs struct {
	// ID is the tabs instance ID (must match the parent Tabs ID)
	ID string

	// Value identifies this content and associates it with a trigger
	Value string

	// Class allows additional CSS classes to be added
	Class string

	// Attributes allows additional HTML attributes to be added
	Attributes templ.Attributes
}

TabsContentArgs defines the properties for the TabsContent component

type TabsHandler

type TabsHandler struct {
	// contains filtered or unexported fields
}

TabsHandler creates handlers for Tabs component functionality

func NewTabsHandler

func NewTabsHandler(tabsID string, signals *utils.SignalManager) *TabsHandler

NewTabsHandler creates a tabs handler

func (*TabsHandler) BuildContentAriaHidden

func (t *TabsHandler) BuildContentAriaHidden(value string) string

BuildContentAriaHidden creates the aria-hidden attribute expression

func (*TabsHandler) BuildContentShowExpression

func (t *TabsHandler) BuildContentShowExpression(value string) string

BuildContentShowExpression creates the show expression for tab content

func (*TabsHandler) BuildTriggerAriaSelected

func (t *TabsHandler) BuildTriggerAriaSelected(value string) string

BuildTriggerAriaSelected creates the aria-selected attribute expression

func (*TabsHandler) BuildTriggerClickHandler

func (t *TabsHandler) BuildTriggerClickHandler(value string) string

BuildTriggerClickHandler creates the tab trigger click handler

func (*TabsHandler) BuildTriggerDataClass

func (t *TabsHandler) BuildTriggerDataClass(value string) string

BuildTriggerDataClass creates conditional classes for tab triggers

func (*TabsHandler) BuildTriggerStateAttr

func (t *TabsHandler) BuildTriggerStateAttr(value string) string

BuildTriggerStateAttr creates the data-state attribute expression

func (*TabsHandler) BuildTriggerTabIndex

func (t *TabsHandler) BuildTriggerTabIndex(value string) string

BuildTriggerTabIndex creates the tabindex attribute expression

type TabsListArgs

type TabsListArgs struct {
	// Class allows additional CSS classes to be added
	Class string

	// Attributes allows additional HTML attributes to be added
	Attributes templ.Attributes
}

TabsListArgs defines the properties for the TabsList component

type TabsSignals

type TabsSignals struct {
	Active string `json:"active"`
}

TabsSignals defines the signal structure for tabs components

type TabsTriggerArgs

type TabsTriggerArgs struct {
	// ID is the tabs instance ID (must match the parent Tabs ID)
	ID string

	// Value identifies this trigger and associates it with content
	Value string

	// Disabled makes the trigger non-interactive
	Disabled bool

	// Class allows additional CSS classes to be added
	Class string

	// Attributes allows additional HTML attributes to be added
	Attributes templ.Attributes
}

TabsTriggerArgs defines the properties for the TabsTrigger component

Jump to

Keyboard shortcuts

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