Lucide Icons for Go (Golang) #2744
dimmerz92
started this conversation in
Show and tell
Replies: 1 comment
-
go-lucide-iconsI've done some major overhauling to this project. I've kept dependencies absolutely minimal. If you use the Templ package, the only dependency is Templ itself. If you use the HTML package, there are no dependencies at all.
For the Templ package: go get github.com/dimmerz92/go-lucide-icons/templ/icons type IconProps struct {
ID string // specifies the <svg> id attribute.
Class string // add classes to the <svg>.
Style string // specifies the <svg> style attribute.
templ.Attributes // add additional attributes to the <svg>.
}
@icons.Worm(icons.IconProps{}) For the HTML package: go get github.com/dimmerz92/go-lucide-icons/html/icons tpls := template.Must(template.ParseFiles("your existing files"))
icons.AddLucideIcons(tpls) For the command line tool: go install github.com/dimmerz92/go-lucide-icons/cmd/golucide@latest
golucide add [-o <output directory>] templ <icon-name (kebab-case)> # for templ components
golucide add [-o <output directory>] html <icon-name (kebab-case)> # for html components |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
EDIT
This project now supports both Templ templates and html/template from the Go stdlib.
It can be used as either a command line tool to drop only the components you need or imported as a dependency.
I've created a repo for Go users to use these icons in their projects.
The icons are simply wrapped in a Templ template and the class attribute has been exposed so that the icon can be styled via css classes.If you're not using Templ to build your project, you can still use this repo. Templ will remain a dependency, but you can use it to convert it to raw HTML to be injected into html/template templates.See here for said repo: go-templ-lucide.See here for said repo: go-lucide-icons.
Beta Was this translation helpful? Give feedback.
All reactions