My Components
Save views you designed as a component, and add them to any of your apps from the Library.
When you've built something you'll want again, like a profile card or a header, save it as a component. It appears under My Components at the top of the Library's Components tab, in every app you make, ready to tap or drag in.
#Save views as a component
- Select the view you want to save. To save several at once, Shift-click them on the canvas or in Layers.
- Tap ⋯ at the top of the Inspector and choose Save as Component… (with several views selected, tap Save as Component in the Inspector). Or press ⇧⌘S.
- In Save as Component, fill in:
- A name, like Profile Card. It starts as the selected view's name.
- What it's for (optional): a line about it. The Library's search looks in it, and VoiceOver reads it on the tile.
- Icon: tap it to open Choose an Icon and pick an SF Symbol for the tile.
- Tap Save. It's available once the component has a name.
A component saves the views with what they need: the variables they're linked to with ⚡︎ or that their steps change, and copies of their images and of the font files you added to this app. That way it works in an app that doesn't have them.
#Use a saved component
Open the Library's Components tab. Your saved components are at the top, under My Components.
- Tap one to add it where a tapped component goes: inside the selected container, after the selected view, or at the end of the page when nothing is selected.
- Drag one onto the canvas, to exactly where you want it.
- Ask the AI Agent for it by name, like "put my Hero Row at the top": it knows your saved components. See The AI Agent.
When you add it, PadCode brings along what it needs:
- Variables it's linked to with ⚡︎, or that its steps change, are added to the app, unless the app already has a variable with that name. Then the component uses the app's own. Variables named only inside a formula,
{braces}or Show when aren't saved with it: add them in Data & Logic. - Images are added to the app's Assets. If the app already has a different image by the same name, the copy gets a new name, and the component's Image shows it.
- Fonts are added to the app's Assets, unless the app already has that font.
#On the Free plan
A saved component can have Pro components inside it, like one from the Marketplace's Liquid Glass kit, with Glass Groups and Mesh Gradients. On Free, its tile has PRO on it. Tapping it adds nothing: a sheet says which Pro components it has, with Pro's plans, and Not Now goes back. It stays in My Components, ready for when you have Pro. A component of Free's 19 essentials, like the shadcn kit, adds as usual.
Copying works the same way: on Free, Paste and Duplicate don't add Pro components, even ones already in an app you got, and say so the same way. Nor does wrapping views in a Pro container, like Group Box, with Wrap in or Group. What's already in your app stays, to change or delete.
The Library's search finds your components by name and by what they're for. Until you've saved one, My Components says: "Reuse your designs in any app. Select views, then choose Save as Component from the ⋯ menu."
#A placed component is a copy
Adding a saved component puts a copy of its views in your app. The copy is yours to change, and changing it doesn't change the saved component or any other copy. Likewise, the saved component never changes copies already placed. PadCode can't update every copy at once.
To change a saved component itself, edit a placed copy, save it again with Save as Component…, and delete the old one.
#Rename, share or delete a saved component
Long-press a component under My Components:
- Rename… asks for a new name. Copies already placed keep their names.
- Share sends it as a
.padcomponentfile, with its images and fonts. Whoever opens it sees it read-only first, then adds it to their own My Components (Open a PadCode file). - Delete removes it from My Components right away, in every app. Copies already placed stay where they are.