Skip to main content
tc

Display

Cards, tables, badges, avatars, charts, kanban, carousel.

# Cards

Standard Card

Sharp corners by default

This is a standard card with header and content.

Squircle Card

iOS-style continuous corners

Composed with Class: "rounded-xl tc-squircle". Browsers without CSS corner-shape render plain rounded corners.

SimpleCard — no header, just content.

# Card Header Slot

LiveHeader slotv2.1

The Header slot replaces the entire default header (title, subtitle, action) — for layouts the built-in fields can't express.

Standard header

For comparison

Same card with the default title/subtitle header.

Go
// templ component passed as the Header slot value
display.Card(display.CardProps{Title: "Unused", Header: myCardHeader()}) { ... }

templ myCardHeader() {
	<div class="flex items-center justify-between"> ... </div>
}
Go
display.Card(display.CardProps{Title: "Users", Subtitle: "Manage your team"}) {
<p>Card content</p>
}

display.Card(display.CardProps{
	Title:     "Squircle",
	BaseProps: utils.BaseProps{Class: "rounded-xl tc-squircle"},
}) { ... }

# Stat Cards

Users
1,204 Increased by 12%
Revenue
$45.2K Decreased by -3%
Uptime
99.9%
Active
42

# Stat Card Tones

Users
1,204
Uptime
99.9%
Degraded
3 Increased by +2
Failures
7 Increased by +5
Custom
12
Go
display.StatCard(display.StatCardProps{Label: "Uptime", Icon: icons.CheckCircle, Tone: display.StatToneGreen})

# Badges

DefaultSuccessErrorWarningInfoPillDot
healthydegradeddownpendingactive
provisioninghealthymysteryStatusBadgeWith: injectable mapper (extends the built-in map; unknown statuses render neutral)

# Buttons

