What is Granite UI Coral 3 library
What is Granite UI Coral 3 library
The Granite UI Coral 3 library is a part of Adobe Experience Manager (AEM) and provides a set of reusable user interface components based on the Coral 3 framework. The Coral 3 framework is a front-end framework developed by Adobe and is designed to create consistent and accessible user interfaces.
The Granite UI Coral 3 library includes a wide range of UI components such as form fields, buttons, dropdowns, dialogs, tabs, and more. These components are designed to be customizable, responsive, and compliant with accessibility guidelines.
By leveraging the Granite UI Coral 3 library, developers can build AEM components and dialogs with consistent styling and behavior, ensuring a cohesive user experience across different touchpoints within the AEM authoring environment and published websites.
The library provides both server-side and client-side APIs to interact with the components. On the server-side, you define the components using XML or Java code, and on the client-side, you can enhance the components using JavaScript and CSS to add interactivity or customize their appearance.
Overall, the Granite UI Coral 3 library simplifies the development process of AEM components by providing a rich set of ready-to-use UI components, reducing the need for custom CSS and JavaScript, and promoting a standardized and accessible user interface within the AEM ecosystem.
How to use Granite UI Coral 3 library
- Include the Granite UI Coral 3 dependency in your project:
- For Maven-based projects, you can add the following dependency to your pom.xml file:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.models.api</artifactId>
<version>1.3.8</version>
</dependency>
- For non-Maven projects, you can manually download the Granite UI Coral 3 library and include it in your project's classpath.
2. Define Granite UI components in your AEM dialogs and components:
- In your dialog XML files, you can use the granite/ui/components resource type to create various Coral 3 components. For example:
<textfield
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
name="./myTextField"
fieldLabel="Text Field"
value=""/>
- In your AEM components, you can use the Coral Java classes to create Coral 3 components programmatically. For example:
CoralColumn column = new CoralColumn();
column.setSize(CoralColumn.Size.SMALL_12);
column.add(new CoralText("This is a Coral text component."));
Note: The specific usage of components may vary depending on the specific requirements of your project.
3. Apply styling and customization:
The Granite UI Coral 3 library provides default styles for the components. You can customize the appearance and behavior of the components using CSS and JavaScript as needed. For example, you can add your own CSS classes or override default styles in your project's CSS files.
4. Deploy and test your project:
Build and deploy your AEM project to see the Granite UI Coral 3 components in action. You can create content using the AEM authoring environment and verify that the components render correctly and function as expected.
By following these steps, you can effectively use the Granite UI Coral 3 library to create consistent and visually appealing user interfaces within your AEM project, ensuring a seamless authoring and user experience.
Comments
Post a Comment