material3

package
v0.1.86 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShapeExtraSmall = &shape.RoundedCornerShape{Radius: unit.Dp(4)}
	ShapeSmall      = &shape.RoundedCornerShape{Radius: unit.Dp(8)}
	ShapeMedium     = &shape.RoundedCornerShape{Radius: unit.Dp(12)}
	ShapeLarge      = &shape.RoundedCornerShape{Radius: unit.Dp(16)}
	ShapeExtraLarge = &shape.RoundedCornerShape{Radius: unit.Dp(28)}
)

Default shapes for Material 3

View Source
var ColorSetUnspecified = &ColorSet{
	Color:   ColorUnspecified,
	OnColor: ColorUnspecified,
}
View Source
var ColorUnspecified = graphics.ColorUnspecified
View Source
var DefaultDurationMillis time.Duration = 300 * time.Millisecond

The default duration used in [VectorizedAnimationSpec]s and [AnimationSpec].

View Source
var (
	// Default Font Family (System Default)
	// Should this exist?
	DefaultFontFamily = font.FontFamilySansSerif
)
View Source
var DefaultMotionScheme = &MotionScheme{}

DefaultMotionScheme is the default motion scheme with all standard easing curves.

View Source
var DefaultMotionTokens = &MotionTokens{
	DurationShort1:     50 * time.Millisecond,
	DurationShort2:     100 * time.Millisecond,
	DurationShort3:     150 * time.Millisecond,
	DurationShort4:     200 * time.Millisecond,
	DurationMedium1:    250 * time.Millisecond,
	DurationMedium2:    300 * time.Millisecond,
	DurationMedium3:    350 * time.Millisecond,
	DurationMedium4:    400 * time.Millisecond,
	DurationLong1:      450 * time.Millisecond,
	DurationLong2:      500 * time.Millisecond,
	DurationLong3:      550 * time.Millisecond,
	DurationLong4:      600 * time.Millisecond,
	DurationExtraLong1: 700 * time.Millisecond,
	DurationExtraLong2: 800 * time.Millisecond,
	DurationExtraLong3: 900 * time.Millisecond,
	DurationExtraLong4: 1000 * time.Millisecond,
}
View Source
var DefaultShapes = &Shapes{
	ExtraSmall: ShapeExtraSmall,
	Small:      ShapeSmall,
	Medium:     ShapeMedium,
	Large:      ShapeLarge,
	ExtraLarge: ShapeExtraLarge,
}
View Source
var DefaultTypography = &Typography{
	DisplayLarge:   tokens.TypographyTokens.DisplayLarge,
	DisplayMedium:  tokens.TypographyTokens.DisplayMedium,
	DisplaySmall:   tokens.TypographyTokens.DisplaySmall,
	HeadlineLarge:  tokens.TypographyTokens.HeadlineLarge,
	HeadlineMedium: tokens.TypographyTokens.HeadlineMedium,
	HeadlineSmall:  tokens.TypographyTokens.HeadlineSmall,
	TitleLarge:     tokens.TypographyTokens.TitleLarge,
	TitleMedium:    tokens.TypographyTokens.TitleMedium,
	TitleSmall:     tokens.TypographyTokens.TitleSmall,
	BodyLarge:      tokens.TypographyTokens.BodyLarge,
	BodyMedium:     tokens.TypographyTokens.BodyMedium,
	BodySmall:      tokens.TypographyTokens.BodySmall,
	LabelLarge:     tokens.TypographyTokens.LabelLarge,
	LabelMedium:    tokens.TypographyTokens.LabelMedium,
	LabelSmall:     tokens.TypographyTokens.LabelSmall,

	DisplayLargeEmphasized:   tokens.TypographyTokens.DisplayLargeEmphasized,
	DisplayMediumEmphasized:  tokens.TypographyTokens.DisplayMediumEmphasized,
	DisplaySmallEmphasized:   tokens.TypographyTokens.DisplaySmallEmphasized,
	HeadlineLargeEmphasized:  tokens.TypographyTokens.HeadlineLargeEmphasized,
	HeadlineMediumEmphasized: tokens.TypographyTokens.HeadlineMediumEmphasized,
	HeadlineSmallEmphasized:  tokens.TypographyTokens.HeadlineSmallEmphasized,
	TitleLargeEmphasized:     tokens.TypographyTokens.TitleLargeEmphasized,
	TitleMediumEmphasized:    tokens.TypographyTokens.TitleMediumEmphasized,
	TitleSmallEmphasized:     tokens.TypographyTokens.TitleSmallEmphasized,
	BodyLargeEmphasized:      tokens.TypographyTokens.BodyLargeEmphasized,
	BodyMediumEmphasized:     tokens.TypographyTokens.BodyMediumEmphasized,
	BodySmallEmphasized:      tokens.TypographyTokens.BodySmallEmphasized,
	LabelLargeEmphasized:     tokens.TypographyTokens.LabelLargeEmphasized,
	LabelMediumEmphasized:    tokens.TypographyTokens.LabelMediumEmphasized,
	LabelSmallEmphasized:     tokens.TypographyTokens.LabelSmallEmphasized,
}

