symbols

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package symbols draws the platforms' own icon sets: SF Symbols on iOS, and Google's Material Symbols on Android. Each icon is named per platform, since the two sets name things differently.

nimbus native plugin add symbols
nimbus native font add -name "Material Symbols Rounded" MaterialSymbolsRounded.ttf

symbols.Symbol{IOS: "cup.and.saucer.fill", Android: "local_cafe", Size: 28, Label: "Coffee"}

iOS has SF Symbols built in. Android has no named icon set, so it draws Material Symbols from the font, which you download from Google Fonts (github.com/google/material-design-icons, under variablefont/) and add as above. The web draws the Android name with the same font, which the site serves from the fonts folder. For the same icon everywhere, ui.Icon is built in.

Index

Constants

This section is empty.

Variables

View Source
var AndroidFont = "Material Symbols Rounded"

AndroidFont is the family name the Material Symbols font was added under. Use "Material Symbols Outlined" or "Material Symbols Sharp" for those styles.

Functions

This section is empty.

Types

type Symbol

type Symbol struct {
	IOS     string   // an SF Symbol's name, such as "heart.fill"; empty draws nothing on iOS
	Android string   // a Material Symbol's name, such as "favorite"; empty draws nothing on Android
	Size    float32  // points; 0 means 24
	Color   ui.Color // the theme's text color when 0
	Weight  uint16   // 100..900, like FontWeight; 0 means 400
	// Label is what screen readers say. On iOS, empty leaves the icon out
	// for them, as for one beside text that says the same. On Android the
	// icon is text, so empty says its name: "local cafe".
	Label string
}

Symbol is one icon.

func (Symbol) Render

func (s Symbol) Render(c *ui.Ctx) ui.Component

Render draws the icon, size by size points.

Jump to

Keyboard shortcuts

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