USAGE

Usage Guide

This guide details all the components exported by pagewrite-ui and the props they accept. Components are grouped by their folder sections.

1. Docs Components (pagewrite-ui/docs)

These components are typically used in the overall documentation layout.

Used as the SEO <head> element for your document, injecting metadata, robots tags, and Open Graph content.

PropTypeDefaultDescription
titlestring"Default Title"Primary title of the page.
descriptionstring-Meta description.
keywordsstring | string[]-Keywords for SEO. Arrays are automatically joined.
imagestring-Open Graph/Twitter image URL. Automatically resolves relative to Astro.url.
canonicalURLURL | string-Canonical link for SEO.
noindexbooleanfalseSet to true to disable indexing by search engines.
nofollowbooleanfalseSet to true to disable search engines following links.
typestring"website"Open Graph type.

A standard footer component for documentation layouts.

PropTypeDefaultDescription
logoobject-Contains light (string), dark (string, optional), and alt (string, optional) for the logo image. Falls back to siteTitle text if omitted.
siteTitlestring"Site Logo"The name of the site.
descriptionstring-Short description shown under the logo.
copyrightstring"Your Company, Inc."Copyright notice string.
linksArray<{ label: string, href: string }>[]Standard navigation links.
legalLinksArray<{ label: string, href: string }>[]Legal links like Privacy or Terms.

TableOfContent

Generates a sticky Table of Contents sidebar for your documentation pages.

PropTypeDefaultDescription
headingsArray-Array of Astro heading objects (containing depth, slug, text).

A component used to provide search functionality for the documentation.


2. General Components (pagewrite-ui/components)

Core structural and interactive UI components.

Card

A generic card component for highlighting items.

PropTypeDefaultDescription
titlestring-The card heading.
hrefstring-An optional link to wrap around the card.

ContextMenu

An interactive AI actions menu providing one-click options to copy markdown or open the current markdown file in ChatGPT, Claude, or Gemini.

Scripts

Theme initializer script for handling light and dark modes securely without flashing.

UsageDescription
<Scripts />Simply drop inside the <head> of your Astro document.

3. MDX Components (pagewrite-ui/mdx)

Components specifically designed to be passed into Astro’s MDX renderer to augment standard markdown.

Callout

Highlights a block of content with distinct visual styling.

PropTypeDefaultDescription
type"info" | "warning" | "success" | "error"-The theme of the callout.
titlestring-Heading for the callout block.

Image

Optimized image component that replaces standard markdown images to include styling and captions.

PropTypeDefaultDescription
srcstring(required)Image source URL.
altstring(required)Accessibility text.
captionstring-A text caption rendered beneath the image.

Spacer

Utility component to add vertical spacing within MDX content.

PropTypeDefaultDescription
sizenumber | string-Amount of space to add.

4. Icons (pagewrite-ui/icons)

A collection of lightweight SVG icon components.

PropertyDetails
Available IconsArrowTopRight, BlueSky, ChatGPT, ChevronLeft, ChevronRight, Claude, Gemini, Github, Leetcode, LinkedIn, Markdown, Medium, Twitter_X
PropsThey generally accept any standard HTML/SVG attributes such as a class (string) prop for Tailwind styling and sizing (e.g. <Github class="w-5 h-5 text-gray-500" />).