DefaultTypography returns the standard Material 3 type scale.

View Source
var EasingEmphasized = NewCubicBezierEasing(0.2, 0.0, 0.0, 1.0)

EasingEmphasized is the default emphasized easing curve. Elements that begin and end at rest use this standard easing.

View Source
var EasingEmphasizedAccelerate = NewCubicBezierEasing(0.3, 0.0, 0.8, 0.15)

EasingEmphasizedAccelerate is for elements that are exiting the screen.

View Source
var EasingEmphasizedDecelerate = NewCubicBezierEasing(0.05, 0.7, 0.1, 1.0)

EasingEmphasizedDecelerate is for elements that are entering the screen.

View Source
var EasingLegacy = NewCubicBezierEasing(0.4, 0.0, 0.2, 1.0)

EasingLegacy is the legacy Material easing curve (FastOutSlowIn).

View Source
var EasingLegacyAccelerate = NewCubicBezierEasing(0.4, 0.0, 1.0, 1.0)

EasingLegacyAccelerate is the legacy accelerate curve (FastOutLinearIn).

View Source
var EasingLegacyDecelerate = NewCubicBezierEasing(0.0, 0.0, 0.2, 1.0)

EasingLegacyDecelerate is the legacy decelerate curve (LinearOutSlowIn).

View Source
var EasingLinear = NewCubicBezierEasing(0.0, 0.0, 1.0, 1.0)

EasingLinear is a linear easing with no acceleration or deceleration.

View Source
var EasingStandard = NewCubicBezierEasing(0.2, 0.0, 0.0, 1.0)

EasingStandard is the standard Material 3 easing curve.

View Source
var EasingStandardAccelerate = NewCubicBezierEasing(0.3, 0.0, 1.0, 1.0)

EasingStandardAccelerate is the standard accelerate curve.

View Source
var EasingStandardDecelerate = NewCubicBezierEasing(0.0, 0.0, 0.0, 1.0)

EasingStandardDecelerate is the standard decelerate curve.

View Source
var FastOutLinearInEasing = EasingLegacyAccelerate

FastOutLinearInEasing is equivalent to EasingLegacyAccelerate.

View Source
var FastOutSlowInEasing = EasingLegacy

FastOutSlowInEasing is equivalent to EasingLegacy.

View Source
var LinearOutSlowInEasing = EasingLegacyDecelerate

LinearOutSlowInEasing is equivalent to EasingLegacyDecelerate.

Deprecated: use LocalColorSchemeNext

View Source
var LocalColorSchemeNext = compose.CompositionLocalOf(func() *ColorSchemeNext {
	return LightColorScheme()
})
View Source
var LocalContentColor = compose.CompositionLocalOf(func() graphics.Color {
	return graphics.ColorBlack
})

LocalContentColor is a CompositionLocal containing the preferred content color for a given position in the hierarchy. This typically represents the "on" color for a color in ColorScheme. For example, if the background color is ColorScheme.surface, this color is typically set to ColorScheme.onSurface.

This color should be used for any typography / iconography, to ensure that the color of these adjusts when the background color changes. For example, on a dark background, text should be light, and on a light background, text should be dark.

