Back to showcase

API Components

Components for displaying HTTP methods, endpoints, parameters, responses, and authentication. Mostly driven by frontmatter in content files.

HttpMethodBadge

Colored badge for HTTP methods with method-specific colors.

GET POST PUT PATCH DELETE
size="sm": GET POST DELETE
PropTypeDefaultDescription
methodHttpMethodGET, POST, PUT, PATCH, or DELETE
size'sm' | 'md''md'Badge size

PathDisplay

Renders API paths with highlighted path parameters (e.g. :id).

/v1/customers/:id /v1/customers/:customer_id/sources/:source_id
compact: /v1/customers/:id
PropTypeDefaultDescription
pathstringAPI path with :param placeholders
compactbooleanfalseSmaller font size

EndpointCard

Card linking to an endpoint page. Shows method badge, path, title, and description.

PropTypeDescription
methodHttpMethodHTTP method
pathstringAPI endpoint path
titlestringEndpoint title
descriptionstring?Optional description text
hrefstringLink destination
deprecatedbooleanShow deprecated styling (reduced opacity, strikethrough)

ParameterList

Recursive parameter list with types, required/nullable badges, enums, and expandable child attributes. Driven by frontmatter parameters array.

Body parameters

amount integer REQUIRED

Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit.

currency string REQUIRED

Three-letter ISO currency code, in lowercase.

Possible enum values:

  • usd US Dollar
  • eur Euro
  • gbp British Pound
metadata object OPTIONAL nullable

Set of key-value pairs for storing additional information.

Frontmatter example
parameters:
  - name: amount
    type: integer
    required: true
    description: Amount to charge in smallest currency unit.
  - name: currency
    type: string
    required: true
    enum:
      - value: usd
        description: US Dollar
      - value: eur
        description: Euro
  - name: metadata
    type: object
    nullable: true
    expandable: true
    children:
      - name: order_id
        type: string
        description: Your internal order ID.

ResponseBlock

Displays an HTTP response status code with description and optional JSON example.

200

Successfully created the customer.

{
  "id": "cus_1234abc",
  "object": "customer",
  "email": "jane@example.com"
}
404

The requested customer does not exist.

PropTypeDescription
statusCodenumberHTTP status code (color-coded: 2xx green, 4xx/5xx red)
descriptionstringResponse description
examplestring?JSON response example (displayed in code block)

ReturnsSection

"Returns" section at the bottom of endpoint pages describing the response type.

Returns

Returns the Customer object

PropTypeDescription
descriptionstringReturn description text
typestring?Type name to display (rendered as link if href provided)
hrefstring?Link to type definition

AuthBadge

Displays the security scheme and optional scopes for an endpoint.

Bearer Token OAuth 2.0 readwrite API Key admin
PropTypeDescription
schemestringSecurity scheme name
scopesstring[]?Required scopes (displayed as small accent badges)