v1.0 — Component Showcase

Scribe Component Showcase

Every component that ships with Scribe, rendered live. This is exactly what your documentation will look like — dark mode, light mode, responsive, accessible.


Callouts

Five types for every situation. Each with its own icon and color scheme.

Informational

Use info callouts for general notes, tips, or context that helps the reader understand the topic better.

Success

Great for confirming something worked, showing correct examples, or highlighting best practices.

Pro Tip

Share insider knowledge, shortcuts, or advanced techniques that save developers time.

Code Block

Syntax highlighting for 30+ languages with a copy button, language label, and optional filename header.

src/index.ts
import Scribe from "scribe-docs";

const docs = new Scribe({
  name: "My API",
  version: "2.0",
  theme: {
    primaryColor: "#6366f1",
    darkMode: true,
  },
});

// Register your API endpoints
docs.endpoint("POST", "/users", {
  description: "Create a new user",
  bodyParams: [
    { name: "email", type: "string", required: true },
    { name: "role", type: '"admin" | "member"' },
  ],
});

docs.build();
main.py
from scribe import Scribe

app = Scribe(
    name="My API",
    version="2.0",
    base_url="https://api.example.com",
)

@app.endpoint("POST", "/users")
def create_user(email: str, role: str = "member"):
    """Create a new user account."""
    return {"id": "usr_01J8X...", "email": email, "role": role}
Terminal
# Install Scribe and create your docs
git clone https://github.com/RapierCraft/Scribe.git my-docs
cd my-docs && npm install
npm run dev

# Open http://localhost:3000/docs

Code Tabs

Multi-language code examples in a single tabbed container. Perfect for showing the same API call in different languages.

Bash
curl -X POST https://api.example.com/v1/payments \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 2000,
    "currency": "usd",
    "customer": "cus_abc123"
  }'

API Endpoint

Structured API documentation with method badges, parameter tables, multi-language request examples, and response status switching.

POST/v1/payments

Create a new payment intent. The payment will be in a 'requires_payment_method' state until a payment method is attached and confirmed.

Request Body

ParameterTypeRequiredDescription
amountintegerRequiredAmount in cents. Minimum 50.Example: 2000
currencystringRequiredThree-letter ISO 4217 currency code.Example: "usd"
customerstringOptionalID of the customer to associate with this payment.Example: "cus_abc123"
descriptionstringOptionalArbitrary string for your own records.
metadataobjectOptionalKey-value pairs for storing additional information.

Request Examples

Bash
curl -X POST https://api.example.com/v1/payments \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"amount": 2000, "currency": "usd"}'

Responses

JSON
{
  "id": "pay_01HXZ7KBPM2QGQAZ5JRPEY8AX",
  "object": "payment",
  "amount": 2000,
  "currency": "usd",
  "status": "requires_payment_method",
  "client_secret": "pay_01HXZ7..._secret_QZKpHnHF",
  "created_at": "2026-03-21T10:00:00Z"
}
GET/v1/payments/:id

Retrieve a payment by its unique identifier.

Path Parameters

ParameterTypeRequiredDescription
idstringRequiredThe payment ID (starts with "pay_").Example: "pay_01HXZ7..."

Query Parameters

ParameterTypeRequiredDescription
expandstring[]OptionalRelated objects to expand inline. Supports: customer, invoice.Example: ["customer"]

Responses

JSON
{
  "id": "pay_01HXZ7KBPM2QGQAZ5JRPEY8AX",
  "object": "payment",
  "amount": 2000,
  "currency": "usd",
  "status": "succeeded",
  "customer": "cus_abc123",
  "created_at": "2026-03-21T10:00:00Z"
}
DELETE/v1/payments/:id

Cancel a payment that has not yet been captured. This action is irreversible.

Path Parameters

ParameterTypeRequiredDescription
idstringRequiredThe payment ID to cancel.

Responses

JSON
{
  "id": "pay_01HXZ7KBPM2QGQAZ5JRPEY8AX",
  "status": "cancelled",
  "cancelled_at": "2026-03-21T10:05:00Z"
}

Steps

Numbered step-by-step instructions with connector lines. Each step supports a title, description, and optional embedded content.

1

Install the SDK

Choose your language and install the official SDK from your package manager.

Bash
npm install @acme/sdk
# or
pip install acme-sdk
2

Configure your API key

Add your secret key to environment variables. Never commit it to version control.

.env
ACME_API_KEY=sk_live_your_key_here
ACME_WEBHOOK_SECRET=whsec_your_secret_here
3

Create your first payment

Initialize the client and make your first API call. The SDK handles authentication automatically.

checkout.ts
import { Acme } from "@acme/sdk";

const acme = new Acme(process.env.ACME_API_KEY);

const payment = await acme.payments.create({
  amount: 2000,
  currency: "usd",
  description: "Premium subscription",
});

console.log(payment.client_secret);
4

Handle the webhook

Listen for payment events to fulfil orders, send receipts, and update your database.

webhook.ts
app.post("/webhooks/acme", async (req, res) => {
  const event = acme.webhooks.verify(
    req.body,
    req.headers["acme-signature"],
  );

  if (event.type === "payment.succeeded") {
    await fulfillOrder(event.data.id);
  }

  res.json({ received: true });
});
5

Go live

Switch from test mode to live mode by replacing your API key. No code changes needed — the SDK handles everything.

Cards

Navigation cards with icons, descriptions, badges, and hover animations. Great for landing pages and section indexes.

Quick Start

Get up and running in under 5 minutes with our step-by-step guide.

API Reference

Complete endpoint documentation with examples in every language.

SDKs & Libraries

New

Official SDKs for JavaScript, Python, Go, Ruby, and PHP.

Webhooks

Receive real-time events and build reliable event-driven workflows.

Three-column layout

Authentication

API keys, OAuth2, and token management.

Rate Limits

Understand concurrency limits and throttling.

Error Codes

Complete reference for all error responses.

Global Coverage

135+ currencies across 47 countries.

Theming

Pro

Customize colors, fonts, and layout.

Search

Built-in full-text search. Press "/" to try it.

Typography

All standard Markdown elements are pre-styled through the MDX component system.

Inline code

Use inline code for variable names, function calls like createPayment(), or HTTP methods like POST /v1/payments.

Lists

  • Unordered lists use disc markers
  • They support inline code and bold text
  • Nested content renders cleanly at any depth
  1. Ordered lists use decimal numbering
  2. Perfect for sequential instructions
  3. Each item aligns with consistent spacing

Blockquote

“The best API documentation is the one developers actually read.”
— Every developer advocate, ever.

Table

StatusMeaningAction
200SuccessProcess the response body
401UnauthorizedCheck your API key
429Rate LimitedBack off and retry with exponential delay
500Server ErrorRetry or contact support