card

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package card provides card components following shadcn/ui patterns. Cards are compound components with Header, Title, Description, Content, and Footer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Card

func Card(children ...g.Node) g.Node

Card creates a card container Use with Header, Title, Description, Content, and Footer components

Example:

card.Card(
    card.Header(
        card.Title("Card Title"),
        card.Description("Card description"),
    ),
    card.Content(
        g.Text("Card content here"),
    ),
    card.Footer(
        button.Primary(g.Text("Action")),
    ),
)

func CardWithOptions

func CardWithOptions(opts []Option, children ...g.Node) g.Node

CardWithOptions creates a card with options

func Content

func Content(children ...g.Node) g.Node

Content creates a card content section

func Description

func Description(text string, opts ...Option) g.Node

Description creates a card description

func Footer(children ...g.Node) g.Node

Footer creates a card footer section

func Header(children ...g.Node) g.Node

Header creates a card header section

func Title

func Title(text string, opts ...Option) g.Node

Title creates a card title

Types

type Option

type Option func(*Props)

Option is a functional option for configuring cards

func WithAttrs

func WithAttrs(attrs ...g.Node) Option

WithAttrs adds custom attributes

func WithClass

func WithClass(class string) Option

WithClass adds custom classes

type Props

type Props struct {
	Class string
	Attrs []g.Node
}

Props defines card configuration

Jump to

Keyboard shortcuts

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