@heroui/divider
Version:
. A separator is a visual divider between two groups of content
26 lines (24 loc) • 567 B
JavaScript
// src/use-separator.ts
import { filterDOMProps } from "@heroui/react-rsc-utils";
function useSeparator(props) {
let domProps = filterDOMProps(props, {
enabled: typeof props.elementType === "string"
});
let ariaOrientation;
if (props.orientation === "vertical") {
ariaOrientation = "vertical";
}
if (props.elementType !== "hr") {
return {
separatorProps: {
...domProps,
role: "separator",
"aria-orientation": ariaOrientation
}
};
}
return { separatorProps: domProps };
}
export {
useSeparator
};