You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: packages/mdc-chips/README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,7 @@ You can optionally add a leading icon (i.e. thumbnail) and/or a trailing icon to
79
79
CSS Class | Description
80
80
--- | ---
81
81
`mdc-chip-set` | Mandatory. Indicates the set that the chip belongs to
82
+
`mdc-chip-set--choice` | Optional. Indicates that the chips in the set are choice chips, which allow a single selection from a set of options.
82
83
`mdc-chip` | Mandatory.
83
84
`mdc-chip__text` | Mandatory. Indicates the text content of the chip
84
85
`mdc-chip__icon` | Optional. Indicates an icon in the chip
@@ -97,11 +98,14 @@ Mixin | Description
97
98
`mdc-chip-fill-color-accessible($color)` | Customizes the background fill color for a chip, and updates the chip's ink and ripple color to meet accessibility standards
98
99
`mdc-chip-fill-color($color)` | Customizes the background fill color for a chip
99
100
`mdc-chip-ink-color($color)` | Customizes the text ink color for a chip, and updates the chip's ripple color to match
101
+
`mdc-chip-activated-ink-color($color)` | Customizes text ink color and updates the ripple opacity of a chip in the _activated_ state
100
102
`mdc-chip-stroke($width, $style, $color)` | Customizes the border stroke properties for a chip
101
103
`mdc-chip-stroke-width($width)` | Customizes the border stroke width for a chip
102
104
`mdc-chip-stroke-style($style)` | Customizes the border stroke style for a chip
103
105
`mdc-chip-stroke-color($color)` | Customizes the border stroke color for a chip
104
106
107
+
> _NOTE_: `mdc-chip-ink-color` also updates the chip's text ink color for _hover_ and _activated_ states, and updates the ripple opacity of the chip in the _activated_ state.
108
+
105
109
### `MDCChip` and `MDCChipSet`
106
110
107
111
The MDC Chips module is comprised of two JavaScript classes:
@@ -112,6 +116,10 @@ To use the `MDCChip` and `MDCChipSet` classes, [import](../../docs/importing-js.
112
116
113
117
#### `MDCChip`
114
118
119
+
Method Signature | Description
120
+
--- | ---
121
+
`toggleActive() => void` | Proxies to the foundation's `toggleActive` method
122
+
115
123
Property | Value Type | Description
116
124
--- | --- | ---
117
125
`ripple` | `MDCRipple` | The `MDCRipple` instance for the root element that `MDCChip` initializes
@@ -128,6 +136,9 @@ Property | Value Type | Description
128
136
129
137
Method Signature | Description
130
138
--- | ---
139
+
`addClass(className: string) => void` | Adds a class to the root element
140
+
`removeClass(className: string) => void` | Removes a class from the root element
141
+
`hasClass(className: string) => boolean` | Returns true if the root element contains the given class
131
142
`registerInteractionHandler(evtType: string, handler: EventListener) => void` | Registers an event listener on the root element
132
143
`deregisterInteractionHandler(evtType: string, handler: EventListener) => void` | Deregisters an event listener on the root element
133
144
`notifyInteraction() => void` | Emits a custom event "MDCChip:interaction" denoting the chip has been interacted with, which bubbles to the parent `mdc-chip-set` element
0 commit comments