Defaults to Color.Black if no color has been explicitly set.

View Source
var LocalMotionScheme = compose.CompositionLocalOf(func() *MotionScheme {
	return DefaultMotionScheme
})
View Source
var LocalShapes = compose.CompositionLocalOf(func() *Shapes {
	return DefaultShapes
})
View Source
var LocalTextStyle = compose.CompositionLocalOf(func() *text.TextStyle {
	return nil
})
View Source
var LocalTypography = compose.CompositionLocalOf(func() *Typography {
	return DefaultTypography
})
View Source
var MotionTokensUnspecified = &MotionTokens{
	DurationShort1:     UnspecifiedTime,
	DurationShort2:     UnspecifiedTime,
	DurationShort3:     UnspecifiedTime,
	DurationShort4:     UnspecifiedTime,
	DurationMedium1:    UnspecifiedTime,
	DurationMedium2:    UnspecifiedTime,
	DurationMedium3:    UnspecifiedTime,
	DurationMedium4:    UnspecifiedTime,
	DurationLong1:      UnspecifiedTime,
	DurationLong2:      UnspecifiedTime,
	DurationLong3:      UnspecifiedTime,
	DurationLong4:      UnspecifiedTime,
	DurationExtraLong1: UnspecifiedTime,
	DurationExtraLong2: UnspecifiedTime,
	DurationExtraLong3: UnspecifiedTime,
	DurationExtraLong4: UnspecifiedTime,
}
View Source
var TypographyUnspecified = &Typography{
	BodyLarge:  text.TextStyleUnspecified,
	BodyMedium: text.TextStyleUnspecified,
	BodySmall:  text.TextStyleUnspecified,

	DisplayLarge:  text.TextStyleUnspecified,
	DisplayMedium: text.TextStyleUnspecified,
	DisplaySmall:  text.TextStyleUnspecified,

	HeadlineLarge:  text.TextStyleUnspecified,
	HeadlineMedium: text.TextStyleUnspecified,
	HeadlineSmall:  text.TextStyleUnspecified,

	LabelLarge:  text.TextStyleUnspecified,
	LabelMedium: text.TextStyleUnspecified,
	LabelSmall:  text.TextStyleUnspecified,

	TitleLarge:  text.TextStyleUnspecified,
	TitleMedium: text.TextStyleUnspecified,
	TitleSmall:  text.TextStyleUnspecified,

	BodyLargeEmphasized:  text.TextStyleUnspecified,
	BodyMediumEmphasized: text.TextStyleUnspecified,
	BodySmallEmphasized:  text.TextStyleUnspecified,

	DisplayLargeEmphasized:  text.TextStyleUnspecified,
	DisplayMediumEmphasized: text.TextStyleUnspecified,
	DisplaySmallEmphasized:  text.TextStyleUnspecified,

	HeadlineLargeEmphasized:  text.TextStyleUnspecified,
	HeadlineMediumEmphasized: text.TextStyleUnspecified,
	HeadlineSmallEmphasized:  text.TextStyleUnspecified,

	LabelLargeEmphasized:  text.TextStyleUnspecified,
	LabelMediumEmphasized: text.TextStyleUnspecified,
	LabelSmallEmphasized:  text.TextStyleUnspecified,

	TitleLargeEmphasized:  text.TextStyleUnspecified,
	TitleMediumEmphasized: text.TextStyleUnspecified,
	TitleSmallEmphasized:  text.TextStyleUnspecified,
}
View Source
var UnspecifiedTime time.Duration = math.MinInt64

The value that is used when the animation time is not yet set.

Functions

func ColorToToken

func ColorToToken(color Color) token.MatColor

func EqualColorSet

func EqualColorSet(a, b *ColorSet) bool

func IsSpecifiedColorSet

func IsSpecifiedColorSet(s *ColorSet) bool

func SameColorSet

func SameColorSet(a, b *ColorSet) bool

Identity (2 ns)

func SemanticEqualColorSet

func SemanticEqualColorSet(a, b *ColorSet) bool

Semantic equality (field-by-field, 20 ns)

func UpdateTokenTheme

func UpdateTokenTheme(gtx layout.Context, schemeOptions []TokenColorSchemeOptions)

Types

type Color

type Color = graphics.Color

func ColorFromTokens

func ColorFromTokens(token token.MatColor) Color

type ColorScheme

type ColorScheme struct {
	Primary             *ColorSet
	PrimaryContainer    *ColorSet
	PrimaryFixed        *ColorSet
	PrimaryFixedVariant *ColorSet

	Secondary             *ColorSet
	SecondaryContainer    *ColorSet
	SecondaryFixed        *ColorSet
	SecondaryFixedVariant *ColorSet

	Tertiary             *ColorSet
	TertiaryContainer    *ColorSet
	TertiaryFixed        *ColorSet
	TertiaryFixedVariant *ColorSet

	Surface                 *ColorSet
	SurfaceVariant          *ColorSet
	SurfaceDim              Color
	SurfaceBright           Color
	SurfaceContainerLowest  Color
	SurfaceContainerLow     Color
	SurfaceContainer        Color
	SurfaceContainerHigh    Color
	SurfaceContainerHighest Color

	InverseSurface *ColorSet
	InversePrimary Color

	Background *ColorSet

	Outline        Color
	OutlineVariant Color

	Error          *ColorSet
	ErrorContainer *ColorSet

	Scrim  Color
	Shadow Color
}

Deprecated

func ColorSchemeFromTokens

func ColorSchemeFromTokens(tokenScheme *token.Scheme) *ColorScheme

func (*ColorScheme) ContentColorFor

func (c *ColorScheme) ContentColorFor(backgroundColor Color) Color

func (*ColorScheme) Copy

func (c *ColorScheme) Copy(options ...ColorSchemeOption) *ColorScheme

func (*ColorScheme) ToTokens

func (c *ColorScheme) ToTokens() *token.Scheme

type ColorSchemeNext

type ColorSchemeNext struct {
	Primary                 graphics.Color
	OnPrimary               graphics.Color
	PrimaryContainer        graphics.Color
	OnPrimaryContainer      graphics.Color
	InversePrimary          graphics.Color
	Secondary               graphics.Color
	OnSecondary             graphics.Color
	SecondaryContainer      graphics.Color
	OnSecondaryContainer    graphics.Color
	Tertiary                graphics.Color
	OnTertiary              graphics.Color
	TertiaryContainer       graphics.Color
	OnTertiaryContainer     graphics.Color
	Background              graphics.Color
	OnBackground            graphics.Color
	Surface                 graphics.Color
	OnSurface               graphics.Color
	SurfaceVariant          graphics.Color
	OnSurfaceVariant        graphics.Color
	SurfaceTint             graphics.Color
	InverseSurface          graphics.Color
	InverseOnSurface        graphics.Color
	Error                   graphics.Color
	OnError                 graphics.Color
	ErrorContainer          graphics.Color
	OnErrorContainer        graphics.Color
	Outline                 graphics.Color
	OutlineVariant          graphics.Color
	Scrim                   graphics.Color
	SurfaceBright           graphics.Color
	SurfaceContainer        graphics.Color
	SurfaceContainerHigh    graphics.Color
	SurfaceContainerHighest graphics.Color
	SurfaceContainerLow     graphics.Color
	SurfaceContainerLowest  graphics.Color
	SurfaceDim              graphics.Color
	PrimaryFixed            graphics.Color
	PrimaryFixedDim         graphics.Color
	OnPrimaryFixed          graphics.Color
	OnPrimaryFixedVariant   graphics.Color
	SecondaryFixed          graphics.Color
	SecondaryFixedDim       graphics.Color
	OnSecondaryFixed        graphics.Color
	OnSecondaryFixedVariant graphics.Color
	TertiaryFixed           graphics.Color
	TertiaryFixedDim        graphics.Color
	OnTertiaryFixed         graphics.Color
	OnTertiaryFixedVariant  graphics.Color
}

Immutable

func DarkColorScheme

func DarkColorScheme() *ColorSchemeNext

func LightColorScheme

func LightColorScheme() *ColorSchemeNext

func (ColorSchemeNext) ContentFor

func (c ColorSchemeNext) ContentFor(backgroundColor graphics.Color) graphics.Color

func (ColorSchemeNext) FromToken

*

  • Helper function for component color tokens. Here is an example on how to use component color
  • tokens: “MaterialTheme.colorScheme.fromToken(ExtendedFabBranded.BrandedContainerColor)“

func (ColorSchemeNext) SurfaceColorAtElevation

func (c ColorSchemeNext) SurfaceColorAtElevation(elevation unit.Dp) graphics.Color

type ColorSchemeOption

type ColorSchemeOption func(*ColorScheme)

func WithBackground

func WithBackground(colSet *ColorSet) ColorSchemeOption

func WithError

func WithError(colSet *ColorSet) ColorSchemeOption

func WithErrorContainer

func WithErrorContainer(colSet *ColorSet) ColorSchemeOption

func WithInversePrimary

func WithInversePrimary(col Color) ColorSchemeOption

func WithInverseSurface

func WithInverseSurface(colSet *ColorSet) ColorSchemeOption

colset

func WithOutline

func WithOutline(col Color) ColorSchemeOption

func WithOutlineVariant

func WithOutlineVariant(col Color) ColorSchemeOption

func WithPrimary

func WithPrimary(colSet *ColorSet) ColorSchemeOption

func WithPrimaryContainer

func WithPrimaryContainer(colSet *ColorSet) ColorSchemeOption

func WithPrimaryFixed

func WithPrimaryFixed(colSet *ColorSet) ColorSchemeOption

func WithPrimaryFixedVariant

func WithPrimaryFixedVariant(colSet *ColorSet) ColorSchemeOption

func WithScrim

func WithScrim(col Color) ColorSchemeOption

func WithSecondary

func WithSecondary(colSet *ColorSet) ColorSchemeOption

func WithSecondaryContainer

func WithSecondaryContainer(colSet *ColorSet) ColorSchemeOption

func WithSecondaryFixed

func WithSecondaryFixed(colSet *ColorSet) ColorSchemeOption

func WithSecondaryFixedVariant

func WithSecondaryFixedVariant(colSet *ColorSet) ColorSchemeOption

func WithShadow

func WithShadow(col Color) ColorSchemeOption

func WithSurface

func WithSurface(colSet *ColorSet) ColorSchemeOption

func WithSurfaceBright

func WithSurfaceBright(col Color) ColorSchemeOption

func WithSurfaceContainer

func WithSurfaceContainer(col Color) ColorSchemeOption

func WithSurfaceContainerHigh

func WithSurfaceContainerHigh(col Color) ColorSchemeOption

func WithSurfaceContainerHighest

func WithSurfaceContainerHighest(col Color) ColorSchemeOption

func WithSurfaceContainerLow

func WithSurfaceContainerLow(col Color) ColorSchemeOption

func WithSurfaceContainerLowest

func WithSurfaceContainerLowest(col Color) ColorSchemeOption

func WithSurfaceDim

func WithSurfaceDim(col Color) ColorSchemeOption

func WithSurfaceVariant

func WithSurfaceVariant(colSet *ColorSet) ColorSchemeOption

func WithTertiary

func WithTertiary(colSet *ColorSet) ColorSchemeOption

func WithTertiaryContainer

func WithTertiaryContainer(colSet *ColorSet) ColorSchemeOption

func WithTertiaryFixed

func WithTertiaryFixed(colSet *ColorSet) ColorSchemeOption

func WithTertiaryFixedVariant

func WithTertiaryFixedVariant(colSet *ColorSet) ColorSchemeOption

type ColorSet

type ColorSet struct {
	Color   Color
	OnColor Color
}

func CoalesceColorSet

func CoalesceColorSet(ptr, def *ColorSet) *ColorSet

func ColorSetFromTokens

func ColorSetFromTokens(token token.MatColorSet) *ColorSet

func MergeColorSet

func MergeColorSet(a, b *ColorSet) *ColorSet

func TakeOrElseColorSet

func TakeOrElseColorSet(s, def *ColorSet) *ColorSet

func (*ColorSet) ToTokens

func (c *ColorSet) ToTokens() token.MatColorSet

type Composer

type Composer = api.Composer

type CubicBezierEasing

type CubicBezierEasing struct {
	A, B, C, D float32
}

CubicBezierEasing is a cubic polynomial easing implementing third-order Bézier curves.

This is equivalent to Android's PathInterpolator when a single cubic Bézier curve is specified.

Parameters:

  • A: The x coordinate of the first control point
  • B: The y coordinate of the first control point
  • C: The x coordinate of the second control point
  • D: The y coordinate of the second control point

func NewCubicBezierEasing

func NewCubicBezierEasing(a, b, c, d float32) *CubicBezierEasing

NewCubicBezierEasing creates a new CubicBezierEasing with the given control points.

func (*CubicBezierEasing) Transform

func (e *CubicBezierEasing) Transform(fraction float32) float32

Transform transforms the specified fraction (0..1) by this cubic Bézier curve.

type Easing

type Easing interface {
	Transform(fraction float32) float32
}

Easing is a way to adjust an animation's fraction. Easing allows transitioning elements to speed up and slow down, rather than moving at a constant rate.

Fraction is a value between 0 and 1.0 indicating the current point in the animation where 0 represents the start and 1.0 represents the end.

type LocalColorReciever

type LocalColorReciever = func(c Composer) graphics.Color

to be used instead of passing composer as parameter to every function

type MotionScheme

type MotionScheme struct{}

type MotionTokens

type MotionTokens struct {
	DurationShort1 time.Duration
	DurationShort2 time.Duration
	DurationShort3 time.Duration
	DurationShort4 time.Duration

	DurationMedium1 time.Duration
	DurationMedium2 time.Duration
	DurationMedium3 time.Duration
	DurationMedium4 time.Duration

	DurationLong1 time.Duration
	DurationLong2 time.Duration
	DurationLong3 time.Duration
	DurationLong4 time.Duration

	DurationExtraLong1 time.Duration
	DurationExtraLong2 time.Duration
	DurationExtraLong3 time.Duration
	DurationExtraLong4 time.Duration
}

type Shapes

type Shapes struct {
	ExtraSmall shape.Shape
	Small      shape.Shape
	Medium     shape.Shape
	Large      shape.Shape
	ExtraLarge shape.Shape
}

type TextFieldColors

type TextFieldColors struct {
	FocusedTextColor             Color
	UnfocusedTextColor           Color
	DisabledTextColor            Color
	ErrorTextColor               Color
	FocusedContainerColor        Color
	UnfocusedContainerColor      Color
	DisabledContainerColor       Color
	ErrorContainerColor          Color
	CursorColor                  Color
	ErrorCursorColor             Color
	TextSelectionColors          selection.TextSelectionColors
	FocusedIndicatorColor        Color
	UnfocusedIndicatorColor      Color
	DisabledIndicatorColor       Color
	ErrorIndicatorColor          Color
	FocusedLeadingIconColor      Color
	UnfocusedLeadingIconColor    Color
	DisabledLeadingIconColor     Color
	ErrorLeadingIconColor        Color
	FocusedTrailingIconColor     Color
	UnfocusedTrailingIconColor   Color
	DisabledTrailingIconColor    Color
	ErrorTrailingIconColor       Color
	FocusedLabelColor            Color
	UnfocusedLabelColor          Color
	DisabledLabelColor           Color
	ErrorLabelColor              Color
	FocusedPlaceholderColor      Color
	UnfocusedPlaceholderColor    Color
	DisabledPlaceholderColor     Color
	ErrorPlaceholderColor        Color
	FocusedSupportingTextColor   Color
	UnfocusedSupportingTextColor Color
	DisabledSupportingTextColor  Color
	ErrorSupportingTextColor     Color
	FocusedPrefixColor           Color
	UnfocusedPrefixColor         Color
	DisabledPrefixColor          Color
	ErrorPrefixColor             Color
	FocusedSuffixColor           Color
	UnfocusedSuffixColor         Color
	DisabledSuffixColor          Color
	ErrorSuffixColor             Color
}

type ThemeInterface

type ThemeInterface interface {
	ColorScheme() *ColorSchemeNext
	Typography() *Typography
	// Shapes() *Shapes
	MotionScheme() *MotionScheme
}

func Theme

type TokenColorSchemeOptions

type TokenColorSchemeOptions = func(scheme *token.Scheme)

func WithColorSchemeOptions

func WithColorSchemeOptions(options ...TokenColorSchemeOptions) TokenColorSchemeOptions

type Typography

type Typography struct {
	BodyLarge  *text.TextStyle
	BodyMedium *text.TextStyle
	BodySmall  *text.TextStyle

	DisplayLarge  *text.TextStyle
	DisplayMedium *text.TextStyle
	DisplaySmall  *text.TextStyle

	HeadlineLarge  *text.TextStyle
	HeadlineMedium *text.TextStyle
	HeadlineSmall  *text.TextStyle

	LabelLarge  *text.TextStyle
	LabelMedium *text.TextStyle
	LabelSmall  *text.TextStyle

	TitleLarge  *text.TextStyle
	TitleMedium *text.TextStyle
	TitleSmall  *text.TextStyle

	// Emphasized
	BodyLargeEmphasized  *text.TextStyle
	BodyMediumEmphasized *text.TextStyle
	BodySmallEmphasized  *text.TextStyle

	DisplayLargeEmphasized  *text.TextStyle
	DisplayMediumEmphasized *text.TextStyle
	DisplaySmallEmphasized  *text.TextStyle

	HeadlineLargeEmphasized  *text.TextStyle
	HeadlineMediumEmphasized *text.TextStyle
	HeadlineSmallEmphasized  *text.TextStyle

	LabelLargeEmphasized  *text.TextStyle
	LabelMediumEmphasized *text.TextStyle
	LabelSmallEmphasized  *text.TextStyle

	TitleLargeEmphasized  *text.TextStyle
	TitleMediumEmphasized *text.TextStyle
	TitleSmallEmphasized  *text.TextStyle
}

func (*Typography) FromToken

func (t *Typography) FromToken(value tokens.TypographyTokenKey) *text.TextStyle

type TypographyOption

type TypographyOption func(*Typography)

func WithBodyLarge

func WithBodyLarge(style *text.TextStyle) TypographyOption

func WithBodyLargeEmphasized

func WithBodyLargeEmphasized(style *text.TextStyle) TypographyOption

func WithBodyMedium

func WithBodyMedium(style *text.TextStyle) TypographyOption

func WithBodyMediumEmphasized

func WithBodyMediumEmphasized(style *text.TextStyle) TypographyOption

func WithBodySmall

func WithBodySmall(style *text.TextStyle) TypographyOption

func WithBodySmallEmphasized

func WithBodySmallEmphasized(style *text.TextStyle) TypographyOption

func WithDisplayLarge

func WithDisplayLarge(style *text.TextStyle) TypographyOption

func WithDisplayLargeEmphasized

func WithDisplayLargeEmphasized(style *text.TextStyle) TypographyOption

func WithDisplayMedium

func WithDisplayMedium(style *text.TextStyle) TypographyOption

func WithDisplayMediumEmphasized

func WithDisplayMediumEmphasized(style *text.TextStyle) TypographyOption

func WithDisplaySmall

func WithDisplaySmall(style *text.TextStyle) TypographyOption

func WithDisplaySmallEmphasized

func WithDisplaySmallEmphasized(style *text.TextStyle) TypographyOption

func WithHeadlineLarge

func WithHeadlineLarge(style *text.TextStyle) TypographyOption

func WithHeadlineLargeEmphasized

func WithHeadlineLargeEmphasized(style *text.TextStyle) TypographyOption

func WithHeadlineMedium

func WithHeadlineMedium(style *text.TextStyle) TypographyOption

func WithHeadlineMediumEmphasized

func WithHeadlineMediumEmphasized(style *text.TextStyle) TypographyOption

func WithHeadlineSmall

func WithHeadlineSmall(style *text.TextStyle) TypographyOption

func WithHeadlineSmallEmphasized

func WithHeadlineSmallEmphasized(style *text.TextStyle) TypographyOption

func WithLabelLarge

func WithLabelLarge(style *text.TextStyle) TypographyOption

func WithLabelLargeEmphasized

func WithLabelLargeEmphasized(style *text.TextStyle) TypographyOption

