Component properties
Component properties provide a way to customize individual UI components added to a view. Select a UI component in the view tree or on the canvas to display the component properties. The properties pane is split into four sections:
When a responsive strategy has been selected you can override component properties at different breakpoints.
Component properties
Component properties provide general configuration options for the component. They are primarily specific to the component and described for each component under UI components.
There are also some general properties applicable to all or many components. The Visible, Read Only, and Disabled properties are boolean properties. Boolean properties can be bound to a property, condition, or function, and can also be explicitly set to true
or false
. Explicitly setting a value can be a useful tool during development.
Property | Description |
---|---|
Name | Displayed in the view tree and on the canvas when the component is selected. By default the name is set to the name of the UI component.
The name can also be changed by selecting the component and pressing |
Visible | Display the component. Defaults to true. If explicitly set to false, the component will not be shown on the cavas and will be marked with an icon in the view tree. |
Read Only | Available for data input components.
If true, the user cannot edit the input. A |
Disabled | Available for data input components.
If true, the user cannot edit or focus the input. A |
Good to know
What's the difference between Read Only and Disabled?
A read-only component looks like a fully-functional component, it is focusable and the value can be selected. A disabled component is visually distinct, is not focusable, and the value is not able to be selected.
Style properties
Style properties allow you to customize the appearance of a component. These properties are translated to corresponding CSS properties when the app is loaded. The exact properties available for a component are dependent on the component's type.
Best practice
To keep your UI consistent and maintainable try to avoid overriding too many values that are set in the theme, such as font styles.
Units
For property values that have a unit, the default is pixels (px). To change the unit, click on the unit name next to the property value to open a drop down with a list of options. The available units will depend on the property, but they include:
px
%
em
rem
vh
vw
auto
–
(unitless)
Linked values
Some properties that accept multiple values, such as Margin, Padding, and Border, can be set once and applied to all other values. This can be identified by the link icon. Click the link icon to link the values and enter a single value in the remaining editable field.
Typography
Override any default typography values or properties set under Component properties.
Property | Description |
---|---|
Font Family | Set a font family added to the active theme. |
Font Weight | Set the weight (boldness) of the font. The weights available depend on the active Font Family. |
Color | Set a color from the active theme. |
Size | Set the size of the font. |
Line Height | Set the height of a line of text. Often used to set the distance between multiple lines of text. |
Letter Spacing | Set the horizontal spacing between each character. Can be positive or negative. |
Text Align | Set the horizontal alignment of the text inside its container.
|
Style | Set the font style.
|
Decoration | Apply decorative lines to the text.
|
Transform | Set capitalization of the text. Note: This property only affects the display of the text and not the value in the data source.
|
Text Orientation | Set the orientation of the text in a line.
|
White Space | Specify how white space and line breaks are treated. To preserve line breaks in your text, choose a
|
Overflow Wrap | Specify whether line breaks should be inserted within otherwise unbreakable text to prevent text from overflowing its parent container. Unlike Word Break, a break will only be created if an entire word cannot be placed on its own line without overflowing.
|
Word Break | Specify whether line breaks appear wherever the text would otherwise overflow its parent container. Overflow Wrap should be preferred over Word Break in most cases.
|
Flex child
Available when a component is a child of a component with the Display property set to Flex.
Property | Description |
---|---|
Alignment | Override the value set for Align Items in the parent component to align the item in the cross axis. |
Sizing | Specify how the component will grow or shrink according to the space available in the parent component.
|
Layout
Control how the component behaves in the flow layout and the layout of its children. For a guide to building Flex
layouts, see How to use Flexbox.
Property | Description |
---|---|
Display | Specify how a component behaves in the flow layout.
|
Flex
Property | Description |
---|---|
Layout Direction | Specify the axis and direction for the placement of child components.
|
Justify Content | Control how space is distributed between and around child components along the main axis.
|
Align Items | Control how child components are aligned in the cross axis (the opposite of the main axis).
|
Child Wrap | Control if child components can wrap and if so, how.
|
Spacing
Control the empty space around the outside of a component (margin) and between the edge of the component and it's contents (padding).
Property | Description |
---|---|
Margin | Specify the empty space to the top, right, bottom, and left of a component. |
Padding | Specify the empty space to the top, right, bottom, and left between the edge of the component (the inside of the border, if present) and the contents of the component. |
Size
Control the size of a component. All of these properties default to auto
which leaves it up to the browser to calculate and set a value.
Property | Description |
---|---|
Width | Set the width of the component. This value can be data bound or set by a function. |
Min Width | Set a minimum width for the component. This value will be used as the width of the component if it is larger than Max Width or Width. |
Max Width | Set a maximum width for the component. This value will be used as the width of the component if is smaller than Width. |
Height | Set the height of the component. This value can be data bound or set by a function. |
Min Height | Set a minimum height for the component. This value will be used as the height of the component if it is larger than Max Height or Height. |
Max Height | Set a maximum height for the component. This value will be used as the height of the component if is smaller than Height. |
Overflow
Control the behavior of content that exceeds the size of it's containing component.
Property | Description |
---|---|
Horizontal | Apply decorative lines to the text.
|
Vertical | As for horizontal, but along the opposite axis. |
Positioning
Property | Description |
---|---|
Position | Specify how a component should be positioned in the layout. All of the options are
|
Offset | Specify the top, right, bottom, and left position of a component. Often used in conjunction with Position |
Z-index | Set the order of the component when stacked with other components. A higher number will place a component higher in the stack. Overlapping components with a larger z-index cover those with a smaller one. |
Input typography
Available for Text edit and Rich text editor.
Style the text value of a component.
Property | Description |
---|---|
Variant | Apply a typography variant from the active theme. |
Font Family | Set a font family added to the active theme. |
Font Weight | Set the weight (boldness) of the font. The weights available depend on the active Font Family. |
Color | Assign a color from the active theme. |
Size | Set the size of the font. |
Text Align | Set the horizontal alignment of the text.
|
Style | Set the font style to either |
Decoration | Apply decorative lines to the text.
|
Transform | Specify capitalization of the text. Note: This property only affects the display of the text and not the value in the data source.
|
Background
Available for Containers.
Add a simple background color or add one or more background layers to a container.
Property | Description |
---|---|
Backgrounds | Add one or more background layers. |
Background Color | Assign a color from the active theme. |
Color | Assign a default color from the active theme for the content in the container. |
Multiple background layers are placed on top of each other with the first background in the list on top. Drag and drop a background to rearrange it in the order. A background can be an image, a linear gradient, a radial gradient, or a color overlay.
Image
Property | Description |
---|---|
Image | The image file to apply as the background. |
Size | How the image should be sized.
|
Position | The initial position of the image relative to the container. |
Repeat | Tile the image within the container. The tiling will be based around the Position value.
|
Linear gradient
A linear gradient creates a band of colors that progress in a straight line. For more information on linear gradients see Using CSS gradients on MDN.
Property | Description |
---|---|
Angle | The direction in which the gradient runs, in degrees. Defaults to 180 which is from top to bottom. |
Color Stops | Edit and add color stops to determine the colors in the gradient. Defaults to two stops from solid black to transparent. To edit an existing stop, click it to change the color and opacity. Drag the stop along the bar to change its position. To add a new stop, click an empty space along the bar. |
Radial gradient
A radial gradient creates a band of colors that radiate out from a central point. For more information on linear gradients see Using CSS gradients on MDN.
Property | Description |
---|---|
Color Stops | Edit and add color stops to determine the colors in the gradient. Defaults to two stops from solid black to transparent. To edit an existing stop, click it to change the color and opacity. Drag the stop along the bar to change its position. To add a new stop, click an empty space along the bar. |
Color overlay
A uniform color that covers the entire container.
Property | Description |
---|---|
Overlay Color | Assign a color from the active theme or create a custom color in the color picker. |
Borders
Add a border to one or more edges of the component.
Good to know
If content within a component with a Border Radius flows outside the edge of the border, consider setting Overflow to Hidden
on the containing component.
Property | Description |
---|---|
Border | The width of the border. |
Color and Style | Assign a color from the active theme (Divider is recommended) and set a border style.
|
Border Radius | Round the corners of the border. |
Use Border Radius from Theme | Apply the border radius from the active theme. |
Outline
Add a line outside of the component's border. Unlike borders, outlines don't take up space and affect the layout of the view.
Outline is often used to make apps more accessible for users navigating with the keyboard. It can be used to indicate focus on an component in conjunction with the Focus Visible
event in Conditional styles. For example, it can be used on containers with an On Click event.
Property | Description |
---|---|
Style | The style of the outline.
|
Color | Assign a color from the default theme. |
Width | The thickness of the outline. Defaults to a value that is usually equivalent to 3 px in desktop browsers. |
Offset | The space between the outline and the edge or border of the component. |
d
Custom color
Available for Icon button, Icon and Avatar.
Property | Description |
---|---|
Color/Icon Color | Assign an icon color from the default theme. |
Background Color | Assign a background color for avatars from the default theme. |
Effects and transitions
Property | Description |
---|---|
Opacity | The degree to which content behind a component is hidden. The opposite of transparency. Defaults to 100%. |
Transitions | Add transitions to create smooth animations between styling values. |
Transforms | Add transforms to visually manipulate a component by skewing, rotating, moving, or scaling. |
Transitions
With a transition you can control the speed of the animation as styling values change, such as when conditional styles are applied. For more background information on how transitions work see Using CSS transitions on MDN.
Property | Description |
---|---|
Property | The style property to apply the transition to. Defaults to |
Duration | The length of the animation. Defaults to
|
Timing | The acceleration curve for the animation. Defaults to
|
Delay | The length of time to wait after the property is changed before starting the animation. Defaults to
|
Transforms
Transforms change the position and shape of a component. For more background information on how transforms work see Using CSS transforms on MDN.
Property | Description |
---|---|
Type | The transform to apply.
|
Rotate | Available for Type Rotate. The number of degrees to rotate the component. |
Scale | Available for Type Scale.
The ratio to scale the component. For example, a value of |
Move X | Available for Type Move. The number of pixels to move the component along the X-axis. Use negative values to move to the left of the origin. |
Move Y | Available for Type Move. The number of pixels to move the component along the Y-axis. Use negative values to move to above the origin. |
Conditional style properties
A conditional style overrides one or more style properties on a component based on an event, a condition, or a combination. For example, you can change the elevation of a container on hover, or change the color of text based on the value of a status property.
Multiple conditional styles can be added to a component and they will be applied in the order they are listed in Appfarm Create, from top to bottom. When a conditional style is expanded, the changes that would be applied will be previewed on the canvas.
Property | Description |
---|---|
Name | Set a descriptive name for the conditional style. |
Event | Optional. Apply the Style Overrides when this event occurs and Enabled is
|
Enabled | A boolean property that determines if the conditional style should be applied. This value must be true for a style to be applied.
If an Event is chosen, this defaults to |
Style Overrides | Add one or more style overrides. The styles that can be overridden are determined by the component type. |
Examples
You have a Container component and you'd like to change the background color on hover.
Select the container and add a new conditional style:
Event:
Hover
Style Overrides:
Background Color = Secondary
Motion properties
A motion is a transition that can be applied to animate a component. Only one motion per component is supported. A component with a motion is marked with an icon in the view tree. Motions are most commonly applied to containers.
When a motion is added to a component, the component will be displayed on the canvas, but will not be displayed in the app until the Motion In property is true
. When that occurs, the animation will run and the component will be displayed. The exception is for Rotate motions, which are always visible.
For example, you can add a Collapse
motion on a container, and create a condition on Motion In that determines when the container should be animated into view.
As opposed to conditional styles, where you can create custom transitions and transforms to animate a component between styling properties, motions are made with pre-defined transitions.
Property | Description |
---|---|
Type | The type of transition to perform:
|
Motion In | The component will become visible when this value is |
Keep Mounted | Available when Type is Collapse. Hide content instead of removing it when Motion In is
Use cases:
|
Rotate Degrees | Available when Type is Rotate. The number of degrees to rotate the component. |
Direction | Available when Type is Slide.
The direction in which the component should slide, either |
Last updated