card

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: 3 Imported by: 0

Documentation

Overview

templ: version: v0.2.793

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Card

func Card(props *Props) templ.Component

Card renders a card component based on the provided props. It can be customized with additional classes and attributes.

Usage:

@components.Card(components.Props{
  Class: "custom-card",
  Attrs: templ.Attributes{"data-testid": "my-card"},
}) {
  // Card content goes here
}

Props:

  • Class: Additional CSS classes to apply to the card. Default: "" (empty string)
  • Attributes: Additional HTML attributes to apply to the card element. Default: nil

func CardContent

func CardContent() templ.Component

CardContent renders the main content section of a card.

Usage:

@components.CardContent() {
  // Main card content goes here
}

func CardDescription

func CardDescription() templ.Component

CardDescription renders the description of a card.

Usage:

@components.CardDescription() {
  This is a detailed description of the card's content.
}

func CardFooter

func CardFooter() templ.Component

CardFooter renders the footer section of a card.

Usage:

@components.CardFooter() {
  @button.Button(&button.Props{Label: "Submit"})
}

func CardHeader

func CardHeader() templ.Component

CardHeader renders the header section of a card.

Usage:

@components.CardHeader() {
  @components.CardTitle() { Card Title }
  @components.CardDescription() { Card description goes here }
}

func CardTitle

func CardTitle() templ.Component

CardTitle renders the title of a card.

Usage:

@components.CardTitle() {
  My Card Title
}

Types

type Props

type Props struct {
	// Class specifies additional CSS classes to apply to the card.
	// Default: "" (empty string)
	Class string

	// Attrs allows passing additional HTML attributes to the card element.
	// Default: nil
	Attrs templ.Attributes
}

Props defines the properties for the Card component.

Jump to

Keyboard shortcuts

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