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
Trailing visual and trailing text can display auxiliary information. They're placed at the right of the item, and can denote status, keyboard shortcuts, or be used to set expectations about what the action does.
98
98
99
99
```javascript live noinline
100
-
// import {ActionList} from '@primer/react/drafts'
100
+
// import {ActionList} from '@primer/react/lib-esm/drafts'
101
101
const {ActionList} = drafts // ignore docs silliness; import like that ↑
102
102
103
103
render(
@@ -127,7 +127,7 @@ render(
127
127
Item dividers allow users to parse heavier amounts of information. They're placed between items and are useful in complex lists, particularly when descriptions or multi-line text is present.
128
128
129
129
```javascript live noinline
130
-
// import {ActionList} from '@primer/react/drafts'
130
+
// import {ActionList} from '@primer/react/lib-esm/drafts'
131
131
const {ActionList} = drafts // ignore docs silliness; import like that ↑
132
132
133
133
render(
@@ -163,7 +163,7 @@ When you want to add links to the List instead of actions, use `ActionList.LinkI
@@ -57,7 +57,7 @@ import {ActionMenu} from '@primer/react/drafts'
57
57
58
58
59
59
```javascript live noinline
60
-
// import {ActionMenu, ActionList} from '@primer/react/drafts'
60
+
// import {ActionMenu, ActionList} from '@primer/react/lib-esm/drafts'
61
61
const {ActionMenu, ActionList} = drafts // ignore docs silliness; import like that ↑
62
62
63
63
render(
@@ -84,7 +84,7 @@ You can choose to have a different _anchor_ for the Menu dependending on the app
84
84
85
85
86
86
```javascript live noinline
87
-
// import {ActionMenu, ActionList} from '@primer/react/drafts'
87
+
// import {ActionMenu, ActionList} from '@primer/react/lib-esm/drafts'
88
88
const {ActionMenu, ActionList} = drafts // ignore docs silliness; import like that ↑
89
89
90
90
render(
@@ -124,7 +124,7 @@ render(
124
124
### With Groups
125
125
126
126
```javascript live noinline
127
-
// import {ActionMenu, ActionList} from '@primer/react/drafts'
127
+
// import {ActionMenu, ActionList} from '@primer/react/lib-esm/drafts'
128
128
const {ActionMenu, ActionList} = drafts // ignore docs silliness; import like that ↑
129
129
130
130
render(
@@ -195,7 +195,7 @@ render(
195
195
To create an anchor outside of the menu, you need to switch to controlled mode for the menu and pass it as `anchorRef` to `ActionMenu`. Make sure you add `aria-expanded` and `aria-haspopup` to the external anchor:
196
196
197
197
```javascript live noinline
198
-
// import {ActionMenu, ActionList} from '@primer/react/drafts'
198
+
// import {ActionMenu, ActionList} from '@primer/react/lib-esm/drafts'
199
199
const {ActionMenu, ActionList} = drafts // ignore docs silliness; import like that ↑
200
200
201
201
constExample= () => {
@@ -231,7 +231,7 @@ render(<Example />)
231
231
To create an anchor outside of the menu, you need to switch to controlled mode for the menu and pass it as `anchorRef` to `ActionMenu`:
232
232
233
233
```javascript live noinline
234
-
// import {ActionMenu, ActionList} from '@primer/react/drafts'
234
+
// import {ActionMenu, ActionList} from '@primer/react/lib-esm/drafts'
235
235
const {ActionMenu, ActionList} = drafts // ignore docs silliness; import like that ↑
@@ -114,20 +144,28 @@ A common use case for primer is a button with a counter component which shows th
114
144
We provide `Button.Counter` as a composite component which requires you to provide a number as child.
115
145
The counter will match the `variant` styles of the parent button.
116
146
117
-
```jsx live
118
-
<drafts.Button>
119
-
Watch
120
-
<drafts.Button.Counter>1</drafts.Button.Counter>
121
-
</drafts.Button>
147
+
```javascript live noinline
148
+
// import {Button} from '@primer/react/lib-esm/drafts'
149
+
const {Button} = drafts // ignore docs silliness; import like that ↑
150
+
151
+
render(
152
+
<Button>
153
+
Watch
154
+
<Button.Counter>1</Button.Counter>
155
+
</Button>
156
+
)
122
157
```
123
158
124
159
### Styling a button
125
160
126
161
A button can be styled in an appropriate manner using the `sx` prop. This maybe to change width, or to add margins etc.
127
162
Here's an example of a block button which takes 100% of available width. Checkout [styled-system](https://styled-system.com/) to see what you can send in an `sx` prop.
0 commit comments