@heroui/table
Version:
Tables are used to display tabular data using rows and columns.
33 lines (30 loc) • 1.03 kB
JavaScript
"use client";
// src/table-row-group.tsx
import { forwardRef } from "react";
import { useDOMRef } from "@heroui/react-utils";
import { mergeProps } from "@heroui/shared-utils";
import { useTableRowGroup } from "@react-aria/table";
import { cn } from "@heroui/theme";
import { jsx } from "react/jsx-runtime";
var TableRowGroup = forwardRef((props, ref) => {
var _a;
const { as, className, children, slots, classNames, ...otherProps } = props;
const Component = as || "thead";
const domRef = useDOMRef(ref);
const { rowGroupProps } = useTableRowGroup();
const theadStyles = cn(classNames == null ? void 0 : classNames.thead, className);
return /* @__PURE__ */ jsx(
Component,
{
ref: domRef,
className: (_a = slots.thead) == null ? void 0 : _a.call(slots, { class: theadStyles }),
...mergeProps(rowGroupProps, otherProps),
children
}
);
});
TableRowGroup.displayName = "HeroUI.TableRowGroup";
var table_row_group_default = TableRowGroup;
export {
table_row_group_default
};