Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-var-ui

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-var-ui

react-var-ui

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
92
increased by39.39%
Maintainers
1
Weekly downloads
 
Created
Source

react-var-ui

Simple React settings library.

workflow npm npm NPM

React component library for variable setting and preview, inspired by iOS settings, react-dat-gui and dat.gui.

While some code from react-dat-gui was used, this library functions in a completely different way. The codebase uses modern React code practices such as hooks and functional components. Instead of iterating over the children array, react-var-ui uses a Context. Creation of custom components is also easier.

Example usage

const [values, setValues] = React.useState({
  toggle: true,
  color: '#FF0000',
  select: 1,
  slider: 0.4
});

return (
  <VarUI updateValues={setValues} values={values}>
    <VarCategory label="Example">
      <VarColor path="color" label="Color" />
      <VarToggle path="toggle" label="Toggle" />
      <VarSelect
        path="select"
        label="Select"
        options={[
          { key: 0, label: 'Zero' },
          { key: 1, label: 'One' }
        ]}
      />
      <VarSlider
        label="VarSlider"
        path="slider"
        min={0.2}
        max={0.8}
        step={0.1}
      />
    </VarCategory>
  </VarUI>
);

Theme customization

The colors can be customized as such (provided are default values):

.react-var-ui {
  --react-var-ui-foreground-color: #ddd;
  --react-var-ui-background-color: #11111a;
  --react-var-ui-accent-color: #4444ff;
  --react-var-ui-input-background-color: #66666a;
  --react-var-ui-label-background-normal-color: #22222a;
  --react-var-ui-label-background-hover-color: #33333a;
  --react-var-ui-label-border-color: #33333a;
}

FAQs

Package last updated on 13 Jun 2021

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