diff --git a/packages/components/src/box-control/README.md b/packages/components/src/box-control/README.md index 7fbf8b59c42516..80cfce66896421 100644 --- a/packages/components/src/box-control/README.md +++ b/packages/components/src/box-control/README.md @@ -123,6 +123,13 @@ A callback function for visualizer changes, based on input hover interactions. - Type: `Function` - Required: Yes +### sides + +Collection of sides to allow control of. If omitted or empty, all sides will be available. + +- Type: `Array` +- Required: No + ### units Collection of available units which are compatible with [UnitControl](../unit-control). diff --git a/packages/components/src/box-control/stories/index.js b/packages/components/src/box-control/stories/index.js index 60205d435fb944..119d014dc01d43 100644 --- a/packages/components/src/box-control/stories/index.js +++ b/packages/components/src/box-control/stories/index.js @@ -20,14 +20,15 @@ export const _default = () => { return ; }; -function DemoExample() { - const [ values, setValues ] = useState( { - top: '10px', - right: '10px', - bottom: '10px', - left: '10px', - } ); +const defaultSideValues = { + top: '10px', + right: '10px', + bottom: '10px', + left: '10px', +}; +function DemoExample( { sides, defaultValues = defaultSideValues } ) { + const [ values, setValues ] = useState( defaultValues ); const [ showVisualizer, setShowVisualizer ] = useState( {} ); return ( @@ -37,6 +38,7 @@ function DemoExample() { @@ -62,6 +64,24 @@ export const visualizer = () => { return ; }; +export const arbitrarySides = () => { + return ( + + ); +}; + +export const singleSide = () => { + return ( + + ); +}; + const Container = styled( Flex )` max-width: 780px; `;