New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-sandbox-monorepo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-sandbox-monorepo

A sandbox environment for building, documenting, and presenting components in React Native

  • 0.1.17
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

This is a work in progress. Expect frequent breaking changes until the library reaches a stable v1.0.0 version.

Provides a sandbox environment for component development with minor configuration requirements.

Usage

First, create sandbox definitions. Use sandbox hooks to specify controls.

import { useText } from 'react-native-sandbox';

export function ButtonPlayground() {
  const text = useText('Text', 'Button text');

  return <Button text={text} />;
}

Then, render the sandbox from within your app.

import SandboxRoot from 'react-native-sandbox';

const components = [
  {
    name: 'Button',
    components: {
      ButtonPlayground,
    },
  },
];

function App() {
  return <SandboxRoot components={components} />;
}

Controls

Controls are rendered in the order that the hooks are invoked in.

TypeHookDescription
BooleanuseBooleanA switch control for boolean props
ColoruseColorA color picker
DivideruseDividerA divider in the component control panel
LabeluseLabelA label to display in component control panel
InfouseInfoA info block to display useful information
NumberuseNumberA number input
ObjectuseObjectA text input control for JSON objects
SelectuseSelectA value selector
TextuseTextA text input

Theming

Themes allow for control over the styling of the sandbox tool. Out of the box there is a default (light) and a dark theme.

import SandboxRoot, { DefaultTheme, DarkTheme } from 'react-native-sandbox';

// ...

const theme = {
  ...DefaultTheme,
  colors: {
    ...DefaultTheme.colors
    background: 'gray',
  }
}

function App() {
  return <SandboxRoot components={components} theme={theme} />;
}

Currently, the only supported editable theme properties are colors.

PropertyDescriptionDefaultDark
textDefault color for textblack#eee
backgroundDefault color for backgroundwhite#222
surfaceDefault background color for surfaces#eee#111
disabledColor for disabled text#555#777
dividerColor for dividers#ccc#555
infoColor for informational items#3498db#3498db
warningColor for warning items#f1c40f#f1c40f
errorColor for error items#e74c3c#e74c3c
successColor for success items#2ecc71#2ecc71

Keywords

FAQs

Package last updated on 15 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc