@coinbase/cds-mcp-server 8.25.1 → 8.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 8.27.0 ((12/3/2025, 09:30 AM PST))
12
+
13
+ This is an artificial version bump with no new change.
14
+
15
+ ## 8.26.0 ((12/1/2025, 12:25 PM PST))
16
+
17
+ This is an artificial version bump with no new change.
18
+
11
19
  ## 8.25.1 ((12/1/2025, 11:18 AM PST))
12
20
 
13
21
  This is an artificial version bump with no new change.
@@ -113,7 +113,7 @@ Note: The mobile ContentCellFallback uses theme-based line heights and reuses th
113
113
 
114
114
  | Prop | Type | Required | Default | Description |
115
115
  | --- | --- | --- | --- | --- |
116
- | `accessory` | `more \| selected \| arrow` | No | `-` | Accessory to display at the end of the cell. |
116
+ | `accessory` | `more \| selected \| arrow \| unselected` | No | `-` | Accessory to display at the end of the cell. |
117
117
  | `accessoryNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Custom accessory node rendered at the end of the cell. Takes precedence over accessory. |
118
118
  | `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
119
119
  | `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
@@ -2012,7 +2012,7 @@ function ForecastAssetPrice() {
2012
2012
  | `showArea` | `boolean` | No | `-` | Whether to show area fill under the line. |
2013
2013
  | `showXAxis` | `boolean` | No | `-` | Whether to show the X axis. |
2014
2014
  | `showYAxis` | `boolean` | No | `-` | Whether to show the Y axis. |
2015
- | `strokeOpacity` | `number` | No | `1` | Opacity of the line |
2015
+ | `strokeOpacity` | `number \| { value: number; }` | No | `1` | Opacity of the line |
2016
2016
  | `strokeWidth` | `number` | No | `2` | Width of the line |
2017
2017
  | `style` | `((false \| RegisteredStyle<ViewStyle> \| WithAnimatedObject<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle> \| RecursiveArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>> \| readonly (ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>)[]>) & ((false \| RegisteredStyle<ViewStyle> \| WithAnimatedObject<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle> \| RecursiveArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>> \| readonly (ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>)[]>) & (false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>>))) \| null` | No | `-` | Custom styles for the root element. |
2018
2018
  | `styles` | `{ root?: StyleProp<ViewStyle>; chart?: StyleProp<ViewStyle>; }` | No | `-` | Custom styles for the component. |
@@ -294,6 +294,29 @@ When you pass the `end` prop, it overrides the `detail`/`subdetail`/`detailNode`
294
294
  />
295
295
  ```
296
296
 
297
+ #### Preserve Layout During Selection
298
+
299
+ Use the `unselected` accessory to reserve space for the selection checkmark when toggling the `selected` state.
300
+
301
+ ```tsx
302
+ function PreserveLayoutExample() {
303
+ const [isSelected, setIsSelected] = useState(false);
304
+
305
+ return (
306
+ <VStack gap={1}>
307
+ <ListCell
308
+ accessory={isSelected ? 'selected' : 'unselected'}
309
+ description="Selected state uses the same space, no layout shift when selected"
310
+ spacingVariant="condensed"
311
+ title="Leverage unselected state"
312
+ selected={isSelected}
313
+ onPress={() => setIsSelected((prev) => !prev)}
314
+ />
315
+ </VStack>
316
+ );
317
+ }
318
+ ```
319
+
297
320
  #### Custom Accessory via Node Prop
298
321
 
299
322
  ```tsx
@@ -571,7 +594,7 @@ Mapping to `styles` / `classNames` keys:
571
594
 
572
595
  | Prop | Type | Required | Default | Description |
573
596
  | --- | --- | --- | --- | --- |
574
- | `accessory` | `more \| selected \| arrow` | No | `-` | Accessory to display at the end of the cell. |
597
+ | `accessory` | `more \| selected \| arrow \| unselected` | No | `-` | Accessory to display at the end of the cell. |
575
598
  | `accessoryNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Custom accessory node rendered at the end of the cell. Takes precedence over accessory. |
576
599
  | `action` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
577
600
  | `adjustsFontSizeToFit` | `boolean` | No | `-` | Specifies whether font should be scaled down automatically to fit given style constraints. |
