NestedListView
The Nested ListView is a collection of items that can be nested to create a parent/child relationship. Each item has a primary piece of information and action, one or multiple secondary actions, and associated metadata about the primary piece of information.
Internal Component
This component is intended solely for use within GitHub and is not available for external use.Props
NestedListView
| Name | Default | Description |
|---|---|---|
header | React.ReactElement<({ title, completionPill, assistiveAnnouncement, sectionFilters, children, className, actionBarClassName, onToggleSelectAll, actions, actionsLabel, ...actionBarProps }: NestedListViewHeaderProps) => React.JSX.Element, string | React.JSXElementConstructor<any>>An optional element to contain bulk actions, a 'Select all' checkbox, etc. | |
isSelectable | booleanControls item's selection mode; bulk actions are allowed if true. Defaults to not selectable. | |
singularUnits | stringWhat a single list item should be called. Used to customize assistive text about how many list items are selected. Defaults to 'list item'. | |
pluralUnits | stringWhat many list items are called. Used to customize assistive text about how many list items are selected. Defaults to 'list items'. | |
ariaLabelledBy | stringOptional ID of an element that labels the Nested List View. When provided, this takes the place of the default sr-only title. | |
listRef | React.MutableRefObject<HTMLUListElement> | |
isCollapsible | booleanOptional parameter to determine whether the Nested List View is collapsible from the header component | |
isReadOnly | boolean | |
className | string | |
dragAndDropProps | { onDrop: (args: OnDropArgs<string>) => void; renderOverlay: (dragMetadata: { id: string; title: string; }, index: number) => React.ReactElement<any, string | React.JSXElementConstructor<any>>; items: { id: string; title: string; }[]; }Optional callback for drag and drop | |
totalCount Required | ||
selectedCount Required |
NestedListViewCompletionPill
| Name | Default | Description |
|---|---|---|
progress Required | Progress |
NestedListItemActionBar
| Name | Default | Description |
|---|---|---|
anchorIcon | IconOverride the icon used in the button that opens the action menu. Defaults to KebabHorizontalIcon. | |
label | GitHubUiActionBarProps | |
className | string |
NestedListItemDescription
| Name | Default | Description |
|---|---|---|
className | string |
NestedListItemLeadingBadge
| Name | Default | Description |
|---|---|---|
variant Required | ||
size Required | ||
title Required | stringText that is shown as a visible Primer Label and as visually hidden text for screen readers. | |
href | stringThe link that will be opened when the item is clicked | |
className | stringContainer class name. | |
color | ColorName |
NestedListItemLeadingContent
| Name | Default | Description |
|---|---|---|
className | string |
NestedListItemLeadingVisual
| Name | Default | Description |
|---|---|---|
icon | OcticonPropsThe Octicon component representing the desired icon | |
children | React.ReactNodeRender any child content as the leading visual NOTE: if both icon and children are passed, the icon will be rendered first, with the children appended after | |
color | stringThe name of the Primer variable that will be used for the icon's fill eg.: var(--fgColor-done) | |
description | stringA text description of the item Used for visually hidden text to describe the item on focus for the screen readers | |
newActivity | booleanIndicates whether the rendered item has new content since lastViewed | |
className | string |
NestedListItemMainContent
| Name | Default | Description |
|---|---|---|
children | React.ReactNode |
NestedListItemMetadata
| Name | Default | Description |
|---|---|---|
alignment | "left" | "right"Controls how the metadata will be aligned inside the trailing content. Defaults to 'left'. | |
variant | "primary" | "secondary"Alter the appearance of the metadata to appear more subtle than other ListItem content ('secondary', default) or comparable to other ListItem content ('primary'). Affects text color, font size, width, and distance from other metadata items. |
NestedListItem
| Name | Default | Description |
|---|---|---|
isSelected | boolean | |
isActive | boolean | |
onSelect | (isSelected: boolean) => void | |
onKeyDown | (event: React.KeyboardEvent<HTMLLIElement>) => void | |
onFocus | (event: React.FocusEvent<HTMLLIElement, Element>) => void | |
subItemsCount | numberOptional. Show an expand icon to indicating that the list item has additional sub items to show. | |
subItems | React.ReactElement<({ children, isSelected, onSelect, ...rest }: React.PropsWithChildren<NestedListItemProps>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>, string | React.JSXElementConstructor<any>>[]Optional. Nested sub items that will be rendered when the sub tree is expanded. | |
loadSubItems | () => voidOptional. Callback for loading sub items | |
defaultExpanded | booleanOptional. The expanded state of the item when it is initially rendered. Use to control the state. | |
className | stringList Item's inner container class name | |
metadataContainerClassName | stringMetadata Container class name | |
dragAndDropProps | { showTrigger?: boolean; isOverlay?: boolean; itemId?: string; } | |
title Required | React.ReactElement<typeof NestedListItemTitle, string | React.JSXElementConstructor<any>>A NestedListItem title communicates the overall purpose of the NestedListItem. | |
metadata | MetadataContainerPropsOptional extra elements to display on the right side of the list item. You can optionally wrap individual
pieces of content in | |
secondaryActions | React.ReactElement<typeof NestedListItemActionBar, string | React.JSXElementConstructor<any>>Optional menu of additional actions to be shown on the right side of the NestedListItem. Use | |
children | React.ReactNodeOther content. |
NestedListItemTitle
| Name | Default | Description |
|---|---|---|
containerClassName | string | |
leadingBadge | React.ReactElement<typeof NestedListItemLeadingBadge, string | React.JSXElementConstructor<any>> | |
trailingBadges | React.ReactElement<({ title, className, children, ...props }: NestedListItemTrailingBadgeProps) => React.JSX.Element, string | React.JSXElementConstructor<any>>[] | |
anchorClassName | string | |
anchorRef | React.ForwardedRef<HTMLAnchorElement>A ref to the anchor element | |
href | stringThe link that will be opened when the item is clicked | |
additionalLinkProps | Omit<any, "ref"> | |
onClick | React.MouseEventHandler<HTMLElement>A click handler to be executed when the element is clicked | |
tooltip | stringThe tooltip to add context to the title | |
value Required | stringThe text content of the header, to convey the primary meaning of the list item. |
NestedListItemTrailingBadge
| Name | Default | Description |
|---|---|---|
variant Required | ||
size Required | ||
title | stringText that is shown as a visible Primer Label and as visually hidden text for screen readers. | |
className | stringContainer class name. |
NestedListViewHeader
| Name | Default | Description |
|---|---|---|
title | React.ReactElement<({ title, children, className, scrollToOnCollapseOffset, }: NestedListViewHeaderTitleProps) => React.JSX.Element, string | React.JSXElementConstructor<any>>The rendered title of the list or information regarding its contents. | |
completionPill | React.ReactElement<typeof NestedListViewCompletionPill, string | React.JSXElementConstructor<any>>Display completed & total issue information about the issues contained in the NestedListView | |
sectionFilters | anyLinks for applying any categorical, mutually exclusive section filters for the content of the NestedListView. | |
assistiveAnnouncement | stringUsed for assistive announcements that are reflective of the visual updates to the list container a sighted user will experience when using the list. Defaults to no announcement. Visually hidden, for screenreaders only. | |
onToggleSelectAll | (isSelectAllChecked: boolean) => voidCallback for when the checkbox for selecting and deselecting all list items is toggled. | |
children | React.ReactNodeOptional additional actions to show. Will not fall into an overflow dropdown menu to accommodate small screen widths. | |
className | stringContainer class name. | |
actionBarClassName | stringAction Bar container class name. |
NestedListViewHeaderSectionFilterLink
| Name | Default | Description |
|---|---|---|
title Required | stringThe name of this section filter, e.g., "Open" to describe a section filter that shows only open issues. | |
count | React.ReactNodeThe number of list items in the category this section filter represents. Optional. Changes appearance when
| |
href Required | stringThe URL to load the list with only items matching this section filter. | |
isSelected | booleanOptionally specify whether this section filter is currently active. Defaults to not being selected. | |
isLoading | booleanOptionally specify whether the section filter is still being loaded. Will be used to style the count, if given, when true. | |
className | string |
NestedListViewHeaderTitle
| Name | Default | Description |
|---|---|---|
title Required | string | |
children | React.ReactNode | |
className | string | |
onSetExpanded | (isExpanded: boolean) => void | |
scrollToOnCollapseOffset | numberThe offset from the top to scroll to after collapsing |