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

Icon

A wrapper for Lucide Icons that is primarily styled with Tailwind utility classes.

package examples import "github.com/axadrn/shadcn-templ/v2/components/icon"

Installation

shadcn-templ add icon

Usage

import "github.com/axadrn/shadcn-templ/v2/components/icon"
@icon.User(icon.Props{Class: "size-6"})

Browse the Lucide library to see every available icon, each one exists as a Go function with the PascalCase name of the icon.

Colored

Use text color utilities to color an icon.

package examples import "github.com/axadrn/shadcn-templ/v2/components/icon"

Filled

Use fill-current to fill an icon with the current text color.

package examples import "github.com/axadrn/shadcn-templ/v2/components/icon"

Sizes

Use size utilities to scale an icon.

package examples import "github.com/axadrn/shadcn-templ/v2/components/icon"

API Reference

Icon

Every Lucide icon is a templ component, icon.User, icon.ChevronDown, and so on.

Prop Type Default
Class string -
Attributes templ.Attributes -