tab

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

templ: version: v0.2.793

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tabs

func Tabs(props *Props) templ.Component

Tabs renders a tabbed interface component based on the provided props. It uses Alpine.js for interactivity and local state management.

Types

type Props

type Props struct {
	// Tabs is an array of Tab structs representing each tab in the component.
	Tabs []Tab

	// DefaultIndex - the zero based index of the tab auto-selected
	// default: "0" means the first, left most tab
	DefaultIndex string

	// TabsContainerClass specifies additional CSS classes for the tabs container.
	// Default: "" (empty string)
	TabsContainerClass string

	// ContentContainerClass specifies additional CSS classes for the content container.
	// Default: "" (empty string)
	ContentContainerClass string

	// Class additonal css / tailwind classes
	Class string
}

Props defines the properties for the Tabs component.

type Tab

type Tab struct {
	// ID is the unique identifier for the tab.
	ID string

	// Title is the text displayed on the tab button.
	Title string

	// Content is the templ.Component to be rendered when the tab is active.
	Content templ.Component
}

Tab represents a single tab in the Tabs component.

Jump to

Keyboard shortcuts

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