material

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT, Unlicense Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clickable

func Clickable(gtx layout.Context, button *widget.Clickable, w layout.Widget) layout.Dimensions

Types

type AnchorStrategy

type AnchorStrategy uint8
const (
	Occupy AnchorStrategy = iota

	Overlay
)

type ButtonLayoutStyle

type ButtonLayoutStyle struct {
	Background   color.NRGBA
	CornerRadius unit.Dp
	Button       *widget.Clickable
}

func ButtonLayout

func ButtonLayout(th *Theme, button *widget.Clickable) ButtonLayoutStyle

func (ButtonLayoutStyle) Layout

type ButtonStyle

type ButtonStyle struct {
	Text string

	Color        color.NRGBA
	Font         font.Font
	TextSize     unit.Sp
	Background   color.NRGBA
	CornerRadius unit.Dp
	Inset        layout.Inset
	Button       *widget.Clickable
	// contains filtered or unexported fields
}

func Button

func Button(th *Theme, button *widget.Clickable, txt string) ButtonStyle

func (ButtonStyle) Layout

func (b ButtonStyle) Layout(gtx layout.Context) layout.Dimensions

type CheckBoxStyle

type CheckBoxStyle struct {
	CheckBox *widget.Bool
	// contains filtered or unexported fields
}

func CheckBox

func CheckBox(th *Theme, checkBox *widget.Bool, label string) CheckBoxStyle

func (CheckBoxStyle) Layout

type DecorationsStyle

type DecorationsStyle struct {
	Decorations *widget.Decorations
	Actions     system.Action
	Title       LabelStyle
	Background  color.NRGBA
	Foreground  color.NRGBA
}

func Decorations

func Decorations(th *Theme, deco *widget.Decorations, actions system.Action, title string) DecorationsStyle

func (DecorationsStyle) Layout

type EditorStyle

type EditorStyle struct {
	Font font.Font

	LineHeight unit.Sp

	LineHeightScale float32
	TextSize        unit.Sp

	Color color.NRGBA

	Hint string

	HintColor color.NRGBA

	SelectionColor color.NRGBA
	Editor         *widget.Editor
	// contains filtered or unexported fields
}

func Editor

func Editor(th *Theme, editor *widget.Editor, hint string) EditorStyle

func (EditorStyle) Layout

func (e EditorStyle) Layout(gtx layout.Context) layout.Dimensions

type IconButtonStyle

type IconButtonStyle struct {
	Background color.NRGBA

	Color color.NRGBA
	Icon  *widget.Icon

	Size        unit.Dp
	Inset       layout.Inset
	Button      *widget.Clickable
	Description string
}

func IconButton

func IconButton(th *Theme, button *widget.Clickable, icon *widget.Icon, description string) IconButtonStyle

func (IconButtonStyle) Layout

type LabelStyle

type LabelStyle struct {
	Font font.Font

	Color color.NRGBA

	SelectionColor color.NRGBA

	Alignment text.Alignment

	MaxLines int

	WrapPolicy text.WrapPolicy

	Truncator string

	Text string

	TextSize unit.Sp

	LineHeight unit.Sp

	LineHeightScale float32

	Shaper *text.Shaper

	State *widget.Selectable
}

func Body1

func Body1(th *Theme, txt string) LabelStyle

func Body2

func Body2(th *Theme, txt string) LabelStyle

func Caption

func Caption(th *Theme, txt string) LabelStyle

func H1

func H1(th *Theme, txt string) LabelStyle

func H2

func H2(th *Theme, txt string) LabelStyle

func H3

func H3(th *Theme, txt string) LabelStyle

func H4

func H4(th *Theme, txt string) LabelStyle

func H5

func H5(th *Theme, txt string) LabelStyle

func H6

func H6(th *Theme, txt string) LabelStyle

func Label

func Label(th *Theme, size unit.Sp, txt string) LabelStyle

func Overline

func Overline(th *Theme, txt string) LabelStyle

func Subtitle1

func Subtitle1(th *Theme, txt string) LabelStyle

func Subtitle2

func Subtitle2(th *Theme, txt string) LabelStyle

func (LabelStyle) Layout

