# @react-native-sandbox/docs

> A plugin for react-native-sandbox to enable support for documentation

Latest version **0.1.21** (published 2022-10-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @react-native-sandbox/docs
pnpm add @react-native-sandbox/docs
yarn add @react-native-sandbox/docs
bun add @react-native-sandbox/docs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.21 |
| Published | 2022-10-17 |
| First published | 2022-10-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ryan Penfold |
| Maintainers | rpenf |
| Keywords | sandbox, components, react-native, react-native-sandbox |

## Links

- npm: https://www.npmjs.com/package/@react-native-sandbox/docs
- Repository: https://github.com/rpenfold/react-native-sandbox
- Homepage: https://github.com/rpenfold/react-native-sandbox#readme
- Issues: https://github.com/rpenfold/react-native-sandbox/issues
- npm.io page: https://npm.io/package/@react-native-sandbox/docs

## Recent versions

- 0.1.21 (latest) — 2022-10-17
- 0.1.20 — 2022-10-15
- 0.1.19 — 2022-10-15
- 0.1.18 — 2022-10-15

## README

Adds flexible documentation to `react-native-sandbox`.

## Installation

Requires `react-native-sandbox`. Ensure that your sandbox is configured correctly before proceeding.

Open a terminal in your project's folder and run

```shell
npm install @react-native-sandbox/docs
```

Modify your sandbox root to load the plugin:

```typescript
import DocsPlugin from '@react-native-sandbox/docs';

// ...

function Sandbox() {
    return <SandboxRoot components={comonents} plugins={[DocsPlugin]}>
}
```

## Usage

Documentation is registered to a sandbox by using the `useDoc` hook. At the moment this can only be called once per sandbox. The supported content type is text in the form of a string.

```typescript
import MyComponent from './MyComponent';
import { useDocs } from '@react-native-sandbox/docs';
import documentation from './documentation.txt';


function MyComponentSandbox() {
    // renders a panel containing the provided content
    useDocs(documentation);

    return (<MyComponent />);
}
```

Support for additional content types such as Markdown and React coming soon.

## Configuration

The plugin can be configured as follows:

```typescript
import DocsPlugin from '@react-native-sandbox/docs';

// ...

const plugin = DocsPlugin.configure(options);
```

Where the following options are available:

| Key | Type | Description |
|---|---|---|
| renderer | ComponentType | Global override for the default document renderer. Useful for customizing the way content is rendered. For example can replace with a markdown, PDF, or other renderer. Passes `content` prop with the value from the `useDoc` hook. |

---
_Source: https://npm.io/package/@react-native-sandbox/docs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
