ListView
The props declared for ListView, generated from the types @proyecto-viviana/ui ships.
Import
import { ListView } from "@proyecto-viviana/ui";Props
| Prop | Type | Default | Description |
|---|---|---|---|
children* | JSX.Element | ((item: T) => JSX.Element) | — | The ListView items. Use static ListViewItem children or a render function with `items`. |
items | T[] | — | The items to render for dynamic collections. |
isQuiet | false | true | — | Whether the ListView should draw without the default container chrome. |
selectionStyle | 'checkbox' | 'highlight' | 'checkbox' | How selection is visualized. |
overflowMode | 'wrap' | 'truncate' | 'truncate' | Whether labels and descriptions truncate or wrap. |
hideLinkOutIcon | false | true | — | Hides the external-link trailing icon on link items. |
loadingState | 'idle' | 'loading' | 'loadingMore' | 'sorting' | 'filtering' | 'error' | — | Loading state forwarded to load-more behavior. |
renderActionBar | (selectedKeys: "all" | Set<Key>) => JSX.Element | — | Provides an action bar when items are selected. |
styles | StyleString | — | Spectrum-defined generated classes. |
UNSAFE_className | string | UnsafeClassName | — | Additional CSS class name. Use only as a last resort. |
UNSAFE_style | JSX.CSSProperties | — | Additional inline styles. Use only as a last resort. |
class | string | — | Backward-compatible class alias. Prefer UNSAFE_className for S2 parity. |
slot | string | — | Slot name when used in a Spectrum context. |
ref | HTMLDivElement | ((el: HTMLDivElement) => void) | { current?: HTMLDivElement | null | undefined; } | — | Ref for the grid list root element. |
size | 'sm' | 'md' | 'lg' | — | Legacy GridList size alias retained for compatibility. |
variant | 'default' | 'bordered' | 'cards' | — | Legacy GridList variant alias retained for compatibility. |
layout | 'grid' | 'list' | — | Legacy GridList layout alias retained for compatibility. |
columns | number | "auto" | — | Legacy GridList columns alias retained for compatibility. |
label | number | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement | — | Legacy label helper. Prefer aria-label or aria-labelledby. |
description | number | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement | — | Legacy description helper. |
id | string | — | ID for the grid list element. solidaria |
onSelectionChange | (keys: "all" | Set<Key>) => void | — | Handler called when selection changes. solidaria-components |
aria-describedby | string | — | ARIA describedby for the grid list. solidaria |
aria-label | string | — | ARIA label for the grid list. solidaria |
aria-labelledby | string | — | ARIA labelledby for the grid list. solidaria |
isDisabled | false | true | — | Whether the grid list is disabled. solidaria |
selectionMode | 'none' | 'single' | 'multiple' | — | The selection mode. solidaria-components |
selectedKeys | "all" | Iterable<Key> | — | Currently selected keys (controlled). solidaria-components |
defaultSelectedKeys | "all" | Iterable<Key> | — | Default selected keys (uncontrolled). solidaria-components |
orientation | 'horizontal' | 'vertical' | 'vertical' | The primary orientation of the items. Usually this is the direction that the collection scrolls. solidaria-components |
onAction | (key: Key) => void | — | Handler for item actions. solidaria |
getKey | (item: T) => Key | — | Function to get the key from an item. solidaria-components |
getTextValue | (item: T) => string | — | Function to get the text value from an item. solidaria-components |
getDisabled | (item: T) => boolean | — | Function to check if an item is disabled. solidaria-components |
disabledKeys | Iterable<Key> | — | Keys of disabled items. solidaria-components |
disabledBehavior | 'all' | 'selection' | — | Whether disabled items can still receive focus. solidaria-components |
renderEmptyState | () => JSX.Element | — | A function to render when the grid list is empty. solidaria-components |
dragAndDropHooks | DragAndDropHooks<T> | — | Drag and drop hooks from `useDragAndDrop`. solidaria-components |
isVirtualized | false | true | — | Whether the grid list uses virtual scrolling. solidaria |
keyboardDelegate | KeyboardDelegate | — | An optional keyboard delegate implementation for type to select, to override the default. solidaria |
layoutDelegate | LayoutDelegate | — | A delegate object that provides layout information for items in the collection. By default this uses the DOM, but this can be overridden to implement things like virtualized scrolling. solidaria |
shouldSelectOnPressUp | false | true | — | Whether selection should occur on press up. solidaria |
keyboardNavigationBehavior | 'tab' | 'arrow' | "arrow" | How keyboard navigation should behave within rows. `"arrow"` treats the collection as a single tab stop and uses arrow keys to move through row children. `"tab"` lets tabbable row children participate in normal tab order and stops child key events before collection navigation. solidaria |
direction | 'ltr' | 'rtl' | "ltr" | The text direction, used to flip the inline navigation axis in a horizontal orientation. solidaria |
columnCount | number | — | Column count for `layout="grid"` Down/Up. When omitted, Down/Up walk document order. solidaria |
hasMore | false | true | — | Whether there are more items to load. solidaria-components |
onLoadMore | () => void | Promise<void> | — | Called when the load more sentinel becomes visible. solidaria-components |
Declared in packages/viviana-ui/src/gridlist/index.tsx.
ListViewItem props
| Prop | Type | Default | Description |
|---|---|---|---|
id* | Key | — | The unique id of the ListViewItem. |
children | number | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement | ((renderProps: GridListItemRenderProps) => JSX.Element) | — | The contents of the item. |
isDisabled | false | true | — | Whether this item is disabled. Static collections support this directly; dynamic collections can also use `getDisabled`. |
hasChildItems | false | true | — | Whether this item navigates into child content. |
href | string | — | Link target metadata for visual parity with React Spectrum's link-out affordance. |
target | string | — | Not yet documented |
download | string | boolean | — | Not yet documented |
rel | string | — | Not yet documented |
hrefLang | string | — | Not yet documented |
ping | string | — | Not yet documented |
referrerPolicy | string | — | Not yet documented |
routerOptions | unknown | — | Router options forwarded to client router navigation, when href is provided. |
description | number | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement | — | Optional description text. Prefer `<Text slot="description">`. |
icon | () => JSX.Element | — | Optional icon helper retained from the older GridList API. |
image | string | — | Optional image helper retained from the older GridList API. |
imageAlt | string | — | Alt text for the image helper. |
styles | StyleString | — | Spectrum-defined generated classes. |
UNSAFE_className | string | UnsafeClassName | — | Additional CSS class name. Use only as a last resort. |
UNSAFE_style | JSX.CSSProperties | — | Additional inline styles. Use only as a last resort. |
class | string | — | Backward-compatible class alias. Prefer UNSAFE_className for S2 parity. |
ref | HTMLDivElement | ((el: HTMLDivElement) => void) | { current?: HTMLDivElement | null | undefined; } | — | Ref for the rendered row element. |
slot | string | false | — | A slot name for the component. HTML `slot` may be `false` to omit. solidaria-components |
onAction | () => void | — | Handler called when the item is activated. solidaria-components |
item | T | — | The item value. solidaria-components |
textValue | string | — | The text value of the item (for accessibility). solidaria-components |
Declared in packages/viviana-ui/src/gridlist/index.tsx.
Props marked solidaria or solidaria-components come from the headless layer underneath and behave the same in both registers. Components that wrap a DOM element also accept that element's standard attributes, which are left out here on purpose — listing them would bury the props that are actually ours.