Content


MarkdownRenderer

Parses and renders a Markdown string into themed native views. Supports headings h1–h6, bold, italic, inline code, code blocks, blockquotes, ordered/unordered lists, and hyperlinks. onLinkPress intercepts tapped links — pass Linking.openURL for default behaviour.

PropTypeDefaultDescription
contentstringMarkdown string to render
variant?'default' | 'compact''default''compact' reduces heading sizes and paragraph spacing
onLinkPress?(url: string) => voidCalled when the user taps a hyperlink
components?Partial<MarkdownComponents>Override individual element renderers (heading, code, blockquote, etc.)
accessibilityLabel?stringAccessibility label for the container
testID?stringTest identifier
import { MarkdownRenderer } from '@objectifthunes/limestone-sdk';
import { Linking } from 'react-native';

const md = `
# Hello

This is **bold** and *italic* text with \`inline code\`.

- Item one
- Item two
`;

<MarkdownRenderer
  content={md}
  onLinkPress={(url) => Linking.openURL(url)}
/>

CodeBlock

A syntax-highlighted read-only code block with optional line numbers and a copy button. Token colours derive from the active theme’s colors tokens so the block adapts automatically to light and dark modes.

PropTypeDefaultDescription
codestringSource code string to display
language?stringLanguage hint for syntax highlighting (e.g. 'typescript', 'bash')
showLineNumbers?booleanfalseRender a gutter with line numbers
wrapLines?booleanfalseWrap long lines instead of scrolling horizontally
onCopy?() => voidWhen provided, a copy icon button appears in the top-right corner
accessibilityLabel?stringAccessibility label for the code container
testID?stringTest identifier
import { CodeBlock } from '@objectifthunes/limestone-sdk';
import Clipboard from 'expo-clipboard';

const snippet = `const config = defineConfig({
  theme: obsidianTheme,
  api: { baseUrl: 'https://api.example.com' },
});`;

<CodeBlock
  code={snippet}
  language="typescript"
  showLineNumbers
  onCopy={() => Clipboard.setStringAsync(snippet)}
/>

RichTextEditor

A full-featured WYSIWYG editor with a configurable top-docked toolbar. Outputs HTML or Markdown depending on the format prop. The toolbar is fully customisable — pass a toolbar array to restrict or reorder items.

PropTypeDefaultDescription
valuestringControlled editor content (HTML or Markdown)
onChange(v: string) => voidCalled on every content change
format?'html' | 'markdown''markdown'Output format
toolbar?ToolbarItem[]full setToolbar items to display. Possible values: 'bold', 'italic', 'underline', 'strikethrough', 'h1', 'h2', 'h3', 'ul', 'ol', 'blockquote', 'link', 'code'
placeholder?stringPlaceholder text shown when the editor is empty
minHeight?numberMinimum editor height in points
maxHeight?numberMaximum editor height before the editor scrolls internally
readOnly?booleanfalseDisables editing and hides the toolbar
accessibilityLabel?stringAccessibility label for the editor
testID?stringTest identifier

ToolbarItem is a union of the string literals listed in the toolbar? description above.

import { RichTextEditor } from '@objectifthunes/limestone-sdk';
import { useState } from 'react';

function PostEditor() {
  const [body, setBody] = useState('');

  return (
    <RichTextEditor
      value={body}
      onChange={setBody}
      format="markdown"
      toolbar={['bold', 'italic', 'h1', 'h2', 'ul', 'ol', 'link']}
      placeholder="Write something…"
      minHeight={200}
    />
  );
}

BlockQuote

A left-border pull-quote block for highlighting excerpts, testimonials, or referenced passages. The variant prop maps to semantic theme colour tokens and the optional attribution line renders as muted smaller text beneath the content.

PropTypeDefaultDescription
childrenReact.ReactNodeQuote content
attribution?stringSource or author rendered below the quote
variant?'default' | 'accent' | 'warning' | 'destructive''default'Controls the left border colour (border / accent / warning / destructive token)
size?SpacingProp'md'Inner padding
borderWidth?number3Width of the left border in points
accessibilityLabel?stringAccessibility label for the blockquote container
testID?stringTest identifier
import { BlockQuote, Text } from '@objectifthunes/limestone-sdk';

<BlockQuote attribution="— Alan Kay" variant="accent">
  <Text>
    The best way to predict the future is to invent it.
  </Text>
</BlockQuote>

Callout

A themed notice block with a left-edge colour bar, an optional icon, an optional title, and arbitrary body content. Each variant maps to a semantic background and icon colour from the active theme. When dismissible is true a close button appears in the top-right corner and triggers onDismiss.

PropTypeDefaultDescription
childrenReact.ReactNodeCallout body content
variant'info' | 'success' | 'warning' | 'error' | 'tip' | 'note''info'Controls the colour scheme and default icon
title?stringBold title text rendered above the body
icon?stringIcon name from the registered icon set; overrides the default variant icon
dismissible?booleanfalseShow a close button in the top-right corner
onDismiss?() => voidCalled when the close button is pressed
size?SpacingProp'md'Inner padding
accessibilityLabel?stringAccessibility label for the callout container
testID?stringTest identifier
import { Callout, Text } from '@objectifthunes/limestone-sdk';
import { useState } from 'react';

function InstallGuide() {
  const [dismissed, setDismissed] = useState(false);

  if (dismissed) return null;

  return (
    <Callout
      variant="tip"
      title="Pro tip"
      dismissible
      onDismiss={() => setDismissed(true)}
    >
      <Text>Run `pnpm install` before starting the dev server.</Text>
    </Callout>
  );
}