Updated 26 September 20264 min read
An embed puts a public library on any website you manage. Visitors browse, search and copy its prompts inside your page, without creating an account. The embed is read-only: it shows prompt titles, text and tags, and never your members, invitations or settings.
The embed builder is available to the library's owner and sub-owners, and the library must be public. If it is not, the builder offers to make it public first. That does not list it in Explore; see Publishing a library and listing it.
Get the snippet
- Open the library and click the code button in its header (Embed on a website).
- If the library is private, click Make public & continue.
- Shape the embed with the controls on the right, or Start from a ready-made setup such as Sidebar or Copy picker. The preview is the real embed; Preview at tries other widths.
- On the Script tab, click Copy, and paste the result into your page.
The default layout, Adaptive, fits the space it is given: a list in a narrow column, and the list beside the open prompt when there is room.
The two lines of HTML
<div data-promptcontrol-library="YOUR_LIBRARY_ID"></div>
<script src="https://promptcontrol.cloud/embed.js" async></script>
The first line marks where the library goes. The second loads the embed, sizes it to its content and relays its events to your page. Every option you change in the builder is written into the first line as a data- attribute; anything you leave alone keeps its default. One copy of the script serves every embed on the page, including embeds added later.
To try the snippet before publishing anything, use demo as the library ID; it always shows a small sample library.
If your site does not allow third-party scripts, the Iframe tab gives a plain iframe instead. It has a fixed height and cannot send events. If your site sets a Content Security Policy, allow https://promptcontrol.cloud in script-src and frame-src.
Theme and brand it
- Theme: Auto follows each reader's light or dark setting; Light and Dark fix it.
- Colours: twelve colors, from Accent to Tag text. Any color you leave alone comes from the theme, so Auto keeps working.
- Typeface, Density and Corner radius adjust type, spacing and corners.
- Your branding: a Logo image URL, a Header background image URL with a Wash over it to keep text readable, and a Footer credit with a Footer link in place of the PromptControl credit. Addresses must start with https; anything else is ignored.
In the snippet, colors are hex values without the #:
<div data-promptcontrol-library="YOUR_LIBRARY_ID"
data-theme="auto"
data-accent="4f46e5"
data-logo="https://example.com/logo.svg"
data-footertext="Prompts by Example Capital"
data-footerlink="https://example.com"></div>
To reuse a look, click + Save this look under Your themes: Colours & type keeps the colors, type and branding, and Every setting adds layout and behavior. Saved themes stay on your account, ready for any library you embed.
Ask for an email
Under Ask for an email, choose when readers are asked for an address:
| Option | Readers are asked when they |
|---|---|
| Never | are never asked (the default) |
| To read | open a prompt in full, or copy one |
| To copy | copy a prompt; reading stays open |
The list, titles, search and tags always stay open, and each reader is asked once per library in their browser. You can change the Heading, Sub-line and Button, choose Also ask for a name, and add a Consent line and a Privacy policy URL. The consent line is stored with each address as it read at the time.
Addresses come to you, never to the website hosting the embed: no event carries them. To read them, click the envelope button in the library header (Sign-ups from this library's embed). It lists each address, the name if you asked for one, when it first arrived and the page it came from, with Copy emails and Export CSV. Deleting the library deletes the list. If an address cannot be recorded, the reader still gets the prompt, so a sign-up can occasionally be missed.
Wire its events into your page
Turn on Notify my page (events) under Buttons on a prompt, or set Clicking a prompt to Tells my page. The embed then fires these events on the placeholder div:
| Event | Fired when | detail includes |
|---|---|---|
promptcontrol:ready | the embed has loaded (always sent) | promptCount, tags |
promptcontrol:select | a prompt is opened or picked | prompt |
promptcontrol:copy | a prompt is copied | prompt, ok |
promptcontrol:insert | Insert is clicked | prompt |
promptcontrol:open | Open or View library is clicked | prompt, url |
promptcontrol:search | the search text changes | query |
promptcontrol:filter | a tag filter is chosen or cleared | tag |
promptcontrol:close | an open prompt is closed | — |
prompt holds id, title, content and tags. Every event also carries source: "user" for a reader's action, "host" for one your own code caused.
const el = document.querySelector('[data-promptcontrol-library="YOUR_LIBRARY_ID"]');
el.addEventListener("promptcontrol:insert", (e) => {
myEditor.value = e.detail.prompt.content;
});
el.addEventListener("promptcontrol:ready", () => {
el.promptControl.filter("finance");
});
el.promptControl offers search(text), filter(tag), select(id), reset() and reload(). These calls work whether or not events are on. The Wire it up tab shows a worked example.
Keep it up to date
The snippet never needs editing to stay current: prompts you add, edit or remove reach the embed within a minute or two. An embed shows up to 500 prompts; to show a subset, enter a tag in Only this tag under Scope. Files and missions attached to a prompt appear only if you tick Show in public embeds in that prompt's dataset. If you make the library private, the embed shows "This library is private" in place of the prompts, again within a minute or two.