Lucide Icons for Go (Golang) #2744
dimmerz92
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
|
I've refactored this project so that it is a bit more ergonomic to use. Icons are updated relatively quickly inline with the Lucide Icons repo. This library can:
For html/template golucide html a-arrow-downgolucide html a-arrow-down -out templates/iconsFor templ golucide templ a-arrow-downgolucide templ a-arrow-down -out templates/icons
For html/template // where tpls is your existing html templates
err := htmlicons.AddLucideIcons(tpls)
// handle err
err = tpls.ExecuteTemplate(w, "a-arrow-down", nil) // or to add attributes use []template.HTMLAttr{} instead of nilwith html/template composition <html>
<body>
<!--without data-->
{{ template "a-arrow-down" }}
<!--with data-->
{{ template "a-arrow-down" . }}
</body>
</html>For templ templicons.AArrowDown() // or to add attributes use templ.Attributes as an argument |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Cool project! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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