Anchor
The object for anchoring one component to another component in your article’s layout.
Declaration
object AnchorProperties
| Name | Type | Description |
|---|---|---|
targetAnchorPosition Required | string | Sets the anchor point in the target component, relative to the
If a component is anchored to a range of text in a body component and is full-width (such as iPhone), the following rules determine the spacing before and after the anchored component:
Note the following:
Example: To align the bottom of a component with the bottom of another component, set both |
originAnchorPosition | string | Sets which point in the origin component gets anchored to the target component. The originating anchor is positioned as closely as possible to the intended |
rangeLength | integer | The length of the range of text the component is anchored to. If you specify Maximum value: ( The length of a text range can’t exceed the length of the text. |
rangeStart | integer | The start index of the range of text the component is anchored to. When a component is anchored to a component with a If you specify |
target | string | The id or name attribute of an |
targetComponentIdentifier | string | The identifier of the component to anchor to. If a parent component doesn’t exist and you don’t specify the |
Mentioned in
Discussion
Use the Anchor object to anchor one component (called the origin) to another component (called the target). You can use an anchor to align components vertically. For example, you can anchor a caption component to a photo component and choose whether you want the caption aligned to the top, bottom, or center of the photograph. You can also use an anchor to position a child component within its parent container. For information about using anchors within containers, see Nesting Components in an Article.
You can use this object in Component.
Example
{
"components": [
{
"role": "container",
"layout": {
"minimumHeight": 100
},
"style": {
"backgroundColor": "goldenrod"
},
"components": [
{
"role": "title",
"text": "Article Title",
"anchor": {
"targetAnchorPosition": "bottom"
}
}
]
}
]
}