UNPKG

dis-gui-lifetoys

Version:

An extensible, styleable, & React-based controller library inspired by the venerable dat-gui.

22 lines (17 loc) 426 B
'use strict'; import PropTypes from 'prop-types'; import React, { useContext } from 'react'; import { StyleContext } from '../styleContext'; export default function Control({ children }) { const styleContext = useContext(StyleContext); return ( <div style={{ width: `${styleContext.controlWidth}px`, }}> {children} </div> ); } /*Control.contextTypes = { styleContext: PropTypes.object, }*/