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
feat(ToggleGroup): added full width variant (#12374)
* feat(ToggleGroup): added full width variant
* Updated types in example
* Updated example description
* Mentioned variants in example desc
* Hyphenated words
* Rebased + redeleted
* Yarn lock
@@ -21,6 +22,7 @@ A single select toggle group allows users to toggle between multiple items.
21
22
To indicate whether a `<ToggleGroupItem>` is selected or not, use the `isSelected` property.
22
23
23
24
```ts file="./ToggleGroupDefaultSingle.tsx"
25
+
24
26
```
25
27
26
28
### Multi select toggle group
@@ -30,6 +32,7 @@ A multi select toggle group allows users to select multiple items at once.
30
32
When a toggle item is disabled it cannot be selected. Click the "Disable all" button in the following example to see this in action.
31
33
32
34
```ts file="./ToggleGroupDefaultMultiple.tsx"
35
+
33
36
```
34
37
35
38
### With icons
@@ -39,6 +42,7 @@ You can use a recognizable icon as a toggle item label.
39
42
To do this, pass an imported icon to the `icon` property of a `<ToggleGroupItem>`.
40
43
41
44
```ts file="./ToggleGroupIcon.tsx"
45
+
42
46
```
43
47
44
48
### With text and icons
@@ -50,13 +54,23 @@ To do this, pass a descriptive label to the `text` property of a `<ToggleGroupIt
50
54
When passing both `text` and `icon` properties to a `<ToggleGroupItem>`, you can also pass in `iconPosition` to determine whether the icon is rendered at the start or end of the item.
51
55
52
56
```ts file="./ToggleGroupTextIcon.tsx"
57
+
53
58
```
54
59
55
60
### Compact toggle group
56
61
57
-
When space in a UI is limited, you can use a compact toggle group.
62
+
When space in a UI is limited, you can use a compact toggle group.
58
63
59
64
To apply compact styling to a `<ToggleGroup>`, use `isCompact`.
60
65
61
66
```ts file="./ToggleGroupCompact.tsx"
67
+
68
+
```
69
+
70
+
### Full-width toggle group
71
+
72
+
To make toggle group items fill the available horizontal space, use `isFill` on a `<ToggleGroup>`. The following example shows full-width toggle groups for a single-select, multi-select, and single-select with disabled item.
0 commit comments