@@ -289,6 +289,7 @@ function LabelStyleExample() {
289
289
  | `labelHorizontalAlignment` | `left \| right \| center` | No | `-` | Horizontal alignment of the label text. |
290
290
  | `labelPosition` | `TextHorizontalAlignment \| TextVerticalAlignment` | No | `'right' 'top'` | Position of the label along the horizontal line. Position of the label along the vertical line. |
291
291
  | `labelVerticalAlignment` | `top \| bottom \| middle` | No | `-` | Vertical alignment of the label text. |
292
+ | `opacity` | `number \| { value: number; }` | No | `1` | Opacity applied to both the line and label. |
292
293
  | `stroke` | `string` | No | `theme.color.bgLine` | The color of the line. |
293
294
  | `yAxisId` | `string` | No | `-` | The ID of the y-axis to use for positioning. Defaults to defaultAxisId if not specified. |
294
295
 
@@ -705,7 +705,7 @@ By default, Scrubber will show an overlay to de-emphasize future data. You can h
705
705
  | `beaconLabelHorizontalOffset` | `number` | No | `-` | Horizontal offset for beacon labels from their beacon position. Measured in pixels. |
706
706
  | `beaconLabelMinGap` | `number` | No | `-` | Minimum gap between beacon labels to prevent overlap. Measured in pixels. |
707
707
  | `beaconTransitions` | `{ update?: Transition; pulse?: Transition \| undefined; pulseRepeatDelay?: number \| undefined; } \| undefined` | No | `-` | Transition configuration for the scrubber beacon. |
708
- | `hideLine` | `boolean` | No | `-` | Hides the scrubber line |
708
+ | `hideLine` | `boolean` | No | `-` | Hides the scrubber line. |
709
709
  | `hideOverlay` | `boolean` | No | `-` | Hides the overlay rect which obscures data beyond the scrubber position. |
710
710
  | `idlePulse` | `boolean` | No | `-` | Pulse the beacons while at rest. |
711
711
  | `key` | `Key \| null` | No | `-` | - |
@@ -10,6 +10,10 @@ import { Select } from '@coinbase/cds-mobile/alpha/select'
10
10
 
11
11
  ## Examples
12
12
 
13
+ :::note Duplicate Values
14
+ Avoid using options with duplicate values. Each option's `value` should be unique within the options array to ensure proper selection behavior.
15
+ :::
16
+
13
17
  ### Single Select
14
18
 
15
19
  Basic single selection with predefined options for mobile interfaces.
@@ -41,6 +45,10 @@ function SingleSelectExample() {
41
45
 
42
46
  Multi-selection mode allows users to select multiple options from the list with touch-friendly controls.
43
47
 
48
+ :::note Disabled Options and Select All
49
+ Disabled options and options inside disabled groups will be skipped when "Select all" is pressed. Only enabled options will be selected.
50
+ :::
51
+
44
52
  ```jsx
45
53
  function MultiSelectExample() {
46
54
  const { value, onChange } = useMultiSelect({
@@ -70,6 +78,95 @@ function MultiSelectExample() {
70
78
  }
71
79
  ```
72
80
 
81
+ ### Single Select with Groups
82
+
83
+ Organize options into logical groups for better organization on mobile.
84
+
85
+ ```jsx
86
+ function SingleSelectWithGroupsExample() {
87
+ const [value, setValue] = useState(null);
88
+
89
+ const groupedOptions = [
90
+ {
91
+ label: 'Group A',
92
+ options: [
93
+ { value: '1', label: 'Option 1' },
94
+ { value: '2', label: 'Option 2' },
95
+ { value: '3', label: 'Option 3' },
96
+ ],
97
+ },
98
+ {
99
+ label: 'Group B',
100
+ options: [
101
+ { value: '4', label: 'Option 4' },
102
+ { value: '5', label: 'Option 5' },
103
+ ],
104
+ },
105
+ {
106
+ label: 'Group C',
107
+ options: [{ value: '6', label: 'Option 6' }],
108
+ },
109
+ ];
110
+
111
+ return (
112
+ <Select
113
+ label="Choose an option"
114
+ value={value}
115
+ onChange={setValue}
116
+ options={groupedOptions}
117
+ placeholder="Select an option"
118
+ />
119
+ );
120
+ }
121
+ ```
122
+
123
+ ### Multi-Select with Groups
124
+
125
+ Use groups in multi-select mode to organize selections on mobile.
126
+
127
+ ```jsx
128
+ function MultiSelectWithGroupsExample() {
129
+ const { value, onChange } = useMultiSelect({
130
+ initialValue: [],
131
+ });
132
+
133
+ const groupedOptions = [
134
+ {
135
+ label: 'Group A',
136
+ options: [
137
+ { value: '1', label: 'Option 1' },
138
+ { value: '2', label: 'Option 2' },
139
+ { value: '3', label: 'Option 3' },
140
+ ],
141
+ },
142
+ {
143
+ label: 'Group B',
144
+ options: [
145
+ { value: '4', label: 'Option 4' },
146
+ { value: '5', label: 'Option 5' },
147
+ ],
148
+ },
149
+ {
150
+ label: 'Group C',
151
+ options: [{ value: '6', label: 'Option 6' }],
152
+ },
153
+ ];
154
+
155
+ return (
156
+ <Select
157
+ type="multi"
158
+ label="Choose multiple options"
159
+ value={value}
160
+ onChange={onChange}
161
+ options={groupedOptions}
162
+ placeholder="Select options"
163
+ selectAllLabel="Select all options"
164
+ clearAllLabel="Clear all selections"
165
+ />
166
+ );
167
+ }
168
+ ```
169
+
73
170
  ### Accessibility Props
74
171
 
75
172
  The mobile Select component supports comprehensive accessibility features including custom labels, hints, and roles.
@@ -149,6 +246,53 @@ function VariantExample() {
149
246
  }
150
247
  ```
151
248
 
249
+ ### With Disabled Option Group
250
+
251
+ Disable entire groups to prevent selection of those options.
252
+
253
+ ```jsx
254
+ function DisabledGroupExample() {
255
+ const [value, setValue] = useState(null);
256
+
257
+ const groupedOptions = [
258
+ {
259
+ label: 'Available Options',
260
+ options: [
261
+ { value: '1', label: 'Option 1' },
262
+ { value: '2', label: 'Option 2' },
263
+ { value: '3', label: 'Option 3' },
264
+ ],
265
+ },
266
+ {
267
+ label: 'Unavailable Options (Group Disabled)',
268
+ disabled: true,
269
+ options: [
270
+ { value: '4', label: 'Option 4' },
271
+ { value: '5', label: 'Option 5' },
272
+ { value: '6', label: 'Option 6' },
273
+ ],
274
+ },
275
+ {
276
+ label: 'More Available Options',
277
+ options: [
278
+ { value: '7', label: 'Option 7' },
279
+ { value: '8', label: 'Option 8' },
280
+ ],
281
+ },
282
+ ];
283
+
284
+ return (
285
+ <Select
286
+ label="Choose an option"
287
+ value={value}
288
+ onChange={setValue}
289
+ options={groupedOptions}
290
+ placeholder="Select an option"
291
+ />
292
+ );
293
+ }
294
+ ```
295
+
152
296
  ### Compact Mode
153
297
 
154
298
  The Select component can be rendered in a compact size for denser mobile UIs.
@@ -1235,42 +1379,5 @@ function CustomComponentExamples() {
1235
1379
 
1236
1380
  | Prop | Type | Required | Default | Description |
1237
1381
  | --- | --- | --- | --- | --- |
1238
- | `onChange` | `(value: Type extends multi ? SelectOptionValue \| SelectOptionValue[] \| null : SelectOptionValue \| null) => void` | Yes | `-` | - |
1239
- | `options` | `(SelectOption<SelectOptionValue> & Pick<SelectOptionProps<Type, string>, media \| end \| accessory> & { Component?: SelectOptionComponent<Type, SelectOptionValue> \| undefined; })[]` | Yes | `-` | Array of options to display in the select dropdown |
1240
- | `value` | `string \| SelectOptionValue[] \| null` | Yes | `-` | - |
1241
- | `SelectAllOptionComponent` | `SelectOptionComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render the Select All option |
1242
- | `SelectControlComponent` | `SelectControlComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render the select control |
1243
- | `SelectDropdownComponent` | `SelectDropdownComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render the dropdown container |
1244
- | `SelectEmptyDropdownContentsComponent` | `SelectEmptyDropdownContentComponent` | No | `-` | Custom component to render when no options are available |
1245
- | `SelectOptionComponent` | `SelectOptionComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render individual options |
1246
- | `accessibilityRoles` | `{ option?: AccessibilityRole; } \| undefined` | No | `-` | Accessibility roles for dropdown elements |
1247
- | `accessory` | `ReactElement<CellAccessoryProps, string \| JSXElementConstructor<any>>` | No | `-` | - |
1248
- | `clearAllLabel` | `string` | No | `-` | Label for the Clear All option in multi-select mode |
1249
- | `compact` | `boolean` | No | `-` | Whether to use compact styling for the select |
1250
- | `defaultOpen` | `boolean` | No | `-` | Initial open state when component mounts (uncontrolled mode) |
1251
- | `disableClickOutsideClose` | `boolean` | No | `-` | Whether clicking outside the dropdown should close it |
1252
- | `disabled` | `boolean` | No | `false` | Toggles input interactability and opacity |
1253
- | `emptyOptionsLabel` | `string` | No | `-` | Label displayed when there are no options available |
1254
- | `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | End-aligned content (e.g., value, status). Replaces the deprecated detail prop. |
1255
- | `endNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the end of the inner input. Refer to diagram for location of endNode in InputStack component |
1256
- | `helperText` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Helper text displayed below the select |
1257
- | `hiddenSelectedOptionsLabel` | `string` | No | `-` | Label to show for showcasing count of hidden selected options |
1258
- | `hideSelectAll` | `boolean` | No | `-` | Whether to hide the Select All option in multi-select mode |
1259
- | `label` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label displayed above the control |
1260
- | `labelVariant` | `inside \| outside` | No | `'outside'` | The variant of the label. Only used when compact is not true. |
1261
- | `maxSelectedOptionsToShow` | `number` | No | `-` | Maximum number of selected options to show before truncating |
1262
- | `media` | `ReactElement` | No | `-` | Media rendered at the start of the cell (icon, avatar, image, etc). |
1263
- | `open` | `boolean` | No | `-` | Controlled open state of the dropdown |
1264
- | `placeholder` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Placeholder text displayed when no option is selected |
1265
- | `ref` | `null \| (instance: SelectRef \| null) => void \| RefObject<SelectRef>` | No | `-` | - |
1266
- | `removeSelectedOptionAccessibilityLabel` | `string` | No | `-` | Accessibility label for each chip in a multi-select |
1267
- | `selectAllLabel` | `string` | No | `-` | Label for the Select All option in multi-select mode |
1268
- | `setOpen` | `((open: boolean \| ((open: boolean) => boolean)) => void)` | No | `-` | Callback to update the open state |
1269
- | `startNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the start of the inner input. Refer to diagram for location of startNode in InputStack component |
1270
- | `style` | `null \| false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>>` | No | `-` | Inline styles for the root element |
1271
- | `styles` | `{ root?: StyleProp<ViewStyle>; control?: StyleProp<ViewStyle>; controlStartNode?: StyleProp<ViewStyle>; controlInputNode?: StyleProp<ViewStyle>; controlValueNode?: StyleProp<ViewStyle>; controlLabelNode?: StyleProp<ViewStyle>; controlHelperTextNode?: StyleProp<ViewStyle>; controlEndNode?: StyleProp<ViewStyle>; controlBlendStyles?: InteractableBlendStyles; dropdown?: StyleProp<ViewStyle>; option?: StyleProp<ViewStyle>; optionCell?: StyleProp<ViewStyle>; optionContent?: StyleProp<ViewStyle>; optionLabel?: StyleProp<ViewStyle>; optionDescription?: StyleProp<ViewStyle>; optionBlendStyles?: InteractableBlendStyles \| undefined; selectAllDivider?: StyleProp<ViewStyle>; emptyContentsContainer?: StyleProp<ViewStyle>; emptyContentsText?: StyleProp<ViewStyle>; } \| undefined` | No | `-` | Custom styles for different parts of the select |
1272
- | `testID` | `string` | No | `-` | Test ID for the root element |
1273
- | `type` | `single \| multi` | No | `-` | Whether the select allows single or multiple selections |
1274
- | `variant` | `primary \| secondary \| positive \| negative \| foregroundMuted \| foreground` | No | `-` | Determines the sentiment of the input. Because we allow startContent and endContent to be custom ReactNode, the content placed inside these slots will not change colors according to the variant. You will have to add that yourself |
1275
1382
 
1276
1383
 
@@ -0,0 +1,367 @@
1
+ # SelectChipAlpha
2
+
3
+ A chip-styled Select control built on top of the Alpha Select component. Supports both single and multi selection.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { SelectChip } from '@coinbase/cds-mobile/alpha/select-chip/SelectChip'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ SelectChip is built on top of the [Alpha Select](/components/inputs/SelectAlpha/) component. It provides a chip-styled interface while maintaining all the functionality of Select, including support for single and multi-selection, option groups, and custom components.
14
+
15
+ :::note Duplicate Values
16
+ Avoid using options with duplicate values. Each option's `value` should be unique within the options array to ensure proper selection behavior.
17
+ :::
18
+
19
+ ### Basic usage
20
+
21
+ ```tsx
22
+ function ExampleDefault() {
23
+ const exampleOptions = [
24
+ { value: null, label: 'Clear selection' },
25
+ { value: '1', label: 'Option 1' },
26
+ { value: '2', label: 'Option 2' },
27
+ { value: '3', label: 'Option 3' },
28
+ { value: '4', label: 'Option 4' },
29
+ ];
30
+ const [value, setValue] = useState<string | null>(null);
31
+ return (
32
+ <SelectChip
33
+ label="Select a value"
34
+ accessibilityLabel="Select a value"
35
+ onChange={setValue}
36
+ options={exampleOptions}
37
+ placeholder="Choose an option"
38
+ value={value}
39
+ />
40
+ );
41
+ }
42
+ ```
43
+
44
+ ### Single select with groups
45
+
46
+ ```tsx
47
+ function ExampleSingleGroups() {
48
+ const exampleOptions: Array<SelectOption | SelectOptionGroup> = [
49
+ {
50
+ label: 'Group A',
51
+ options: [
52
+ { value: '1', label: 'Option 1' },
53
+ { value: '2', label: 'Option 2' },
54
+ { value: '3', label: 'Option 3' },
55
+ ],
56
+ },
57
+ {
58
+ label: 'Group B',
59
+ options: [
60
+ { value: '4', label: 'Option 4' },
61
+ { value: '5', label: 'Option 5' },
62
+ ],
63
+ },
64
+ {
65
+ label: 'Group C',
66
+ options: [{ value: '6', label: 'Option 6' }],
67
+ },
68
+ ];
69
+ const [value, setValue] = useState<string | null>(null);
70
+ return (
71
+ <SelectChip
72
+ accessibilityLabel="Select a value"
73
+ label="Select a value"
74
+ onChange={setValue}
75
+ options={exampleOptions}
76
+ placeholder="Choose an option"
77
+ value={value}
78
+ />
79
+ );
80
+ }
81
+ ```
82
+
83
+ ### With disabled option group
84
+
85
+ ```tsx
86
+ function ExampleDisabledGroup() {
87
+ const exampleOptions: Array<SelectOption | SelectOptionGroup> = [
88
+ {
89
+ label: 'Group A',
90
+ options: [
91
+ { value: '1', label: 'Option 1' },
92
+ { value: '2', label: 'Option 2' },
93
+ { value: '3', label: 'Option 3' },
94
+ ],
95
+ },
96
+ {
97
+ label: 'Group B',
98
+ disabled: true,
99
+ options: [
100
+ { value: '4', label: 'Option 4' },
101
+ { value: '5', label: 'Option 5' },
102
+ ],
103
+ },
104
+ {
105
+ label: 'Group C',
106
+ options: [{ value: '6', label: 'Option 6' }],
107
+ },
108
+ ];
109
+ const [value, setValue] = useState<string | null>(null);
110
+ return (
111
+ <SelectChip
112
+ accessibilityLabel="Select a value"
113
+ label="Select a value"
114
+ onChange={setValue}
115
+ options={exampleOptions}
116
+ placeholder="Choose an option"
117
+ value={value}
118
+ />
119
+ );
120
+ }
121
+ ```
122
+
123
+ ### Multi-select
124
+
125
+ :::note Disabled Options and Select All
126
+ Disabled options and options inside disabled groups will be skipped when "Select all" is pressed. Only enabled options will be selected.
127
+ :::
128
+
129
+ ```tsx
130
+ function ExampleMulti() {
131
+ const exampleOptions = [
132
+ { value: '1', label: 'Option 1' },
133
+ { value: '2', label: 'Option 2', disabled: true },
134
+ { value: '3', label: 'Option 3' },
135
+ { value: '4', label: 'Option 4' },
136
+ { value: '5', label: 'Option 5' },
137
+ ];
138
+ const { value, onChange } = useMultiSelect({ initialValue: [] });
139
+ return (
140
+ <SelectChip
141
+ accessibilityLabel="Select multiple values"
142
+ label="Select multiple values"
143
+ onChange={onChange}
144
+ options={exampleOptions}
145
+ placeholder="Choose options"
146
+ type="multi"
147
+ value={value}
148
+ />
149
+ );
150
+ }
151
+ ```
152
+
153
+ ### Multi-select with groups
154
+
155
+ ```tsx
156
+ function ExampleMultiGroups() {
157
+ const exampleOptions: Array<SelectOption | SelectOptionGroup> = [
158
+ {
159
+ label: 'Group A',
160
+ options: [
161
+ { value: '1', label: 'Option 1' },
162
+ { value: '2', label: 'Option 2' },
163
+ { value: '3', label: 'Option 3' },
164
+ ],
165
+ },
166
+ {
167
+ label: 'Group B',
168
+ options: [
169
+ { value: '4', label: 'Option 4' },
170
+ { value: '5', label: 'Option 5' },
171
+ ],
172
+ },
173
+ {
174
+ label: 'Group C',
175
+ options: [{ value: '6', label: 'Option 6' }],
176
+ },
177
+ ];
178
+ const { value, onChange } = useMultiSelect({ initialValue: [] });
179
+ return (
180
+ <SelectChip
181
+ accessibilityLabel="Select multiple values"
182
+ label="Select multiple values"
183
+ onChange={onChange}
184
+ options={exampleOptions}
185
+ placeholder="Choose options"
186
+ type="multi"
187
+ value={value}
188
+ />
189
+ );
190
+ }
191
+ ```
192
+
193
+ ### Compact
194
+
195
+ ```tsx
196
+ function ExampleCompact() {
197
+ const exampleOptions = [
198
+ { value: '1', label: 'Option 1' },
199
+ { value: '2', label: 'Option 2' },
200
+ { value: '3', label: 'Option 3' },
201
+ { value: '4', label: 'Option 4' },
202
+ ];
203
+ const [value, setValue] = useState<string | null>('1');
204
+ return (
205
+ <SelectChip
206
+ compact
207
+ label="Choose an option"
208
+ onChange={setValue}
209
+ options={exampleOptions}
210
+ placeholder="Choose an option"
211
+ value={value}
212
+ />
213
+ );
214
+ }
215
+ ```
216
+
217
+ ### With start and end nodes
218
+
219
+ ```tsx
220
+ function ExampleWithNodes() {
221
+ const exampleOptions = [
222
+ { value: 'btc', label: assets.btc.name },
223
+ { value: 'eth', label: assets.eth.name },
224
+ { value: 'dai', label: assets.dai.name },
225
+ ];
226
+ const [value, setValue] = useState<string | null>('eth');
227
+ const getStartNode = (selectedValue: string | null) => {
228
+ if (!selectedValue) return null;
229
+ const assetMap: Record<string, string> = {
230
+ btc: assets.btc.imageUrl,
231
+ eth: assets.eth.imageUrl,
232
+ dai: assets.dai.imageUrl,
233
+ };
234
+ const imageUrl = assetMap[selectedValue];
235
+ if (!imageUrl) return null;
236
+ return <RemoteImage height={24} shape="circle" source={imageUrl} width={24} />;
237
+ };
238
+ return (
239
+ <SelectChip
240
+ label="Choose an asset"
241
+ onChange={setValue}
242
+ options={exampleOptions}
243
+ placeholder="Choose an asset"
244
+ startNode={getStartNode(value)}
245
+ value={value}
246
+ />
247
+ );
248
+ }
249
+ ```
250
+
251
+ ### Empty options
252
+
253
+ ```tsx
254
+ function ExampleEmptyOptions() {
255
+ const [value, setValue] = useState<string | null>(null);
256
+ return (
257
+ <SelectChip
258
+ label="Select ..."
259
+ onChange={setValue}
260
+ options={[]}
261
+ placeholder="Select ..."
262
+ value={value}
263
+ />
264
+ );
265
+ }
266
+ ```
267
+
268
+ ### Options with descriptions
269
+
270
+ ```tsx
271
+ function ExampleDescriptions() {
272
+ const exampleOptions = [
273
+ { value: '1', label: 'Option 1', description: 'First option description' },
274
+ { value: '2', label: 'Option 2', description: 'Second option description' },
275
+ { value: '3', label: 'Option 3', description: 'Third option description' },
276
+ { value: '4', label: 'Option 4', description: 'Fourth option description' },
277
+ ];
278
+ const [value, setValue] = useState<string | null>(null);
279
+ return (
280
+ <SelectChip
281
+ accessibilityLabel="Select a value"
282
+ label="Select a value"
283
+ onChange={setValue}
284
+ options={exampleOptions}
285
+ placeholder="Choose an option"
286
+ value={value}
287
+ />
288
+ );
289
+ }
290
+ ```
291
+
292
+ ### Disabled
293
+
294
+ ```tsx
295
+ function ExampleDisabled() {
296
+ const exampleOptions = [
297
+ { value: '1', label: 'Option 1' },
298
+ { value: '2', label: 'Option 2' },
299
+ { value: '3', label: 'Option 3' },
300
+ { value: '4', label: 'Option 4' },
301
+ ];
302
+ const [value, setValue] = useState<string | null>('1');
303
+ return (
304
+ <VStack gap={2}>
305
+ <SelectChip
306
+ disabled
307
+ accessibilityLabel="Select a value"
308
+ onChange={setValue}
309
+ options={exampleOptions}
310
+ placeholder="Choose an option"
311
+ value={null}
312
+ />
313
+ <SelectChip
314
+ disabled
315
+ accessibilityLabel="Select a value"
316
+ onChange={setValue}
317
+ options={exampleOptions}
318
+ placeholder="Choose an option"
319
+ value={value}
320
+ />
321
+ </VStack>
322
+ );
323
+ }
324
+ ```
325
+
326
+ ## Props
327
+
328
+ | Prop | Type | Required | Default | Description |
329
+ | --- | --- | --- | --- | --- |
330
+ | `onChange` | `(value: Type extends multi ? SelectOptionValue \| SelectOptionValue[] \| null : SelectOptionValue \| null) => void` | Yes | `-` | - |
331
+ | `options` | `SelectOptionList<Type, SelectOptionValue>` | Yes | `-` | Array of options to display in the select dropdown. Can be individual options or groups with label and options |
332
+ | `value` | `string \| SelectOptionValue[] \| null` | Yes | `-` | - |
333
+ | `SelectAllOptionComponent` | `SelectOptionComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render the Select All option |
334
+ | `SelectDropdownComponent` | `SelectDropdownComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render the dropdown container |
335
+ | `SelectEmptyDropdownContentsComponent` | `SelectEmptyDropdownContentComponent` | No | `-` | Custom component to render when no options are available |
336
+ | `SelectOptionComponent` | `SelectOptionComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render individual options |
337
+ | `SelectOptionGroupComponent` | `SelectOptionGroupComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render group headers |
338
+ | `accessibilityRoles` | `{ option?: AccessibilityRole; } \| undefined` | No | `-` | Accessibility roles for dropdown elements |
339
+ | `accessory` | `ReactElement<CellAccessoryProps, string \| JSXElementConstructor<any>>` | No | `-` | - |
340
+ | `clearAllLabel` | `string` | No | `-` | Label for the Clear All option in multi-select mode |
341
+ | `compact` | `boolean` | No | `-` | Whether to use compact styling for the select |
342
+ | `defaultOpen` | `boolean` | No | `-` | Initial open state when component mounts (uncontrolled mode) |
343
+ | `disableClickOutsideClose` | `boolean` | No | `-` | Whether clicking outside the dropdown should close it |
344
+ | `disabled` | `boolean` | No | `false` | Toggles input interactability and opacity |
345
+ | `emptyOptionsLabel` | `string` | No | `-` | Label displayed when there are no options available |
346
+ | `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | End-aligned content (e.g., value, status). Replaces the deprecated detail prop. |
347
+ | `endNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the end of the inner input. Refer to diagram for location of endNode in InputStack component |
348
+ | `hiddenSelectedOptionsLabel` | `string` | No | `-` | Label to show for showcasing count of hidden selected options |
349
+ | `hideSelectAll` | `boolean` | No | `-` | Whether to hide the Select All option in multi-select mode |
350
+ | `invertColorScheme` | `boolean` | No | `false` | Invert the foreground and background colors to emphasize the Chip. Depending on your theme, it may be dangerous to use this prop in conjunction with transparentWhileInactive. |
351
+ | `label` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label displayed above the control |
352
+ | `maxSelectedOptionsToShow` | `number` | No | `-` | Maximum number of selected options to show before truncating |
353
+ | `media` | `ReactElement` | No | `-` | Media rendered at the start of the cell (icon, avatar, image, etc). |
354
+ | `numberOfLines` | `number` | No | `1` | How many lines the text in the chip will be broken into. |
355
+ | `open` | `boolean` | No | `-` | Controlled open state of the dropdown |
356
+ | `placeholder` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Placeholder text displayed when no option is selected |
357
+ | `ref` | `null \| (instance: SelectRef \| null) => void \| RefObject<SelectRef>` | No | `-` | - |
358
+ | `removeSelectedOptionAccessibilityLabel` | `string` | No | `-` | Accessibility label for each chip in a multi-select |
359
+ | `selectAllLabel` | `string` | No | `-` | Label for the Select All option in multi-select mode |
360
+ | `setOpen` | `((open: boolean \| ((open: boolean) => boolean)) => void)` | No | `-` | Callback to update the open state |
361
+ | `startNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the start of the inner input. Refer to diagram for location of startNode in InputStack component |
362
+ | `style` | `null \| false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<ViewStyle \| Falsy \| RegisteredStyle<ViewStyle>>` | No | `-` | Inline styles for the root element |
363
+ | `styles` | `{ root?: StyleProp<ViewStyle>; control?: StyleProp<ViewStyle>; controlStartNode?: StyleProp<ViewStyle>; controlInputNode?: StyleProp<ViewStyle>; controlValueNode?: StyleProp<ViewStyle>; controlLabelNode?: StyleProp<ViewStyle>; controlHelperTextNode?: StyleProp<ViewStyle>; controlEndNode?: StyleProp<ViewStyle>; controlBlendStyles?: InteractableBlendStyles; dropdown?: StyleProp<ViewStyle>; option?: StyleProp<ViewStyle>; optionCell?: StyleProp<ViewStyle>; optionContent?: StyleProp<ViewStyle>; optionLabel?: StyleProp<ViewStyle>; optionDescription?: StyleProp<ViewStyle>; optionBlendStyles?: InteractableBlendStyles \| undefined; selectAllDivider?: StyleProp<ViewStyle>; emptyContentsContainer?: StyleProp<ViewStyle>; emptyContentsText?: StyleProp<ViewStyle>; optionGroup?: StyleProp<ViewStyle>; } \| undefined` | No | `-` | Custom styles for different parts of the select |
364
+ | `testID` | `string` | No | `-` | Test ID for the root element |
365
+ | `type` | `single \| multi` | No | `-` | Whether the select allows single or multiple selections |
366
+
367
+