@carbon/react
Version:
React components for the Carbon Design System
41 lines (39 loc) • 1.2 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 { useFeatureFlag } from "../FeatureFlags/index.js";
import { FlexGridComponent } from "./FlexGrid.js";
import { CSSGridComponent } from "./CSSGrid.js";
import "react";
import PropTypes from "prop-types";
import { jsx } from "react/jsx-runtime";
//#region src/components/Grid/Grid.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 Grid(props) {
if (useFeatureFlag("enable-css-grid")) return /* @__PURE__ */ jsx(CSSGridComponent, { ...props });
return /* @__PURE__ */ jsx(FlexGridComponent, { ...props });
}
Grid.propTypes = {
align: PropTypes.oneOf([
"start",
"center",
"end"
]),
as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
children: PropTypes.node,
className: PropTypes.string,
condensed: PropTypes.bool,
fullWidth: PropTypes.bool,
narrow: PropTypes.bool
};
const GridAsGridComponent = Grid;
//#endregion
export { GridAsGridComponent };