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
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.
// 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>
}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
# Stat Card Tones
- Users
- 1,204
- Uptime
- 99.9%
- Degraded
- 3 Increased by +2
- Failures
- 7 Increased by +5
- Custom
- 12
display.StatCard(display.StatCardProps{Label: "Uptime", Icon: icons.CheckCircle, Tone: display.StatToneGreen})# Badges
# Buttons
display.Button(display.ButtonProps{Text: "Save", Variant: display.ButtonPrimary})display.Button(display.ButtonProps{
Text: "Save",
Children: htmx.LoadingButton("Save", "Saving…", feedback.Spinner(feedback.SpinnerProps{Size: feedback.SpinnerSM})),
})# Avatars
# Modal (native dialog)
@display.Modal(display.ModalProps{Title: "Confirm", Size: display.ModalSizeMD}) {
<p>Are you sure?</p>
}# Drawer (native dialog)
# Command Palette (⌘K)
Click the button or press ⌘K / Ctrl+K. Type to filter; arrow keys move; Enter selects.
# Dropdown
# Tooltip
# Popover
Popover content
Any content can go here.
# 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 ↑ | Role | |
|---|---|---|
| Alice Smith | alice@example.com | Admin |
| Bob Jones | bob@example.com | User |
| Carol White | carol@example.com | Suspended |
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
| Name | Status | |
|---|---|---|
| Alice Smith | alice@example.com | Active |
| Bob Jones | bob@example.com | Invited |
# DataTable (sort + pagination)
# PageHeader
User Settings
Manage your account preferences and security options
# SectionHeading + DateRange
Experience
SectionHeading — configurable h1–h6 level, alignment, subtitle
@display.DateRange(display.DateRangeProps{
Start: &start, // End nil renders "Present"
Layout: display.DateFormatJan2_2006,
})# Definition List
- User ID
- usr_01JXEXAMPLE
- 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
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 data to display.
# CopyButton
# RelativeTime
# CountBadge
# ListNote
# Eyebrow & Scrollback
Deploy #142 · production
Build pipeline
# Image
# HoverCard
Hover details
Shows on hover or focus.
# ContextMenu
Right-click the area below:
# Carousel
# Sparklines & Bar Charts
Message Trend
Top Channels
# SVG Charts (Line, Pie, Area)
Revenue Trend
Revenue vs Expenses
Active Users
Traffic Sources
Storage Usage
# External Links
# Code Blocks
go install github.com/larsartmann/templ-components/cmd/tc@latesttempl generate ./... && go build ./...# 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
# 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
# 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:00 | 04:00 | 08:00 | 12:00 | 16:00 | 20:00 | 24:00 | |
|---|---|---|---|---|---|---|---|
| Sun | · | ||||||
| Mon | · | ||||||
| Tue | |||||||
| Wed | · | ||||||
| Thu | · | ||||||
| Fri | |||||||
| Sat |