Feedback

ChromeMessage

The surface for 404 and error screens: a $ command, an output line, a serif title, a note and an action. No hooks, so a server component can render it.

view .md
Preview
cat ./this-page

cat: ./this-page: No such file or directory

Page not found.

it moved, or it never existed

Installation
terminal
bash
npx @entrepta/cli@latest add chrome-message

// Resolves dependencies, copies the source, and installs npm packages automatically.

Usage
chrome-message.tsx
tsx
import { ChromeMessage } from "@/components/entrepta/chrome-message"

// app/not-found.tsx
export default function NotFound() {
  return (
    <ChromeMessage
      command="cat ./this-page"
      output="cat: ./this-page: No such file or directory"
      title="Page not found."
      note="it moved, or it never existed"
      action={<Link href="/">go home</Link>}
    />
  )
}

// app/error.tsx: an error boundary is a client component
"use client"

export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
  return (
    <ChromeMessage
      accent="error"
      command="npm run page"
      title="Something broke."
      note="the error was logged"
      action={<Button onClick={reset}>try again</Button>}
    >
      {error.digest && <p className="font-mono text-mono-sm">digest: {error.digest}</p>}
    </ChromeMessage>
  )
}
Props
PropTypeDefaultDescription
commandstring-The command after the $
accent"brand" | "error""brand"Color of the $
outputstring-A terminal output line
titleReactNode-Serif h1
noteReactNode-Mono line under the title
actionReactNode-A way back
Active theme: entrepta, dark mode.