UNPKG

@carbon/react

Version:

React components for the Carbon Design System

40 lines (38 loc) 1.24 kB
/** * Copyright IBM Corp. 2016, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { usePrefix } from "../../internal/usePrefix.js"; import classNames from "classnames"; import "react"; import PropTypes from "prop-types"; import { jsx } from "react/jsx-runtime"; //#region src/components/Grid/ColumnHang.tsx /** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ /** * Helper component for rendering content that hangs on the column. Useful when * trying to align content across different gutter modes */ function ColumnHang({ as: BaseComponent = "div", className: customClassName, children, ...rest }) { const className = classNames(customClassName, `${usePrefix()}--grid-column-hang`); return /* @__PURE__ */ jsx(BaseComponent, { ...rest, className, children }); } ColumnHang.propTypes = { as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]), children: PropTypes.node, className: PropTypes.string }; const ColumnHangComponent = ColumnHang; //#endregion export { ColumnHangComponent };