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
for (const buttonSwapEl ofbuttonSwapEls) buttonSwapEl.destroy();
18
-
};
19
-
});
20
-
returnbuttonSwap(args);
21
-
};
22
4
23
5
<Meta
24
6
title="Components/Button Swap"
@@ -67,7 +49,7 @@ You have the ability to pass `initialCallback` and `swappedCallback` callback fu
67
49
},
68
50
}}
69
51
>
70
-
{(args) =>buttonSwapStory(args)}
52
+
{(args) =>buttonSwap(args)}
71
53
</Story>
72
54
</Canvas>
73
55
@@ -83,71 +65,7 @@ You have the ability to pass `initialCallback` and `swappedCallback` callback fu
83
65
84
66
## JavaScript
85
67
86
-
You'll need to use JavaScript to select the Button Swap component via the `js-button-swap` CSS class and initialize it using the `initButtonSwap` function.
87
-
88
-
### Syntax
89
-
90
-
```js
91
-
initButtonSwap(buttonSwapEl, options);
92
-
```
93
-
94
-
### Parameters
95
-
96
-
#### `buttonSwapEl`
97
-
98
-
The `.js-button-swap` Button Swap wrapper element.
99
-
100
-
#### `options` (optional)
101
-
102
-
An object which allows you to optionally pass `initialCallback` and `swappedCallback` functions to be called when each button is clicked.
103
-
104
-
```js
105
-
options?: {
106
-
initialCallback?: (event:Event) =>void;
107
-
swappedCallback?: (event:Event) =>void;
108
-
}
109
-
```
110
-
111
-
### Return value
112
-
113
-
An object with a `destroy` function that removes event listeners.
0 commit comments