@carbon/react
Version:
React components for the Carbon Design System
41 lines (39 loc) • 1.21 kB
JavaScript
/**
* 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/Row.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.
*/
function Row({ as: BaseComponent = "div", condensed = false, narrow = false, className: containerClassName, children, ...rest }) {
const prefix = usePrefix();
return /* @__PURE__ */ jsx(BaseComponent, {
className: classNames(containerClassName, {
[`${prefix}--row`]: true,
[`${prefix}--row--condensed`]: condensed,
[`${prefix}--row--narrow`]: narrow
}),
...rest,
children
});
}
Row.propTypes = {
as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
children: PropTypes.node,
className: PropTypes.string,
condensed: PropTypes.bool,
narrow: PropTypes.bool
};
//#endregion
export { Row as default };