Skip to content

GridList

Props

API reference for GridList. For usage examples, see the React tab.

GridList.Root

NameTypeDefault
children((item: T) => ReactNode) | ReactNode

The contents of the collection.

dependenciesreadonly any[]

Values that should invalidate the item cache when using dynamic collections.

disabledBehaviorDisabledBehavior'all'

Whether disabledKeys applies to all interactions, or only selection.

disabledKeysIterable<Key>

The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.

disallowEmptySelectionboolean

Whether the collection allows empty selection.

disallowTypeAheadbooleanfalse

Whether typeahead navigation is disabled.

dragAndDropHooksDragAndDropHooks<NoInfer<T>>

The drag and drop hooks returned by useDragAndDrop used to enable drag and drop behavior for the GridList.

escapeKeyBehavior"clearSelection" | "none"'clearSelection'

Whether pressing the escape key should clear selection in the grid list or not.

Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually.

itemsIterable<T>

Item objects in the collection.

keyboardNavigationBehavior"arrow" | "tab"'arrow'

Whether keyboard navigation to focusable elements within grid list items is via the left/right arrow keys or the tab key.

layout"grid" | "stack"'stack'

Whether the items are arranged in a stack or grid.

orientationOrientation'vertical'

The primary orientation of the items. Usually this is the direction that the collection scrolls.

renderEmptyState((props: GridListRenderProps) => ReactNode)

Provides content to display when there are no items in the list.

selectionBehaviorSelectionBehavior'toggle'

How multiple selection should behave in the collection.

selectionModeSelectionMode

The type of selection that is allowed in the collection.

shouldSelectOnPressUpboolean

Whether selection should occur on press up instead of press down.

UNSTABLE_focusOnEntry"first" | "last"

Which item in the collection to focus when tabbing into the collection. Overrides default roving tab index like behavior.

GridList.Item

NameTypeDefault
allowsArrowNavigationboolean

Whether the row should support arrow key navigation even when the containing collection uses tab keyboard navigation. Allows users to navigate between rows with arrow keys while focus is on an interactive child element within the row.

childrenChildrenOrFunction<GridListItemRenderProps>

The children of the component. A function may be provided to alter the children based on component state.

downloadstring | boolean

Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN (opens in new tab).

focusMode"child" | "row"

Whether the row or its first focusable child element should be focused when navigating to the row. Defaults to 'row'.

hrefstring

A URL to link to. See MDN (opens in new tab).

hrefLangstring

Hints at the human language of the linked URL. SeeMDN (opens in new tab).

isDisabledboolean

Whether the item is disabled.

pingstring

A space-separated list of URLs to ping when the link is followed. See MDN (opens in new tab).

referrerPolicyHTMLAttributeReferrerPolicy

How much of the referrer to send when following the link. See MDN (opens in new tab).

relstring

The relationship between the linked resource and the current page. See MDN (opens in new tab).

routerOptionsundefined

Options for the configured client side router.

targetHTMLAttributeAnchorTarget

The target window for the link. See MDN (opens in new tab).

textValuestring

A string representation of the item's contents, used for features like typeahead.

GridList.Section

NameTypeDefault
children((item: unknown) => ReactElement<unknown, string | JSXElementConstructor<any>>) | ReactNode

Static child items or a function to render children.

dependenciesreadonly any[]

Values that should invalidate the item cache when using dynamic collections.

itemsIterable<unknown>

Item objects in the section.

GridList.SectionHeader

NameTypeDefault
aboutstring
accessKeystring
autoSavestring
childrenReactNode
colorstring
contentstring
contextMenustring
dangerouslySetInnerHTML{ __html: string | TrustedHTML; }
datatypestring
defaultCheckedboolean
exportpartsstring

See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts (opens in new tab)

inlistany
inputMode"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url"

Hints at the type of data that might be entered by the user while editing the element or its contents

See: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute (opens in new tab)

itemIDstring
itemPropstring
itemRefstring
itemScopeboolean
itemTypestring
partstring

See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part (opens in new tab)

prefixstring
propertystring
radioGroupstring
relstring
resourcestring
resultsnumber
revstring
securitystring
titlestring
typeofstring
unselectable"off" | "on"
vocabstring