The SAP Fundamental Styles library is a design system and HTML/CSS component library used to build modern product user experiences with the SAP look and feel.
See Component Documentation for examples and API details.
You will need to install Node and Node Package Manager.
Fundamental React requires a polyfill for:
You will need to add your own polyfills. See core-js for instructions.
For an existing react application, follow the steps below:
fundamental-react.npm install fundamental-react
All components are currently packaged together with their respective
css, you will need to edit your webpack configuration to handle these files. See css-loader.
Import components as needed. See Component Documentation for examples and API details.;
NOTE: Importing from specific component is recommended. Doing so will bring in only the component you are using instead of the whole library, which will reduce your bundle size significantly.
This project does not contain fonts and icons - they must be added to your project separately. Download Font 72 and SAP icons. After adding fonts and icons to your project, include the following in your css:
Additionally, edit your webpack configuration to load font and icon fonts - see file-loader.
fundamental-react library follows Semantic Versioning. These components strictly adhere to the
[MAJOR].[MINOR].[PATCH] numbering system (also known as
Merges to the
master branch will be published as a prerelease. Prereleases will include an rc version (e.g.
The following circumstances will be considered a BREAKING change:
- A component’s existing API is altered (with the exception of additions)
- The existing underlying HTML markup of a component is altered
- An existing unit test is altered to account for either of the above
The following circumstances will NOT be considered a BREAKING change:
- Additions to a component’s API
- Non-visual HTML attribute changes/additions (such as
- An existing unit test is altered to account for non-visual HTML attribute changes/additions (such as
This library supports css-modules. The motivation for this support is to be able to include multiple versions or instances of fundamental styles on the same page without collisions in styles. This can be useful if you have a page using fundamental-ngx alongside fundamental-react, for example.
One way to use fundamental-react with hashed class names is to pass the library code through css-loader in your webpack config
// If you have an existing css ruletest: /.css$/exclude:/node_modules\/fundamental-styles/use:'style-loader''css-loader'// run css-loader with modules enabled for css files from fundamental-stylestest: /.css$/include:/node_modules\/fundamental-styles/use:'style-loader'loader: 'css-loader'options:modules:localIdentName: '[local]-[sha1:hash:hex:6]'
It's important to include
[local] in the localIdentName which keeps the class name in the hash. This is because some of the style rules in fundamental-styles reference the name of the class, like
Please see Issues.
If you encounter an issue or want to request a feature, you can create an issue.