Skip to content

Getting Started - Engineers

The CFA Design System offers a complete collection of code libraries needed to build modern, robust, and accessible UI applications. Get started using the following CFA packages in your application.

  • @cfa/react-core
  • @cfa/brand-icons
  • @cfa/system-icons
  • @cfa/design-tokens

Before consuming or contributing to the Design System, you will need to setup Artifactory access. You’ll then need to configure Artifactory with either npm or yarn. The instructions for doing so are in the same wiki and can be found by navigating to the appropriate section.

Important: The CFA Design System packages are scoped under the @cfa namespace. To install packages like @cfa/react-core, your npm configuration must include the scoped registry setting:

@cfa:registry=https://cfa.jfrog.io/artifactory/api/npm/npm/
Terminal window
npm install @cfa/react-core
Terminal window
npm install @cfa/system-icons
npm install @cfa/brand-icons
import { ComponentName } from "@cfa/react-core";
<ComponentName />;
import { ChevronLeft } from "@cfa/system-icons";
const ChevronLeftIcon = <ChevronLeft />;

For React Core styles to render correctly in your app, you must utilize one of the required methods:

You can import the CSS directly into your app, this may vary depending on how CSS imports are resolved in your app.

Generally, this will work in JSX/TSX files.

import "@cfa/react-core/index.css";

If you are using postcss or are using @import rules in your CSS files, the import path may vary depending on your tooling.

/* Next.js */
@import "@cfa/react-core/dist/index.css";
/* PostCSS Import / Vite */
@import "@cfa/react-core/index.css";

You can find additional CSS guides here:

By wrapping your app with the ThemeProvider, the styles from @cfa/react-core/index.css will be applied globally. This component simply imports the CSS file for you.

We do not suggest this approach at this time, and recommend just importing the CSS directly.

import { ThemeProvider } from "@cfa/react-core/theme";
function Layout() {
return (
<ThemeProvider>
<App />
</ThemeProvider>
);
}

React Core utilizes isolation when rendering our overlay components such as Modal, Drawer or Popover. For this to work correctly in some apps, you will need to add a top level CSS property to ensure that the stacking context works correctly.

This example is for demonstration purposes, how you implement this in your app can vary.

<body>
<div className="wrapper">{children}</div>
</body>
.wrapper {
isolation: isolate;
}

If you are using Tailwind, your implementation might look like this.

<body>
<div className="isolate">{children}</div>
</body>

This style creates a separate stacking context for your application root element. This way, popups will always appear above the page contents, and any z-index property in your styles will not interfere with them.

For more information on CSS and styling your App, please refer to these guides: