This module provides a React implementation for the AEM core components. This enables you to use the core components: -In the AEM SPA editor with React -Or in any other React context, provided you have the input needed to instantiate the components.
Current supported / exported components:
- Button
- Download
- Embed
- Image
- List
- Separator
- Teaser
- Text
- Title
- Breadcrumb
- Language Navigation
- Navigation
For the containers (Accordion, Tabs, Carousel, and Container) we do not provide any implementation in this project. It does not make sense to provide it for web-components as you can leverage the normal Core Components implementation such as a Tab Container, and drag your web components in there. Instead, we provide them for the SPA editor only, introducing a dependency, and therefore we moved it into a separate project "aem-react-core-wcm-components-spa".
You can choose to import the entire library at once OR import components individually. The latter is useful if you want to only enable a few components, and you want to save your javascript footprint.
import * as BaseCoreComponents from "aem-react-core-wcm-components-base";
const { CoreBreadCrumb, CoreImage } = BaseCoreComponents;
import { CoreBreadCrumb, CoreImage } from "aem-react-core-wcm-components-base";
Now that you have the CoreBreadCrumb and CoreImage imported, you can use them in your project. The properties of the Button 1 on 1 correspond to the Sling Model Exporter (.model.json) output.
Note: There are some exceptions where some extra properties are added (mainly i18n labels) that are currently not present in the OOTB sling model exports. These can be added by the project itself with delegation. If they are not present, the default (English) values will be used.
import { CoreImage, ImageEditConfig } from 'aem-react-core-wcm-components-base';
MapTo('my-project/components/image')(
CoreImage,
ImageEditConfig
);