DocsPluginsShowcaseReleases
npmStar us on GitHub

Getting Started

IntroductionInstallationProject StructureLayouts and PagesLinking and Navigating

Routing

Folder-Based RoutingFile-Based RoutingDynamic RoutesParallel RoutesIntercepting RoutesCatch-All RoutesMDX & Markdown Pages

Special Files

Loading UIError BoundariesTemplateDefaultNot Found

Data Fetching

LoadersActionsAccessing Route Data

Metadata

Metadata & SEOOpen Graph & TwitterIcons & Favicons

API Routes

API Routes OverviewPlain Function HandlersHono IntegrationDynamic API Routes

Environment Variables

OverviewPrefixes & Client ExposureUsing in API Routes

Styling

CSS OverviewTailwind CSSCSS Modules

Platforms

WebWindowsmacOSLinuxAndroidiOS

Deployment

Deployment OverviewProduction ServerStatic ExportHosting Providers

A native React framework for building cross-platform applications from a single codebase.

Resources

  • Documentation
  • Plugins
  • Showcase
  • Releases

Community

  • GitHub Discussions
  • Reddit
  • Discord
  • LinkedIn

More

  • npm
  • GitHub
  • Issues
  • License

© 2026 Bini Cooperation.

Icons & Favicons

Favicons, Apple touch icons, and web manifest icons - defined in document.head.

Overview

Icons cover browser tabs, bookmarks, the iOS home screen, and Android / PWA install. Bini.js uses raw <link> tags inside document.head for all icon definitions.

  • Favicons: <link rel="icon"> - SVG and ICO with sizes
  • Apple Touch: <link rel="apple-touch-icon"> - 180×180 for iOS home screen
  • Manifest: <link rel="manifest"> + public/site.webmanifest
  • Defaults: drop files in public/ - no extra config required

Using document.head

In the root layout, place icon tags directly inside document.head. This is the pattern used by every Bini.js project. It applies in both development and production.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link rel="manifest" href="/site.webmanifest" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico" />
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
      <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    </>
  ),
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return <>{children}</>
}
Tags in document.head override any tags injected with the same rel.

Icon Types

TagPurposeDescription
link rel="icon"FaviconStandard favicon with type and sizes
link rel="shortcut icon"Legacy faviconLegacy shortcut icon
link rel="apple-touch-icon"iOS home screen180×180 recommended
link rel="mask-icon"Pinned tabSafari pinned tab icon

Link tag attributes

AttributeTypeDescription
hrefstringURL to icon file
typestringMIME type e.g. image/svg+xml
sizesstringSize e.g. 32x32, 180x180
relstringRelationship, e.g. icon or apple-touch-icon

Favicons

Prefer SVG for modern browsers, with PNG and ICO as fallbacks.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico" />
      <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
      <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
    </>
  ),
}
FileSizePurpose
favicon.svganyModern browsers - scalable
favicon.ico32×32Legacy fallback
favicon-32x32.png32×32Standard tab icon
favicon-16x16.png16×16Small tab icon

Apple Touch Icons

Used when a user adds your site to the iOS home screen. iOS applies rounded corners unless you supply a precomposed asset.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link
        rel="apple-touch-icon"
        sizes="180x180"
        href="/apple-touch-icon.png"
      />
    </>
  ),
}
Use a 180×180 PNG. Placing apple-touch-icon.png in public/ also works for automatic detection.

Manifest & Icons

The web app manifest supplies icons for Android home screen, splash, and PWA install.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link rel="manifest" href="/site.webmanifest" />
      <meta name="theme-color" content="#0a0a0a" />
    </>
  ),
}
public/site.webmanifest
{
  "name": "My Bini.js App",
  "short_name": "Bini",
  "icons": [
    {
      "src": "/android-chrome-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    },
    {
      "src": "/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ],
  "theme_color": "#0a0a0a",
  "background_color": "#ffffff",
  "display": "standalone"
}

Default Images

Put assets in public/. Replace the defaults with your own files.

public
favicon.ico
favicon.svg
favicon-16x16.png
favicon-32x32.png
apple-touch-icon.png
android-chrome-192x192.png
android-chrome-512x512.png
og-image.png
site.webmanifest
For native packaging, logo.png in public/ is often used as the source icon for platform icon generation.

Complete Example

src/app/layout.tsx
export const document = {
  head: (
    <>
      <title>My Bini.js App</title>
      <link rel="manifest" href="/site.webmanifest" />
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico" />
      <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
      <meta name="theme-color" content="#0a0a0a" />
    </>
  ),
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return <>{children}</>
}

Open Graph & Twitter

Control social preview cards.

Metadata

Export document.head for site-wide head tags and page-level SEO.

Layouts and Pages

Create your first pages and wrap them in shared layouts.

Dynamic Routes

Match URL segments with dynamic parameters and catch-alls.

Deployment

Deploy to Node, Vercel, Netlify, Cloudflare, or Deno, or build native apps in CI.

Installation

Review CLI flags and system requirements.

Was this helpful?
PreviousOpen Graph & Twitter
NextAPI Routes Overview

On this page

  • Overview
  • Using document.head
  • Icon Types
  • Favicons
  • Apple Touch Icons
  • Manifest & Icons
  • Default Images
  • Complete Example
Edit this page on GitHub

Icons & Favicons

Favicons, Apple touch icons, and web manifest icons - defined in document.head.

Overview

Icons cover browser tabs, bookmarks, the iOS home screen, and Android / PWA install. Bini.js uses raw <link> tags inside document.head for all icon definitions.

  • Favicons: <link rel="icon"> - SVG and ICO with sizes
  • Apple Touch: <link rel="apple-touch-icon"> - 180×180 for iOS home screen
  • Manifest: <link rel="manifest"> + public/site.webmanifest
  • Defaults: drop files in public/ - no extra config required

Using document.head

In the root layout, place icon tags directly inside document.head. This is the pattern used by every Bini.js project. It applies in both development and production.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link rel="manifest" href="/site.webmanifest" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico" />
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
      <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    </>
  ),
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return <>{children}</>
}
Tags in document.head override any tags injected with the same rel.

Icon Types

TagPurposeDescription
link rel="icon"FaviconStandard favicon with type and sizes
link rel="shortcut icon"Legacy faviconLegacy shortcut icon
link rel="apple-touch-icon"iOS home screen180×180 recommended
link rel="mask-icon"Pinned tabSafari pinned tab icon

Link tag attributes

AttributeTypeDescription
hrefstringURL to icon file
typestringMIME type e.g. image/svg+xml
sizesstringSize e.g. 32x32, 180x180
relstringRelationship, e.g. icon or apple-touch-icon

Favicons

Prefer SVG for modern browsers, with PNG and ICO as fallbacks.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico" />
      <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
      <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
    </>
  ),
}
FileSizePurpose
favicon.svganyModern browsers - scalable
favicon.ico32×32Legacy fallback
favicon-32x32.png32×32Standard tab icon
favicon-16x16.png16×16Small tab icon

Apple Touch Icons

Used when a user adds your site to the iOS home screen. iOS applies rounded corners unless you supply a precomposed asset.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link
        rel="apple-touch-icon"
        sizes="180x180"
        href="/apple-touch-icon.png"
      />
    </>
  ),
}
Use a 180×180 PNG. Placing apple-touch-icon.png in public/ also works for automatic detection.

Manifest & Icons

The web app manifest supplies icons for Android home screen, splash, and PWA install.

src/app/layout.tsx
export const document = {
  head: (
    <>
      <link rel="manifest" href="/site.webmanifest" />
      <meta name="theme-color" content="#0a0a0a" />
    </>
  ),
}
public/site.webmanifest
{
  "name": "My Bini.js App",
  "short_name": "Bini",
  "icons": [
    {
      "src": "/android-chrome-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    },
    {
      "src": "/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ],
  "theme_color": "#0a0a0a",
  "background_color": "#ffffff",
  "display": "standalone"
}

Default Images

Put assets in public/. Replace the defaults with your own files.

public
favicon.ico
favicon.svg
favicon-16x16.png
favicon-32x32.png
apple-touch-icon.png
android-chrome-192x192.png
android-chrome-512x512.png
og-image.png
site.webmanifest
For native packaging, logo.png in public/ is often used as the source icon for platform icon generation.

Complete Example

src/app/layout.tsx
export const document = {
  head: (
    <>
      <title>My Bini.js App</title>
      <link rel="manifest" href="/site.webmanifest" />
      <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
      <link rel="icon" type="image/x-icon" href="/favicon.ico" />
      <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
      <meta name="theme-color" content="#0a0a0a" />
    </>
  ),
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return <>{children}</>
}

Open Graph & Twitter

Control social preview cards.

Metadata

Export document.head for site-wide head tags and page-level SEO.

Layouts and Pages

Create your first pages and wrap them in shared layouts.

Dynamic Routes

Match URL segments with dynamic parameters and catch-alls.

Deployment

Deploy to Node, Vercel, Netlify, Cloudflare, or Deno, or build native apps in CI.

Installation

Review CLI flags and system requirements.

Was this helpful?
PreviousOpen Graph & Twitter
NextAPI Routes Overview

On this page

  • Overview
  • Using document.head
  • Icon Types
  • Favicons
  • Apple Touch Icons
  • Manifest & Icons
  • Default Images
  • Complete Example
Edit this page on GitHub