lucide

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: ISC, MIT Imports: 2 Imported by: 0

README

gomponents-lucide

godoc reference mit license isc license

Lucide for gomponents.

Usage

Add the dependency to the package.

go get github.com/hastebrot/gomponents-lucide

Example code. Pick the icons from https://lucide.dev/icons/.

package main

import (
	g "github.com/maragudk/gomponents"
	. "github.com/maragudk/gomponents/html"

	"github.com/hastebrot/gomponents-lucide/lucide"
)

func Example() g.Node {
	return Section(
		Div(
			lucide.Pizza(
				g.Attr("width", "24px"),
				g.Attr("height", "24px"),
				g.Attr("stroke", "rgb(239,68,68)"),
				g.Attr("stroke-width", "1.5"),
			),
		),
		Div(
			lucide.Pizza(StyleAttr("width: 24px; height: 24px; color: rgb(239,68,68);")),
		),
		Div(
			Class("w-[24px] h-[24px] text-red-500"),
			lucide.Pizza(Class("[stroke-width:2.5]")),
		),
	)
}

Build instructions

Remove existing icons/ and lucide/ directories before build.

❯ curl -sSL https://github.com/lucide-icons/lucide/releases/download/0.295.0/lucide-icons-0.295.0.zip | tar -xf - -C .

❯ ls -1 icons/*.svg | wc -l
1346

❯ deno run --allow-read --allow-write build.deno.ts

❯ ls -1 lucide/*.go | wc -l
1346

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Icon

func Icon(children ...g.Node) g.Node

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL