Code Monkey home page Code Monkey logo

leva's Introduction

All Contributors

useControls

yarn add leva

useControls brings is a smart GUI for your React apps and your creative coding endeavors:

  • ๐Ÿง Smart defaults, your GUI will always pick the best input type for your data
  • ๐Ÿคณ Mobile-ready, all inputs work perfectly on mobile
  • ๐Ÿ’ช Type safety, useControls is built from the ground up with typescript, all types are inferred from your code.

useControls isn't a component library.

Features

  • As-you-type filtering of inputs.
  • You can modify number inputs by either dragging over the input label or inner label.
  • The lib automatically calculates the number input step based on the initial value magnitude and significant digits.
  • Increase / decrease numbers with arrow keys, with alt (ยฑ0.1) and shift (ยฑ10) modifiers support.
  • Draggable pane.

Inputs

  • String
  • Boolean
  • Number
  • Range
  • Interval [min,max]
  • Point2d [x,y] or {x,y}
  • Point3d [x,y,z] or {x,y,z}
  • Color #hex and {r,g,b,a}
  • Select
  • Spring {tension,friction,mass}
  • Image

Usage

Simply call the useControls hook from anywhere in your app.

Your component will update whenever the values defined in the hook are changed!

import { useControls } from 'leva'

function MyComponent() {
  const { myValue } = useControls({ myValue: 10 })
  return myValue
}

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Gianmarco

๐Ÿค” ๐Ÿ’ป

David Bismut

๐Ÿค” ๐Ÿ’ป

Han

๐ŸŽจ

Andrew Prifer

๐Ÿค”

Aria

๐Ÿค”

Marco Ludovico Perego

๐Ÿค”

Marco Fugaro

๐Ÿค”

Ivan Rossi

๐Ÿ›

thephoenixofthevoid

๐Ÿ›

This project follows the all-contributors specification. Contributions of any kind welcome!

leva's People

Contributors

dbismut avatar gsimone avatar

Watchers

 avatar  avatar

Forkers

az7dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.