func (l LabelStyle) Layout(gtx layout.Context) layout.Dimensions

type ListStyle

type ListStyle struct {
	ScrollbarStyle
	AnchorStrategy
	// contains filtered or unexported fields
}

func List

func List(th *Theme, state *widget.List) ListStyle

func (ListStyle) Layout

func (l ListStyle) Layout(gtx layout.Context, length int, w layout.ListElement) layout.Dimensions

func (ListStyle) LayoutWidgets

func (l ListStyle) LayoutWidgets(gtx layout.Context, widgets ...layout.Widget) layout.Dimensions

type LoaderStyle

type LoaderStyle struct {
	Color color.NRGBA
}

func Loader

func Loader(th *Theme) LoaderStyle

func (LoaderStyle) Layout

func (l LoaderStyle) Layout(gtx layout.Context) layout.Dimensions

type Palette

type Palette struct {
	Bg color.NRGBA

	Fg color.NRGBA

	ContrastBg color.NRGBA

	ContrastFg color.NRGBA
}

type ProgressBarStyle

type ProgressBarStyle struct {
	Color      color.NRGBA
	Height     unit.Dp
	Radius     unit.Dp
	TrackColor color.NRGBA
	Progress   float32
}

func ProgressBar

func ProgressBar(th *Theme, progress float32) ProgressBarStyle

func (ProgressBarStyle) Layout

type ProgressCircleStyle

type ProgressCircleStyle struct {
	Color    color.NRGBA
	Progress float32
}

func ProgressCircle

func ProgressCircle(th *Theme, progress float32) ProgressCircleStyle

func (ProgressCircleStyle) Layout

type RadioButtonStyle

type RadioButtonStyle struct {
	Key   string
	Group *widget.Enum
	// contains filtered or unexported fields
}

func RadioButton

func RadioButton(th *Theme, group *widget.Enum, key, label string) RadioButtonStyle

func (RadioButtonStyle) Layout

type ScrollIndicatorStyle

type ScrollIndicatorStyle struct {
	MajorMinLen unit.Dp

	MinorWidth unit.Dp

	Color, HoverColor color.NRGBA

	CornerRadius unit.Dp
}

type ScrollTrackStyle

type ScrollTrackStyle struct {
	MajorPadding, MinorPadding unit.Dp

	Color color.NRGBA
}

type ScrollbarStyle

type ScrollbarStyle struct {
	Scrollbar *widget.Scrollbar
	Track     ScrollTrackStyle
	Indicator ScrollIndicatorStyle
}

func Scrollbar

func Scrollbar(th *Theme, state *widget.Scrollbar) ScrollbarStyle

func (ScrollbarStyle) Layout

func (s ScrollbarStyle) Layout(gtx layout.Context, axis layout.Axis, viewportStart, viewportEnd float32) layout.Dimensions

func (ScrollbarStyle) Width

func (s ScrollbarStyle) Width() unit.Dp

type SliderStyle

type SliderStyle struct {
	Axis  layout.Axis
	Color color.NRGBA
	Float *widget.Float

	FingerSize unit.Dp
}

func Slider

func Slider(th *Theme, float *widget.Float) SliderStyle

func (SliderStyle) Layout

func (s SliderStyle) Layout(gtx layout.Context) layout.Dimensions

type SwitchStyle

type SwitchStyle struct {
	Description string
	Color       struct {
		Enabled  color.NRGBA
		Disabled color.NRGBA
		Track    color.NRGBA
	}
	Switch *widget.Bool
}

func Switch

func Switch(th *Theme, swtch *widget.Bool, description string) SwitchStyle

func (SwitchStyle) Layout

func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions

type Theme

type Theme struct {
	Shaper *text.Shaper
	Palette
	TextSize unit.Sp
	Icon     struct {
		CheckBoxChecked   *widget.Icon
		CheckBoxUnchecked *widget.Icon
		RadioChecked      *widget.Icon
		RadioUnchecked    *widget.Icon
	}

	Face font.Typeface

	FingerSize unit.Dp
}

func NewTheme

func NewTheme() *Theme

func (Theme) WithPalette

func (t Theme) WithPalette(p Palette) Theme

Jump to

Keyboard shortcuts

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