@@ -7,6 +7,8 @@ storybook: '/react/storybook?path=/story/components-actionlist'
77description : An ActionList is a list of items that can be activated or selected. ActionList is the base component for many menu-type components, including ActionMenu and SelectPanel.
88---
99
10+ import data from ' ../../src/ActionList/ActionList.docs.json'
11+
1012import {Avatar } from ' @primer/react'
1113import {ActionList } from ' @primer/react'
1214import {LinkIcon , AlertIcon , ArrowRightIcon } from ' @primer/octicons-react'
@@ -226,207 +228,7 @@ render(<SelectFields />)
226228
227229## Props
228230
229- ### ActionList
230-
231- <PropsTable >
232- <PropsTableRow name = " children" required type = " ActionList.Item[] | ActionList.LinkItem[] | ActionList.Group[]" />
233- <PropsTableRow
234- name = " variant"
235- type = " 'inset' | 'full'"
236- defaultValue = " 'inset'"
237- description = {
238- <>
239- <InlineCode >inset</InlineCode > children are offset (vertically and horizontally) from list edges.{ ' ' }
240- <InlineCode >full</InlineCode > children are flush (vertically and horizontally) with list edges
241- </>
242- }
243- />
244- <PropsTableRow
245- name = " selectionVariant"
246- type = " 'single' | 'multiple'"
247- description = " Whether multiple items or a single item can be selected."
248- />
249- <PropsTableRow
250- name = " showDivider"
251- type = " boolean"
252- defaultValue = " false"
253- description = " Display a divider above each item in this list when it does not follow a header or divider."
254- />
255- <PropsTableRow
256- name = " role"
257- type = {
258- <Link href = " https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#roles" >AriaRole</Link >
259- }
260- description = {
261- <>
262- ARIA role describing the function of the list. <InlineCode >listbox</InlineCode > and{ ' ' }
263- <InlineCode >menu</InlineCode > are a common values.
264- </>
265- }
266- />
267- <PropsTableSxRow />
268- </PropsTable >
269-
270- ### ActionList.Item
271-
272- <PropsTable >
273- <PropsTableRow
274- name = " children"
275- required
276- type = " React.ReactNode | ActionList.LeadingVisual | ActionList.Description | ActionList.TrailingVisual"
277- />
278- <PropsTableRow
279- name = " variant"
280- type = " 'default' | 'danger'"
281- defaultValue = " 'default'"
282- description = {
283- <>
284- <InlineCode >danger</InlineCode > indicates that the item is destructive.
285- </>
286- }
287- />
288- <PropsTableRow
289- name = " onSelect"
290- type = " (event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>) => void"
291- description = " Callback that is called when the item is selected using either the mouse or keyboard."
292- />
293- <PropsTableRow
294- name = " selected"
295- type = " boolean"
296- defaultValue = " false"
297- description = " Indicate whether the item is selected. Only applies to items that can be selected."
298- />
299- <PropsTableRow
300- name = " active"
301- type = " boolean"
302- defaultValue = " false"
303- description = " Indicate whether the item is active. There should never be more than one active item."
304- />
305- <PropsTableRow
306- name = " disabled"
307- type = " boolean"
308- defaultValue = " false"
309- description = " Items that are disabled can not be clicked, selected, or navigated to."
310- />
311- <PropsTableRow
312- name = " role"
313- type = {
314- <Link href = " https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#roles" >AriaRole</Link >
315- }
316- description = {
317- <>
318- ARIA role describing the function of the item. <InlineCode >option</InlineCode > is a common value.
319- </>
320- }
321- />
322- <PropsTableSxRow />
323- </PropsTable >
324-
325- ### ActionList.LinkItem
326-
327- <PropsTable >
328- <PropsTableRow
329- name = " children"
330- required
331- type = " React.ReactNode | ActionList.LeadingVisual | ActionList.Description | ActionList.TrailingVisual"
332- />
333- <PropsTableRow
334- name = " active"
335- type = " boolean"
336- defaultValue = " false"
337- description = " Indicate whether the item is active. There should never be more than one active item."
338- />
339- <PropsTableBasePropRows
340- elementType = " a"
341- isPolymorphic
342- refType = " HTMLAnchorElement"
343- passthroughPropsLink = {
344- <Link href = " https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes" >MDN</Link >
345- }
346- />
347- </PropsTable >
348-
349- ### ActionList.LeadingVisual
350-
351- <PropsTable >
352- <PropsTableRow
353- name = " children"
354- required
355- type = " React.ReactNode"
356- description = " Icon (or similar) positioned before item text."
357- />
358- <PropsTableSxRow />
359- </PropsTable >
360-
361- ### ActionList.TrailingVisual
362-
363- <PropsTable >
364- <PropsTableRow name = " children" required type = " React.ReactNode" description = " Visual positioned after item text." />
365- <PropsTableSxRow />
366- </PropsTable >
367-
368- ### ActionList.Description
369-
370- <PropsTable >
371- <PropsTableRow name = " children" required type = " React.ReactNode" />
372- <PropsTableRow
373- name = " variant"
374- type = " 'inline' | 'block'"
375- defaultValue = " 'inline'"
376- description = {
377- <>
378- <InlineCode >inline</InlineCode > descriptions are positioned beside primary text. <InlineCode >block</InlineCode >{ ' ' }
379- descriptions are positioned below primary text.
380- </>
381- }
382- />
383- <PropsTableSxRow />
384- </PropsTable >
385-
386- ### ActionList.Group
387-
388- <PropsTable >
389- <PropsTableRow name = " children" required type = " ActionList.Item[] | ActionList.LinkItem[]" />
390- <PropsTableRow name = " title" type = " string" description = " Title of the group." />
391- <PropsTableRow
392- name = " auxiliaryText"
393- type = " string"
394- description = " Secondary text that provides additional information about the group."
395- />
396- <PropsTableRow
397- name = " variant"
398- type = " 'filled' | 'subtle'"
399- defaultValue = " 'subtle'"
400- description = {
401- <>
402- <InlineCode >inline</InlineCode > descriptions are positioned beside primary text. <InlineCode >block</InlineCode >{ ' ' }
403- descriptions are positioned below primary text.
404- </>
405- }
406- />
407- <PropsTableRow
408- name = " selectionVariant"
409- type = " 'single' | 'multiple' | false"
410- description = {
411- <>
412- Set <InlineCode >selectionVariant</InlineCode > at the group level.
413- </>
414- }
415- />
416- <PropsTableRow
417- name = " role"
418- type = {
419- <Link href = " https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#roles" >AriaRole</Link >
420- }
421- description = {
422- <>
423- ARIA role describing the function of the list inside the group. <InlineCode >listbox</InlineCode > and{ ' ' }
424- <InlineCode >menu</InlineCode > are a common values.
425- </>
426- }
427- />
428- <PropsTableSxRow />
429- </PropsTable >
231+ <ComponentProps data = { data } />
430232
431233## Status
432234
0 commit comments