External Link
Go
display.Button(display.ButtonProps{Text: "Save", Variant: display.ButtonPrimary})
Go — Children slot (#405)
display.Button(display.ButtonProps{
	Text:     "Save",
	Children: htmx.LoadingButton("Save", "Saving…", feedback.Spinner(feedback.SpinnerProps{Size: feedback.SpinnerSM})),
})

# Avatars

John Doe
Alice Brown
Charlie Day

# Modal (native dialog)

Demo Modal

This modal uses the native <dialog> element with showModal(). Press Escape or click backdrop to close.

Go
@display.Modal(display.ModalProps{Title: "Confirm", Size: display.ModalSizeMD}) {
	<p>Are you sure?</p>
}

# Drawer (native dialog)

Demo Drawer

Drawer slides in from the side using native <dialog>.

# Command Palette (⌘K)

Click the button or press ⌘K / Ctrl+K. Type to filter; arrow keys move; Enter selects.

# Dropdown

# Tooltip

# Popover

# Accordion (native details)

What is templ-components?

A Go library of reusable UI components built with templ and Tailwind CSS.

How do I install it?

Run go get github.com/larsartmann/templ-components to add it to your project.

Is it production-ready?

Yes, v1.27.2 follows semantic versioning. Breaking changes only land in major versions.

# Accordion (exclusive: opening one closes the others)

Step 1: Install

Run go get github.com/larsartmann/templ-components.

Step 2: Copy the CSS

Copy templates/app.css and templates/custom.css, then compile with Tailwind v4.

Step 3: Render a component

Call any component from Go: @display.Accordion(display.AccordionProps{Exclusive: true, ...}).

# Tabs

# Tabs (Pills variant)

# Table

Name ↑EmailRole
Alice Smithalice@example.comAdmin
Bob Jonesbob@example.comUser
Carol Whitecarol@example.comSuspended
Go
display.Table(display.TableProps{
	Headers: []string{"Name", "Email", "Role"},
	Rows: []display.TableRow{
		display.SimpleTableRow("Alice", "alice@example.com", "Admin"),
	},
	Striped: true,
	Hover:   true,
})

# Table in Card (Flush + Compact)

Recent Users

NameEmailStatus
Alice Smithalice@example.comActive
Bob Jonesbob@example.comInvited

# DataTable (sort + pagination)

Name ↑Email
Alicealice@example.com
Bobbob@example.com

# PageHeader

User Settings

Manage your account preferences and security options

# SectionHeading + DateRange

Experience

SectionHeading — configurable h1–h6 level, alignment, subtitle

Go
@display.DateRange(display.DateRangeProps{
	Start: &start, // End nil renders "Present"
	Layout: display.DateFormatJan2_2006,
})

# Definition List

User ID
usr_01JXEXAMPLE
Email
admin@example.com
Plan
Enterprise

# Definition Grid

CPU
42%
Memory
8.2 GB
Disk
156 GB
Uptime
99.9%
Requests
1.2K/s
Latency
12ms

# Grid + Container Query Grid

Normal grid
42
Responsive
12ms
To viewport
99.9%

Container-responsive (resize this box):

Requests/s
42
Latency
12ms
Uptime
99.9%

Auto-fit (columns appear as space allows — resize the window, no breakpoints):

Auto
42
Fit
12ms
Minmax
99.9%
Min col width
190px
Go
display.Grid(display.GridProps{Cols: display.GridCols3, Gap: display.GridGapLG}) {
for _, u := range users {
	@display.Card(display.CardProps{Title: u.Name}) { <p>{ u.Email }</p> }
}
}

display.Grid(display.GridProps{Cols: display.GridColsAutoFit, MinColWidth: "190px"}) { ... }

# Fluid Typography (container query units)

Container-aware metric

Revenue scales with this card's width:

$4.2M

Heading in a narrow container

Text shrinks smoothly as the container narrows via cqi units.

# Empty States

No users found

Try adjusting your search or filters.

No data to display.

# CopyButton

# RelativeTime

2 hours ago: 1 day ago:

# CountBadge

# ListNote

Showing 50 of 127. Narrow your search to see more.

# Eyebrow & Scrollback

Deploy #142 · production

Build pipeline

# Image

Demo Rounded Blur-up placeholder

# HoverCard

# ContextMenu

Right-click the area below:

Right-click here for context menu

# Sparklines & Bar Charts

Message Trend

+47%

Top Channels

# SVG Charts (Line, Pie, Area)

Revenue Trend

10 20 30 40 50 60 70 80 MonTueWedThuFriSatSun

Revenue vs Expenses

Active Users

Traffic Sources

Storage Usage

# Code Blocks

bash
go install github.com/larsartmann/templ-components/cmd/tc@latest
Two-step build
templ generate ./... && go build ./...
9007199254740993

# Data States

Empty

No tracked activity

Nothing landed in the last 30 days.

Unavailable

Unavailable — retrying

The query failed; this region keeps retrying.

Disabled

Tracking is off

Enable tracking in settings to see this data.

Content

The data landed — children render normally.

# Status Indicators

Live Reconnecting… Paused Service healthy All systems operational Degraded Degraded

# Segment Bar

  • Go 62.3%
  • TypeScript 27.1%
  • Shell 8.4%
  • Other 2.2%
  • Safe 90.0%
  • Risky 10.0%

# Prose

Ship documentation with the library's typographic contract

The .tc-prose container styles rendered markdown — strong, emphasis, and links — through descendant selectors, so articles need zero per-element classes.

  • Theme-token colors with dark-mode overrides
  • Logical spacing that mirrors in RTL
  • Tables, blockquotes, and code blocks included
One wrapper class, the whole typographic system.

# Lightbox

Mountain landscape

# Collapsible Sections

Advanced Settings

These settings are open by default. Users can collapse this section to focus on the overview.

Debug Information

Version: v1.27.2 Build: 2026-11-28T03:37:20Z

# Heatmap

Weekly Activity Heatmap

00:0004:0008:0012:0016:0020:0024:00
Sun·
Mon·
Tue
Wed·
Thu·
Fri
Sat