Symbols are a type of Section model you can integrate for editing on your site or app. They help you elegantly reuse content across many Builder Pages and Sections. For more information, see Intro to Symbols.
To get the most out of this document, you should have:
Create a special page on your site specifically for Symbol editing. This is what the Builder preview opens when you create and edit symbols. It's important this be on a URL directly on your site, so all previewing and editing are accurate.
In this example, this page is named /edit-symbol
.
Create a page with the following contents. Make sure to replace YOUR_API_KEY
with your Public API Key:
// pages/edit-symbol.jsx
import { BuilderComponent, builder } from '@builder.io/react';
// Replace with your Public API Key.
builder.init(YOUR_API_KEY);
export default function Page() {
return <BuilderComponent model="symbol" />
}
BuilderComponent
gives the drag and drop Visual Editor a region to work in in your site.
Note that if you have registered custom components, you must import them on this page so that they are available in the Visual Editor.
For instructions on getting your Public API Key, see Finding Your Public API Key in Using Builder API Keys.
- Go to Models and choose the Symbol model. If you don't have Symbol here, make sure that you've met the prerequisite of having created a Symbol. For step-by-step instructions, read Making a Symbol.
- Enter your site domain at a specifc path, such as
/edit-symbol
, for examplehttps://my-site.com/edit-symbol
. - Click Save.
You can use localhost
when testing locally, then change to a hosted URL like your QA or production URL once your code updates have been deployed.
For more examples of what you can do with Builder, check out the Blueprints, which cover varied use cases at a high-level with code examples.