Collection of theme-ui and external components.
created:3/15/2021
updated:3/15/2021
source lines:23
comments %:26

Zoom

zoom effect using transform

Component

import { Zoom } from '@component-controls/components';

Overview

() => {
const [scale, setScale] = useState(1);
return (
<Box style={{ width: '100%' }}>
<ActionContainer
actions={[
{
node: 'reset',
onClick: () => setScale(1),
},
{
node: 'zoom out',
onClick: () => setScale(scale / 2),
},
{
node: 'zoom in',
onClick: () => setScale(scale * 2),
},
]}
>
<Box sx={{ mt: '30px' }}>
<Zoom scale={scale}>
<Donut value={1 / 2} />
</Zoom>
</Box>
</ActionContainer>
</Box>
);
}

Properties

Name
Description
Default
scale

default scale

number
1

External dependencies

package
imports
peer
react
^17.0.1
ReactFC
*
theme-ui
^0.6.0-alpha.7
Box

Component JSX