# @react-native-sandbox/grid

> A plugin for react-native-sandbox to add a grid layer to sandboxes

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

## Install

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

## 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 | 17 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/grid
- 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/grid

## 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 a grid 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/grid
```

Modify your sandbox root to load the plugin:

```typescript
import GridPlugin from '@react-native-sandbox/grid';

// ...

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

## Usage

By default all sandboxes will now have the grid actions added to the toolbar. Tapping the icon will iterate over the different size configurations. (disabled, 10, 20, 50) You can also toggle between a line grid and a dot grid.

![Demo](/docs/images/grid-demo.gif)

To disable grid on a given sandbox you can provide a plugin configuration:

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


function MyComponentSandbox() { /* ... */ }

export default {
    name: 'My Component Sandbox',
    components: {
        MyComponentSandbox: {
            component: MyComponentSandbox,
            plugins: {
                grid: false,
            }
        }
    }
}
```

## Configuration

The plugin can be configured as follows:

```typescript
import GridPlugin from '@react-native-sandbox/grid';

// ...

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

Where the following options are available:

| Key | Type | Description |
|---|---|---|
| gridColor | string | Global override for the default grid color. |
| defaultType | "line", "dot" | Default grid type to use. |

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