icon

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Check is a success icon (✔).
	Check = kitex.Text("✔")
	// Info is an information icon (ℹ).
	Info = kitex.Text("ℹ")
	// Warning is a warning icon (⚠).
	Warning = kitex.Text("⚠")
	// Error is an error icon (✖).
	Error = kitex.Text("✖")
	// ChevronRight is a right-pointing chevron (▶).
	ChevronRight = kitex.Text("▶")
	// ChevronDown is a down-pointing chevron (▼).
	ChevronDown = kitex.Text("▼")
	// Calendar is a calendar icon (󰃭).
	Calendar = kitex.Text("󰃭")
	// History is a history clock icon (󰑮).
	History = kitex.Text("󰑮")
	// Robot is a robot icon (󰚩).
	Robot = kitex.Text("󰚩")
	// Pencil is a pencil/ruler icon (󰅩).
	Pencil = kitex.Text("󰅩")
	// File is a default file/document icon (󰈔).
	File = kitex.Text("󰈔")
	// Wrench is a wrench/hammer icon (󰦌).
	Wrench = kitex.Text("󰦌")
	// Package is a package/box icon (󰏗).
	Package = kitex.Text("󰏗")
	// Network is a network node / MCP icon (󰚯).
	Network = kitex.Text("󰚯")
	// Folder is a folder/project icon (󰉋).
	Folder = kitex.Text("󰉋")
	// AppleKeyboardCommand is a terminal/command icon (󰘳).
	AppleKeyboardCommand = kitex.Text("󰘳")
	// Plugin is a plugin/puzzle icon (󰚰).
	Plugin = kitex.Text("󰚰")
	// Cog is a settings gear icon (󰒓).
	Cog = kitex.Text("󰒓")
	// Shield is a shield/security icon (󰒃).
	Shield = kitex.Text("󰒃")
	// Lock is a lock/strict icon (󰌆).
	Lock = kitex.Text("󰌆")
	// Fire is an analytics/fire icon (󰈸).
	Fire = kitex.Text("󰈸")
	// Exit is an exit/quit icon (󰗼).
	Exit = kitex.Text("󰗼")
	// Checkmark is a Nerd Font checkmark icon (󰄬).
	Checkmark = kitex.Text("󰄬")
	// Alert is a Nerd Font alert icon (󰀦).
	Alert = kitex.Text("󰀦")
	// Database is a database/provider icon (󰒋).
	Database = kitex.Text("󰒋")
	// GitBranch is a git branch icon ().
	GitBranch = kitex.Text("")
	// Server is a server icon (󰟀).
	Server = kitex.Text("󰟀")
	// CPU is a cpu icon (󰍛).
	CPU = kitex.Text("󰍛")
	// User is a user/profile icon ().
	User = kitex.Text("")
	// MoveDown is an input/download arrow icon (↓).
	MoveDown = kitex.Text("↓")
	// MoveUp is an output/upload arrow icon (↑).
	MoveUp = kitex.Text("↑")
	// Lightning is a lightning/fast icon (󱐋).
	Lightning = kitex.Text("󱐋")
	// Plus is an add/plus icon (  ).
	Plus = kitex.Text("")
	// Search is a search/magnifying glass icon ().
	Search = kitex.Text("")
	// Directory is a directory/folder icon ().
	Directory = kitex.Text("")
	// DirectoryOpen is an open directory/folder icon ().
	DirectoryOpen = kitex.Text("")
	// FontAwesomeTerminal ().
	FontAwesomeTerminal = kitex.Text("")
	// Globe is a globe/web/internet icon (󰖟).
	Globe = kitex.Text("󰖟")
)
View Source
var FileIcon = kitex.FC("FileIcon", func(props FileIconProps) kitex.Node {
	t := theme.UseTheme()
	dark := t.Type != "light"

	if props.IsDir {
		return kitex.Span(kitex.SpanProps{
			Style: style.S().Foreground(t.Color.Text.Secondary),
		}, Directory)
	}

	res := neo.ByPath(props.Path)
	if res == nil {
		return kitex.Span(kitex.SpanProps{
			Style: style.S().Foreground(t.Color.Text.Secondary),
		}, File)
	}

	return kitex.Span(kitex.SpanProps{
		Style: style.S().Foreground(res.Color(dark)),
	}, kitex.Text(res.String()))
})

FileIcon resolves a Nerd Font icon dynamically by the given file path. It relies on the go-nf library's internal map-lookup cache (which is O(1) and extremely fast), and falls back to a default file icon if no matching icon is found.

Functions

func LspKindIcon

func LspKindIcon(kind string, t *theme.Scheme) (kitex.Node, color.Color)

LspKindIcon resolves a Nerd Font icon and theme color for a given LSP symbol kind.

Types

type FileIconProps

type FileIconProps struct {
	Path  string
	IsDir bool
}

FileIconProps defines properties for the FileIcon component.

Jump to

Keyboard shortcuts

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