Skip to content

Code pages ​

A code page is a coin page its creator writes in HTML and CSS instead of arranging tiles, placing apps with a <cd-app> tag. A creator writes one in the coin manager, on the Pro plan and above: Code pages.

The coin's identity ​

Every code page places the coin's identity, once, and keeps it visible above the fold: a visitor should see which coin they are on without scrolling. A page places it with <cd-identity> (the identity alone) or <cd-app app="core-crown-header"> (the whole header, identity included). A draft saves without one, but a page with none, or with more than one, cannot be published.

Where it goes is the page's choice, and its CSS places and sizes the box. We draw what is inside it, in the page's theme, and the page's CSS cannot style or hide it. When a page's identity is not on screen, we show our own identity bar at the top of the page, under the top bar, and it slides away when the page's own identity is back on screen.

How your app shows ​

ModeWhat the page decidesWhat your app keeps
Hosted (every app)Where your app's box is and how big, not under your minimumEverything inside the box
Themed (if your manifest says so)Hosted, plus the page's colors for the tokens you listYour layout, words and behavior

Every app is hosted with nothing to declare: an app that works on a tile works on a code page. A page that asks for an app in a mode the app does not allow gets it hosted.

What a page cannot do to your app ​

These hold on every code page, whatever its creator writes.

  • It cannot shrink your app. A page sizes your box with width, height, grid or flex, but not under your minimum: display.minWidth and minHeight if your manifest has them, else your smallest tile (120 px for each of minColSpan, 60 px for each of minRowSpan plus 10 px between rows).
  • It cannot style the inside of your app. A page's CSS stops at the edge of every app's box. A themed app gets colors only through the tokens it lists.
  • It cannot run code. <script>, <iframe>, <form>, <svg>, on… handlers and inline style are dropped. Links are https, relative or mailto; images are https. In its CSS, @import, @font-face and @layer are dropped and url() is https only; a page's fonts come from our list.
  • It cannot act for your app or the visitor. A page's button can do three things, and each opens our own sheet. A page cannot call your app, ask for a signature or take a payment.
  • It cannot cover the coin page's own controls. Nothing a page draws paints outside the page's box. position: fixed and position: sticky are dropped from its CSS, and z-index works only inside the page, so nothing reaches over the Buy button, the menu or a wallet prompt.

Your app keeps its own sandbox too, as on a tile page: What your app must do.

Declaring themed ​

List the page colors your app takes in presentation.themeTokens:

json
"presentation": { "themeTokens": ["--cd-accent", "--cd-surface", "--cd-text"] }

On a page that shows your app themed, each token you list arrives in the theme your app already gets, as the field; the rest keep the visitor's theme. List only the ones your app reads.

TokenArrives asWhat it colors
--cd-accenttheme.accentColorAccents and buttons
--cd-surfacetheme.cardBackgroundThe card your app sits on
--cd-texttheme.textPrimaryBody text
--cd-text-mutedtheme.textSecondarySecondary text
--cd-bordertheme.borderColorBorders and dividers

No other token can be listed, and an empty list is refused: leave presentation out to be hosted only.

What a page writes ​

For reference: a page uses four tags of ours. Everything else is plain HTML and CSS.

<cd-identity> places the coin's identity. A page has exactly one, or a <cd-app app="core-crown-header"> instead.

densityShows the identity
line (the default)On one line
stackedStacked, for a narrow column

It takes class, id, title, aria-* and data-* for the page's CSS. Like a <cd-app> it is empty: anything a page puts inside it is not shown, and hidden is dropped.

<cd-app> places an installed app.

Attribute
appThe app's id
instanceWhich one, for an app placed more than once
modehosted (the default) or themed
class, id, title, aria-*, data-*As on any element, for the page's CSS

A <cd-app> is empty: your app draws the whole box, and anything a page puts inside it is not shown.

Not the <cd-app> a coin's own site pastes

Two different elements share this name, in two different places, and their rules are opposite.

On a code pageOn a coin's own site
Where it is writtenIn the HTML of a coin page on chaindaddy.io, which we read and drawIn a page of the owner's own site, which loads https://js.chaindaddy.io/v1/cd.js
Attributesapp, instance, mode (hosted or themed)crown, chain, app, mode (light or dark)
What goes inside itNothing: it is not shownA link, which shows until the app is ready and stays if it cannot load
ReferenceCode pagesJavaScript SDK, Apps on your own site

<cd-data bind="…" format="…"> shows a value from the coin's own data, by the names the app SDK uses. A missing value shows —.

