shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Building Blocks for the Web

Clean, modern building blocks. Copy and paste into your apps. Built with Go and templ. Open Source. Free forever.

Registry reference: these templ ports track the current shadcn/ui Base UI blocks. The public shadcn block previews can still show legacy new-york-v4/Radix variants, so their block-level details may differ.

Files
blocks/dashboard01/page.templ
package dashboard01 import "github.com/axadrn/shadcn-templ/v2/components/sidebar" templ Page() {	@sidebar.Provider(sidebar.ProviderProps{		Attributes: templ.Attributes{			"style": "--sidebar-width: calc(var(--spacing) * 72); --sidebar-width-icon: 3rem; --header-height: calc(var(--spacing) * 12);",		},	}) {		@AppSidebar()		@sidebar.Inset() {			@SiteHeader()			<div class="flex flex-1 flex-col">				<div class="@container/main flex flex-1 flex-col gap-2">					<div class="flex flex-col gap-4 py-4 md:gap-6 md:py-6">						@SectionCards()						<div class="px-4 lg:px-6">							@ChartAreaInteractive()						</div>						@DataTable(Data)					</div>				</div>			</div>		}	}}
A dashboard with sidebar, charts and data table.
dashboard-01
Files
blocks/login03/page.templ
package login03 import "github.com/axadrn/shadcn-templ/v2/components/icon" templ Page() {	<div class="flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10">		<div class="flex w-full max-w-sm flex-col gap-6">			<a href="#" class="flex items-center gap-2 self-center font-medium">				<div class="flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground">					@icon.GalleryVerticalEnd(icon.Props{Class: "size-4"})				</div>				Acme Inc.			</a>			@LoginForm()		</div>	</div>}
A login page with a muted background color.
login-03
Files
blocks/login04/page.templ
package login04 templ Page() {	<div class="flex min-h-svh flex-col items-center justify-center bg-muted p-6 md:p-10">		<div class="w-full max-w-sm md:max-w-4xl">			@LoginForm()		</div>	</div>}
A login page with form and image.
login-04