Components
A component is the basic building block of Uniform's composition capabilities. You create and manage components using Uniform Canvas.
Create a component
In Uniform, open your project.
Navigate to the Canvas tab.
In the left menu, click Component Library.
Click the red (+) button.
Enter the following values:
Field Description Component Name Name that describes the component or its purpose. Public ID Name that uniquely identifies the component. This value is available to developers. Component Icon Icon that is displayed next to the component within Uniform. This helps users immediately identify components. Title Parameter When Uniform shows users a visual representation of a composition, it shows the slots in the composition and the components in each slot. This setting identifies a parameter whose value is displayed along with the name of the component.
This is useful when a slot has a number of components of the same type. This screenshot shows a component named "Landing Page" with a slot named "Events". Within that slot are 3 "Event" components. The title property value for each event component is displayed next to the component name.
Composition component If this is ticked, the component can be used to create a composition. Click Save.
About this stepThe Save and close button is a dropdown. In the dropdown options you will find the Save button.
Compositions
A composition represents some sort of digital experience. If you think of a component as a model or blueprint to build something specific, a composition is that "something specific".
Create a composition
In Canvas, in the left menu, click Compositions.
Click the red (+) button.
Click the composition type.
About this stepThe composition types that are listed at the components from the component library that are marked as "composition components".
Enter a name for the composition.
About this stepThe name is just a label for the composition. It does not how the composition is used in any way (e.g. if the composition represents a web page, the composition name does not become the URL for the web page).
Click Create.
Enter a value for the field Slug.
About this stepThe slug is a value that can be used in your application to retrieve the composition. When a composition represents a page in a web site, it is common for the slug to match the URI for the page so the front-end application. This allows the front-end application to use the current URL to determine which composition it needs without having to hard-code the value.
Click Save.
About this stepThe composition will not be available to a front-end application until the composition is published. In addition, before any changes to the composition are available to the front-end application, the composition must be re-published.
Delete a composition
- In Canvas, in the left menu, click Compositions.
- Find the composition you want to delete and click ... > Delete.
Duplicate a composition
When you duplicate a composition, you create a new composition with all the same settings as the original composition, with the following exceptions:
- The composition name gets " (Copy)" added to the end.
- The slug gets "-copy" added to the end.
- The composition state is set to "draft".
The following steps describe how to duplicate a composition.
- In Canvas, in the left menu, click Compositions.
- Find the composition you want to delete and click ... > Duplicate.
Parameters
A parameter lets you set a value on a component. Each parameter has a type. The parameter type determines the kind of value you can set for the parameter.
Add a parameter
In the Component Library, select your component.
Click the tab Parameters.
Click the red (+) button.
Enter the following values:
Field Description Parameter Name Name that describes the parameter or its purpose. Public ID Name that uniquely identifies the parameter. This value is available to developers. Help Text A user is responsible for setting a value on the parameter. This text appears below the user-interface available for setting the parameter value.
The user interface for setting the value on a text parameter with help text set to "Enter a short description of the event."Type Determines the type of user interface presented to the user for setting the parameter value. Based on the type you select, additional settings may be displayed. For details on the default parameter types, see the parameter type reference. Click OK to save your changes.
Click Save to save the changes to the component.
Delete a parameter
In the Component Library, select your component.
Click the tab Parameters.
Click ... > Delete.
Click Save to save the changes to the component.
About this stepIf the deleted parameter was used in any composition, when you
select the component in a composition you will see a warning
about "orphan parameter data". This tells you that Uniform is storing a value for a parameter that is not defined in the component. You must remove this value before you are able to save any changes to the composition.Click Remove orphan parameter data to remove this value from the composition.
Slots
A slot lets you associate components with another component.
Add a slot
In the Component Library, select your component.
Click the tab Slots.
Click the red (+) button.
Enter the following values:
Field Description Slot Name Name that describes the slot or its purpose. Public ID Name that uniquely identifies the slot. This value is available to developers. Minimum The minimum number of components that must be added to the slot before a composition with the slot can be saved. If no number is specified, the slot can be empty. Maximum The maximum number of components that can be added to the slot in order for a composition with the slot can be saved. If no number is specified, an unlimited number of components can be added to the slot. Allowed Components - Specify allowed components: Only the selected components can be added to the slot. At least one component type must be selected.
- Inherit allowed components from parent slot: The components that can be added to the slot depend on the components allowed in the slot the component with the slot is in.
Click OK to save the new slot.
Click Save to save the changes to the component.
Remove a slot
In the Component Library, select your component.
Click the tab Slots.
Click ... > Delete.
Click Save to save the changes to the component.
About this stepIf the deleted slot was used in any composition, when you select the component in a composition you will see a warning about "orphan slot data". This tells you that Uniform is storing a value for a slot that is not defined in the component. You must remove this value before you are able to save any changes to the composition.
Click Remove orphan slot data to remove this value from the composition.
Variants
A variant lets you associate components with another component.
Add a variant
In the Component Library, select your component.
Click the tab Variants.
Click the red (+) button.
Enter the following values:
Field Description Variant Name Name that describes the variant or its purpose. Public ID Name that uniquely identifies variant slot. This value is available to developers. Click Save to save the new variant.
Click Save to save the changes to the component.
Remove a variant
In the Component Library, select your component.
Click the tab Variants.
Click ... > Delete.
Click Save to save the changes to the component.
About this stepIf the deleted variant was used in any composition, when you open
the component you will see an error message next to component
that uses the variant. This tells you that Uniform is storing a value for a variant that is not defined in the component. You must remove this value before you are able to save any changes to the composition.You must select the component and change the variant to Default.