bind
symbolThe ticker, such as PEPE
tokenNameThe coin's full name
descriptionThe coin's description
chainNameThe chain, such as Base
tokenAddressThe coin's contract address
ownerThe wallet that holds the page's crown
statusThe crown's status
market.pricePrice in US dollars
market.marketCapMarket cap in US dollars
market.volume24hTrading volume over 24 hours, in US dollars
market.liquidityLiquidity in US dollars
market.holdersHow many wallets hold it
market.totalSupplyTotal supply
market.circulatingSupplyCirculating supply
market.txns24hTrades over 24 hours
market.priceChange1hPrice change over 1 hour, in percent
market.priceChange6hPrice change over 6 hours, in percent
market.priceChange24hPrice change over 24 hours, in percent
formatShows
number (the default)12.3K
usd$0.0042
usd-compact$1.2M
percent5%

<button cd-action="…"> runs one of our actions. A button with no action, or any other, does nothing.

cd-actionDoes
buyOpens our buy sheet for the coin
sign-inOpens our sign-in
connect-walletOpens our wallet connection
copy-addressCopies the coin's contract address

Fonts ​

A page uses a font by naming it in its CSS, from this list. We serve these fonts ourselves; @font-face and @import are dropped from a page's CSS, so these are the only fonts a page can load. Any other family in a font-family is left as written, for the fonts the visitor has.

FontWrite in CSS
Bangersfont-family: "Bangers"
Luckiest Guyfont-family: "Luckiest Guy"
Permanent Markerfont-family: "Permanent Marker"
Bungeefont-family: "Bungee"
Rubik Mono Onefont-family: "Rubik Mono One"
Press Start 2Pfont-family: "Press Start 2P"
Antonfont-family: "Anton"
Bebas Neuefont-family: "Bebas Neue"
Righteousfont-family: "Righteous"
Lilita Onefont-family: "Lilita One"
Titan Onefont-family: "Titan One"
Chewyfont-family: "Chewy"
Creepsterfont-family: "Creepster"
Black Ops Onefont-family: "Black Ops One"
Archivo Blackfont-family: "Archivo Black"
Poppinsfont-family: "Poppins"
Interfont-family: "Inter"
Space Groteskfont-family: "Space Grotesk"
Space Monofont-family: "Space Mono"
Rubikfont-family: "Rubik"
Nunitofont-family: "Nunito"

Poppins, Inter, Space Grotesk, Space Mono, Rubik and Nunito come in regular and bold (font-weight 400 and 700). The rest are display fonts in one weight. Name a fallback after ours, as in font-family: "Bangers", Impact, sans-serif, for the moment before the font loads.

Example ​

A store app that takes the page's accent, surface and text colors declares, in its capp.json:

json
"minColSpan": 2,
"minRowSpan": 4,
"display": { "minWidth": 280, "minHeight": 320 },
"presentation": { "themeTokens": ["--cd-accent", "--cd-surface", "--cd-text"] }

A page places it, themed, beside its own hero:

html
<main class="page">
  <cd-identity class="identity"></cd-identity>
  <section class="hero">
    <h1>$<cd-data bind="symbol"></cd-data></h1>
    <p><cd-data bind="market.price" format="usd"></cd-data> ·
       <cd-data bind="market.holders"></cd-data> holders</p>
    <button cd-action="buy">Buy</button>
  </section>
  <cd-app app="my-store" mode="themed" class="store"></cd-app>
</main>
css
.page {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  --cd-accent: #ff4fa3;
  --cd-surface: #1b1030;
  --cd-text: #fdf2ff;
}
.identity { grid-column: 1 / -1; }
.store { height: 420px; border-radius: 16px; }
@container page (max-width: 640px) {
  .page { grid-template-columns: 1fr; }
}

The store draws itself in the page's pink, dark purple and white. On a phone the page stacks it under the hero, and if the page had set height: 100px, the store would still be 320 px tall.

Images ​

A page's images are uploaded from the editor's Images panel, which lists them with their URLs: Copy URL to use one in your CSS, Insert to put an <img> where the caret is. PNG, JPEG, WebP and GIF are accepted, up to 8 MB each, and every image you upload counts toward the page's storage, like any other file the page keeps with Chain Daddy. An <img src> or a CSS url() may also point at an https image hosted elsewhere; visitors load it through our image proxy, so it is cached and served alongside the page.

The schema and its versions ​

The manifest schema, presentation included, is published:

  • the latest: https://docs.chaindaddy.io/schemas/capp.schema.json
  • each version: https://docs.chaindaddy.io/schemas/capp/<version>.json, starting at https://docs.chaindaddy.io/schemas/capp/1.0.0.json
  • 1.0.0: the first published version
  • 1.1.0: adds embed

A new field or value is a new minor version.