sheet

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SheetVariants = uiutils.Variants{
	Base: "fixed z-50 border-border bg-background text-foreground shadow-lg transition-transform",
	Keys: []string{"side", "size", "variant"},
	Defaults: map[string]string{
		"side":    "right",
		"size":    "default",
		"variant": "default",
	},
	ByKey: map[string]map[string]string{
		"side": {
			"left":   "inset-y-0 left-0 border-r",
			"right":  "inset-y-0 right-0 border-l",
			"top":    "inset-x-0 top-0 border-b",
			"bottom": "inset-x-0 bottom-0 border-t",
		},
		"size": {
			"sm":      "w-64 max-w-full",
			"default": "w-80 max-w-full",
			"md":      "w-80 max-w-full",
			"lg":      "w-96 max-w-full",
			"xl":      "w-[28rem] max-w-full",
			"full":    "h-full w-full max-w-none",
		},
		"variant": {
			"default":  "",
			"card":     "bg-card text-card-foreground",
			"ghost":    "border-transparent shadow-none",
			"unstyled": "",
		},
	},
}

Functions

func Sheet

func Sheet(p SheetProps) templ.Component

Sheet renders the panel root.

func SheetClasses

func SheetClasses(p SheetProps) string

func SheetClose

func SheetClose(p SheetCloseProps) templ.Component

SheetClose renders a button wired to close a sheet.

func SheetContent

func SheetContent(p SheetContentProps) templ.Component

SheetContent renders the scrollable content wrapper.

func SheetDescription

func SheetDescription(p SheetDescriptionProps, value string) templ.Component

SheetDescription renders supporting sheet copy.

func SheetHeader

func SheetHeader(p SheetHeaderProps) templ.Component

SheetHeader renders the top sheet row.

func SheetOverlay

func SheetOverlay(p SheetOverlayProps) templ.Component

SheetOverlay renders a backdrop, optionally wired as close target.

func SheetTitle

func SheetTitle(p SheetTitleProps, value string) templ.Component

SheetTitle renders a sheet title.

func SheetTrigger

func SheetTrigger(p SheetTriggerProps) templ.Component

SheetTrigger renders a button wired to a sheet.

Types

type SheetCloseProps

type SheetCloseProps struct {
	For       string
	Class     string
	Variant   string
	Size      string
	Behavior  string
	AriaLabel string
	Attrs     templ.Attributes
}

SheetCloseProps configures a button that closes a sheet.

type SheetContentProps

type SheetContentProps struct {
	ID    string
	Class string
	Attrs templ.Attributes
}

SheetContentProps configures the inner scroll container.

type SheetDescriptionProps

type SheetDescriptionProps struct {
	ID    string
	Class string
	Attrs templ.Attributes
}

SheetDescriptionProps configures supporting copy.

type SheetHeaderProps

type SheetHeaderProps struct {
	Class string
	Attrs templ.Attributes
}

SheetHeaderProps configures the header slot.

type SheetOverlayProps

type SheetOverlayProps struct {
	For      string
	Class    string
	Open     bool
	Behavior string
	Attrs    templ.Attributes
}

SheetOverlayProps configures the backdrop.

type SheetProps

type SheetProps struct {
	ID              string
	Variant         string
	Side            string
	Size            string
	Class           string
	Open            bool
	AriaLabel       string
	AriaLabelledBy  string
	AriaDescribedBy string
	Behavior        string
	Attrs           templ.Attributes
}

SheetProps configures the panel root.

type SheetTitleProps

type SheetTitleProps struct {
	ID    string
	Class string
	Attrs templ.Attributes
}

SheetTitleProps configures the title element.

type SheetTriggerProps

type SheetTriggerProps struct {
	ID        string
	For       string
	Class     string
	Variant   string
	Size      string
	Open      bool
	Behavior  string
	AriaLabel string
	Attrs     templ.Attributes
}

SheetTriggerProps configures a button that opens a sheet.

Jump to

Keyboard shortcuts

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