Table

Die Table zeigt Daten in Zeilen und Spalten. Sie hilft dabei, Informationen schnell zu überblicken und Einträge zu vergleichen.GitHubMarkdown
NameTypeDefaultDescription
colorprimary | accent | secondary | dangerprimaryThe color of the button
variantplain | solid | softsolidThe variant of the button
sizem | smThe size of the button

Properties

PropertyTypeDefaultDescription
childrenReactNode-The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows.
translate"yes" | "no"-
styleStyleOrFunction<TooltipRenderProps>-The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.
dirstring-
langstring-
hiddenboolean-
inertboolean-
slotstring-A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.
disallowEmptySelectionboolean-Whether the collection allows empty selection.
disabledKeysIterable<Key>-A list of row keys to disable.
escapeKeyBehavior"none" | "clearSelection"'clearSelection'Whether pressing the escape key should clear selection in the table 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.
shouldSelectOnPressUpboolean-Whether selection should occur on press up instead of press down.
treeColumnKey-The id of the column that displays hierarchical data.
selectionModeSelectionMode-The type of selection that is allowed in the collection.
selectedKeys"all" | Iterable<Key>-The currently selected keys in the collection (controlled).
defaultSelectedKeys"all" | Iterable<Key>-The initial selected keys in the collection (uncontrolled).
sortDescriptorSortDescriptor-The current sorted column and direction.
expandedKeysIterable<Key>-The currently expanded keys in the collection (controlled).
defaultExpandedKeysIterable<Key>-The initial expanded keys in the collection (uncontrolled).
selectionBehaviorSelectionBehavior'toggle'How multiple selection should behave in the collection.
disabledBehaviorDisabledBehavior'all'Whether `disabledKeys` applies to all interactions, or only selection.
dragAndDropHooksDragAndDropHooks-The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the Table.
verticalAlign"top" | "middle"-The vertical alignment of the table cells content.
classNamestring-

Events

PropertyTypeDefaultDescription
onClickMouseEventHandler<HTMLDivElement>-
onClickCaptureMouseEventHandler<HTMLDivElement>-
onAuxClickMouseEventHandler<HTMLDivElement>-
onAuxClickCaptureMouseEventHandler<HTMLDivElement>-
onContextMenuMouseEventHandler<HTMLDivElement>-
onContextMenuCaptureMouseEventHandler<HTMLDivElement>-
onDoubleClickMouseEventHandler<HTMLDivElement>-
onDoubleClickCaptureMouseEventHandler<HTMLDivElement>-
onMouseDownMouseEventHandler<HTMLDivElement>-
onMouseDownCaptureMouseEventHandler<HTMLDivElement>-
onMouseEnterMouseEventHandler<HTMLDivElement>-
onMouseLeaveMouseEventHandler<HTMLDivElement>-
onMouseMoveMouseEventHandler<HTMLDivElement>-
onMouseMoveCaptureMouseEventHandler<HTMLDivElement>-
onMouseOutMouseEventHandler<HTMLDivElement>-
onMouseOutCaptureMouseEventHandler<HTMLDivElement>-
onMouseOverMouseEventHandler<HTMLDivElement>-
onMouseOverCaptureMouseEventHandler<HTMLDivElement>-
onMouseUpMouseEventHandler<HTMLDivElement>-
onMouseUpCaptureMouseEventHandler<HTMLDivElement>-
onTouchCancelTouchEventHandler<HTMLDivElement>-
onTouchCancelCaptureTouchEventHandler<HTMLDivElement>-
onTouchEndTouchEventHandler<HTMLDivElement>-
onTouchEndCaptureTouchEventHandler<HTMLDivElement>-
onTouchMoveTouchEventHandler<HTMLDivElement>-
onTouchMoveCaptureTouchEventHandler<HTMLDivElement>-
onTouchStartTouchEventHandler<HTMLDivElement>-
onTouchStartCaptureTouchEventHandler<HTMLDivElement>-
onPointerDownPointerEventHandler<HTMLDivElement>-
onPointerDownCapturePointerEventHandler<HTMLDivElement>-
onPointerMovePointerEventHandler<HTMLDivElement>-
onPointerMoveCapturePointerEventHandler<HTMLDivElement>-
onPointerUpPointerEventHandler<HTMLDivElement>-
onPointerUpCapturePointerEventHandler<HTMLDivElement>-
onPointerCancelPointerEventHandler<HTMLDivElement>-
onPointerCancelCapturePointerEventHandler<HTMLDivElement>-
onPointerEnterPointerEventHandler<HTMLDivElement>-
onPointerLeavePointerEventHandler<HTMLDivElement>-
onPointerOverPointerEventHandler<HTMLDivElement>-
onPointerOverCapturePointerEventHandler<HTMLDivElement>-
onPointerOutPointerEventHandler<HTMLDivElement>-
onPointerOutCapturePointerEventHandler<HTMLDivElement>-
onGotPointerCapturePointerEventHandler<HTMLDivElement>-
onGotPointerCaptureCapturePointerEventHandler<HTMLDivElement>-
onLostPointerCapturePointerEventHandler<HTMLDivElement>-
onLostPointerCaptureCapturePointerEventHandler<HTMLDivElement>-
onScrollUIEventHandler<HTMLDivElement>-
onScrollCaptureUIEventHandler<HTMLDivElement>-
onWheelWheelEventHandler<HTMLDivElement>-
onWheelCaptureWheelEventHandler<HTMLDivElement>-
onAnimationStartAnimationEventHandler<HTMLDivElement>-
onAnimationStartCaptureAnimationEventHandler<HTMLDivElement>-
onAnimationEndAnimationEventHandler<HTMLDivElement>-
onAnimationEndCaptureAnimationEventHandler<HTMLDivElement>-
onAnimationIterationAnimationEventHandler<HTMLDivElement>-
onAnimationIterationCaptureAnimationEventHandler<HTMLDivElement>-
onTransitionCancelTransitionEventHandler<HTMLDivElement>-
onTransitionCancelCaptureTransitionEventHandler<HTMLDivElement>-
onTransitionEndTransitionEventHandler<HTMLDivElement>-
onTransitionEndCaptureTransitionEventHandler<HTMLDivElement>-
onTransitionRunTransitionEventHandler<HTMLDivElement>-
onTransitionRunCaptureTransitionEventHandler<HTMLDivElement>-
onTransitionStartTransitionEventHandler<HTMLDivElement>-
onTransitionStartCaptureTransitionEventHandler<HTMLDivElement>-
onSelectionChange((keys: Selection) => void)-Handler that is called when the selection changes.
onSortChange((descriptor: SortDescriptor) => any)-Handler that is called when the sorted column or direction changes.
onExpandedChange((keys: Set<Key>) => any)-Handler that is called when items are expanded or collapsed.
onRowAction((key: Key) => void)-Handler that is called when a user performs an action on the row.

Accessibility

PropertyTypeDefaultDescription
aria-labelstring-Defines a string value that labels the current element.
aria-labelledbystring-Identifies the element (or elements) that labels the current element.
aria-describedbystring-Identifies the element (or elements) that describes the object.
aria-detailsstring-Identifies the element (or elements) that provide a detailed, extended description for the object.

Auf dieser Seite