func WithLabelMedium

func WithLabelMedium(style *text.TextStyle) TypographyOption

func WithLabelMediumEmphasized

func WithLabelMediumEmphasized(style *text.TextStyle) TypographyOption

func WithLabelSmall

func WithLabelSmall(style *text.TextStyle) TypographyOption

func WithLabelSmallEmphasized

func WithLabelSmallEmphasized(style *text.TextStyle) TypographyOption

func WithTitleLarge

func WithTitleLarge(style *text.TextStyle) TypographyOption

func WithTitleLargeEmphasized

func WithTitleLargeEmphasized(style *text.TextStyle) TypographyOption

func WithTitleMedium

func WithTitleMedium(style *text.TextStyle) TypographyOption

func WithTitleMediumEmphasized

func WithTitleMediumEmphasized(style *text.TextStyle) TypographyOption

func WithTitleSmall

func WithTitleSmall(style *text.TextStyle) TypographyOption

func WithTitleSmallEmphasized

func WithTitleSmallEmphasized(style *text.TextStyle) TypographyOption

Directories

Path Synopsis
Package appbar contains Material 3 Top App Bar components.
Package appbar contains Material 3 Top App Bar components.
Package badge contains Material 3 Badge components.
Package badge contains Material 3 Badge components.
Package bottomappbar contains Material 3 Bottom App Bar components.
Package bottomappbar contains Material 3 Bottom App Bar components.
Package bottomsheet contains Material 3 Bottom Sheet components.
Package bottomsheet contains Material 3 Bottom Sheet components.
Package button contains Material 3 Button components.
Package button contains Material 3 Button components.
Package card contains Material 3 Card components.
Package card contains Material 3 Card components.
Package checkbox contains Material 3 Checkbox components.
Package checkbox contains Material 3 Checkbox components.
Package chip contains Material 3 Chip components.
Package chip contains Material 3 Chip components.
Package dialog contains Material 3 Dialog components.
Package dialog contains Material 3 Dialog components.
Package divider contains Material 3 Divider components.
Package divider contains Material 3 Divider components.
Package floatingactionbutton contains Material 3 Floating Action Button components.
Package floatingactionbutton contains Material 3 Floating Action Button components.
Package iconbutton contains Material 3 Icon Button components.
Package iconbutton contains Material 3 Icon Button components.
Package menu contains Material 3 Menu components.
Package menu contains Material 3 Menu components.
Package navigationbar contains Material 3 Navigation Bar components.
Package navigationbar contains Material 3 Navigation Bar components.
Package navigationdrawer contains Material 3 Navigation Drawer components.
Package navigationdrawer contains Material 3 Navigation Drawer components.
Package navigationrail contains Material 3 Navigation Rail components.
Package navigationrail contains Material 3 Navigation Rail components.
next
textfield
Package textfield contains Material 3 Text Field components.
Package textfield contains Material 3 Text Field components.
Package progress contains Material 3 Progress Indicators components.
Package progress contains Material 3 Progress Indicators components.
Package radiobutton contains Material 3 Radio Button components.
Package radiobutton contains Material 3 Radio Button components.
Package scaffold contains Material 3 Scaffold components.
Package scaffold contains Material 3 Scaffold components.
Package segmentedbutton contains Material 3 Segmented Button components.
Package segmentedbutton contains Material 3 Segmented Button components.
Package slider contains Material 3 Slider components.
Package slider contains Material 3 Slider components.
Package snackbar contains Material 3 Snackbar components.
Package snackbar contains Material 3 Snackbar components.
Package surface contains Material 3 Surface components.
Package surface contains Material 3 Surface components.
Package switch contains Material 3 Switch components.
Package switch contains Material 3 Switch components.
Package tab contains Material 3 Tab components.
Package tab contains Material 3 Tab components.
Package text contains Material 3 Text components and typography.
Package text contains Material 3 Text components and typography.
Package textfield contains Material 3 Text Field components.
Package textfield contains Material 3 Text Field components.
Package tooltip contains Material 3 Tooltip components.
Package tooltip contains Material 3 Tooltip components.

Jump to

Keyboard shortcuts

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