# react-native-bpk-component-panel

> Backpack React Native panel component.

Latest version **2.0.1** (published 2020-02-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install react-native-bpk-component-panel
pnpm add react-native-bpk-component-panel
yarn add react-native-bpk-component-panel
bun add react-native-bpk-component-panel
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-02-26 |
| First published | 2018-03-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 66.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 543 |
| Author | Backpack Design System |
| Maintainers | georgegillams, k0nserv, mattface, ojcurt, shaundon, tiagohngl |

## Links

- npm: https://www.npmjs.com/package/react-native-bpk-component-panel
- Repository: https://github.com/Skyscanner/backpack
- Homepage: https://github.com/Skyscanner/backpack#readme
- Issues: https://github.com/Skyscanner/backpack/issues
- npm.io page: https://npm.io/package/react-native-bpk-component-panel

## Dependencies (2)

- [bpk-tokens](https://npm.io/package/bpk-tokens.md) ^32.0.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.8

## Recent versions

- 2.0.1 (latest) — 2020-02-26
- 1.1.2-alpha.1 (canary) — 2019-12-03
- 2.0.0 — 2020-02-19
- 1.1.11 — 2020-02-13
- 1.1.10 — 2020-01-30
- 1.1.9 — 2020-01-22
- 1.1.8 — 2020-01-20
- 1.1.7 — 2019-12-17
- 1.1.6 — 2019-12-12
- 1.1.5 — 2019-12-06
- 1.1.4 — 2019-12-05
- 1.1.3 — 2019-12-04
- 1.1.2 — 2019-12-04
- 1.1.1 — 2019-11-29
- 1.1.0 — 2019-11-28
- … 67 more at https://npm.io/package/react-native-bpk-component-panel/versions

## README

# react-native-bpk-component-panel

> Backpack React Native panel component.

## Installation

```sh
npm install react-native-bpk-component-panel --save-dev
```

## Usage

```js
import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import BpkPanel from 'react-native-bpk-component-panel';
import BpkText from 'react-native-bpk-component-text';
import { spacingBase } from 'bpk-tokens/tokens/base.react.native';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: spacingBase,
  }
});

export default class App extends Component {
  render() {
    const content = (
      <BpkText>
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
        commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus
        et magnis dis parturient montes, nascetur ridiculus mus.
      </BpkText>
    );

    return (
      <View style={styles.container}>
        <BpkPanel>{content}</BpkPanel>
        <BpkPanel padded={false}>{content}</BpkPanel>
      </View >
    );
  }
}
```

### `withDivider` HOC

```js
import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import BpkText from 'react-native-bpk-component-text';
import { spacingBase } from 'bpk-tokens/tokens/base.react.native';
import BpkPanel, { withDivider } from 'react-native-bpk-component-panel';

const BpkPanelWithDivider = withDivider(BpkPanel);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: spacingBase,
  }
});

export default class App extends Component {
  render() {
    const content = (
      <BpkText>
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
        commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus
        et magnis dis parturient montes, nascetur ridiculus mus.
      </BpkText>
    );

    return (
      <View style={styles.container}>
        <BpkPanelWithDivider stub={content}>{content}</BpkPanelWithDivider>
        <BpkPanelWithDivider stub={content} vertical>{content}</BpkPanelWithDivider>
        <BpkPanelWithDivider stub={content} padded={false}>{content}</BpkPanelWithDivider>
      </View >
    );
  }
}
```

## Props

*BpkPanel:*

| Property   | PropType  | Required | Default Value |
| ---------- | --------- | -------- | ------------- |
| children   | node      | true     | -             |
| padded     | bool      | false    | true          |

*After `withDivider`:*

| Property   | PropType  | Required | Default Value |
| ---------- | --------- | -------- | ------------- |
| stub       | node      | true     | -             |
| vertical   | bool      | false    | false         |
| mainStyle  | object    | false    | null          |
| stubStyle  | object    | false    | null          |

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