chip

package
v0.1.115 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package chip contains Material 3 Chip components.

Reference: [Chips](https://m3.material.io/components/chips/overview) Specs: [Chips Specs](https://m3.material.io/components/chips/specs)

Index

Constants

View Source
const ChipNodeID = "Material3Chip"

Variables

This section is empty.

Functions

func AssistChip

func AssistChip(onClick func(), label string, options ...ChipOption) api.Composable

AssistChip represents a Material 3 Assist Chip. Assist chips represent smart or automated actions that can span multiple apps, such as opening a calendar event from the home screen.

func Chip

func Chip(onClick func(), label string, options ...ChipOption) api.Composable

Chip is the internal generic implementation.

func FilterChip

func FilterChip(onClick func(), label string, options ...ChipOption) api.Composable

FilterChip represents a Material 3 Filter Chip. Filter chips use tags or descriptive words to filter content. They can be a good alternative to toggle buttons or checkboxes.

func InputChip

func InputChip(onClick func(), label string, options ...ChipOption) api.Composable

InputChip represents a Material 3 Input Chip. Input chips represent pieces of information entered by a user, such as an event attendee or filter term.

func SuggestionChip

func SuggestionChip(onClick func(), label string, options ...ChipOption) api.Composable

SuggestionChip represents a Material 3 Suggestion Chip. Suggestion chips help narrow down user intent by presenting dynamically generated suggestions, such as possible responses or search filters.

Types

type ChipOption

type ChipOption func(*ChipOptions)

func WithBorder

func WithBorder(width unit.Dp, col graphics.Color) ChipOption

func WithColor

func WithColor(col graphics.Color) ChipOption

func WithElevation

func WithElevation(elevation unit.Dp) ChipOption

func WithEnabled

func WithEnabled(enabled bool) ChipOption

func WithLeadingIcon

func WithLeadingIcon(icon api.Composable) ChipOption

func WithModifier

func WithModifier(m ui.Modifier) ChipOption

func WithSelected

func WithSelected(selected bool) ChipOption

func WithShape

func WithShape(s shape.Shape) ChipOption

func WithTrailingIcon

func WithTrailingIcon(icon api.Composable) ChipOption

type ChipOptions

type ChipOptions struct {
	Modifier     ui.Modifier
	Shape        shape.Shape
	Color        graphics.Color
	BorderColor  graphics.Color
	BorderWidth  unit.Dp
	Elevation    unit.Dp
	Height       unit.Dp
	LeadingIcon  api.Composable
	TrailingIcon api.Composable
	Enabled      bool
	Selected     bool
}

func DefaultChipOptions

func DefaultChipOptions(c Composer) ChipOptions

type Composable

type Composable = api.Composable

type Composer

type Composer = api.Composer

Jump to

Keyboard shortcuts

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