Freeform and Layout content
By default, Rive content is freeform. Each object has a position, rotation, and scale, and stays exactly where you put it. When the artboard changes size, freeform content doesn’t move. A Layout is a container that positions and sizes its content using rules instead of fixed coordinates. Rive’s Layouts work much like Flexbox and CSS Grid on the web: a Layout can arrange its children in a row, a column, a grid, or a stack, with padding, gaps, and alignment. You don’t have to choose between freeform and Layout content. You decide which objects follow Layout rules, and you can mix both in the same artboard, or even inside the same Layout.How Layouts work
Responsive design in Rive comes down to a few ideas. Once these click, the rest of the Layout settings are details.The artboard is the root Layout
The artboard itself is a Layout. It has its own Layout settings in the Inspector, and the Layouts you add inside it respond to its size. When the artboard resizes, that change flows down through every Layout inside it.Layouts nest inside other Layouts
Most responsive designs are built from Layouts inside other Layouts. The outer Layout is the parent, and the Layouts inside it are its children. Each level handles one part of the design, such as a page made of rows, rows made of cards, and cards made of an image and a label.
Parents arrange, children size themselves
Layout settings split into two groups, and knowing which group a setting belongs to makes Layouts much easier to work with:- The parent arranges its children. Direction (row, column, grid, or stack), wrapping, alignment, padding, and gap are set on the parent and control where its children go.
- Each child sets its own size. Width, height, and margin are set on the child.
- Fixed: A set size, in points or as a percentage of the parent.
- Hug: Shrinks to fit the child’s own content, such as a label that’s as wide as its text.
- Fill: Expands to take up the available space in the parent. When several children use Fill, they share the space.
Absolute and relative positioning
A Layout child is positioned in one of two ways:- Relative: The parent decides where the child goes, based on its direction, alignment, and gap. Relative children reflow when the parent changes size or when other children are added or removed.
- Absolute: The child ignores the parent’s arrangement and pins itself to the parent’s edges instead, such as 16 points from the top and right. Absolute children don’t affect the position of their siblings.

What takes part in a Layout
A Layout arranges only the children that participate in it. Other content inside a Layout moves with the Layout but isn’t arranged in its rows, columns, or grid.
Text, images, and parametric shapes (rectangles, ellipses, triangles, polygons, and stars) that sit directly inside a Layout without participating are resized to fill that Layout. This is why many designs wrap each piece of content in its own Layout: the outer Layout arranges the wrappers, and each wrapper sizes its content.
For artwork that needs to resize without distorting, such as a custom-drawn button background, see N-Slicing.
Breaking out of a Layout
Objects inside a Layout can still use Rive’s freeform tools. You can move, scale, and rotate an object away from where the Layout put it, and you can apply constraints to it. This is useful for animation. For example, a list item can sit in its Layout position until it’s selected, then animate out to the center of the screen.Previewing responsive behavior
To see how your design responds, resize the artboard on the stage and watch your Layouts adjust. Try very narrow and very wide sizes to find where the design breaks.Responsive graphics at runtime
At runtime, the artboard is drawn into a container that’s sized by your app or game. To make the artboard take the size of that container, set the runtime’s fit mode to Layout. See Artboard size at runtime for how each fit mode behaves, and Runtime layout for how to set it on each platform.Learning more
- Creating Layouts: Create Layouts and wrap existing content in them.
- Sizing and Positioning: Set a child’s width and height, margin, and absolute position.
- Arranging Children: Set a parent’s direction, alignment, padding, and gap.
- Grid and Stack: Arrange children in cells or layer them on top of each other.
- Component Sizing: Control how component instances respond to their parent Layout.
- Scrolling: Let content scroll when it doesn’t fit.
- Layout Animation: Animate children as they move to new positions.
- N-Slicing: Resize artwork without distorting its corners and edges.
See the Layouts playlist on Rive’s YouTube channel for more Layout tutorials.
