0.1.3 • Published 4 years ago

@leveluptuts/motion-elements v0.1.3

Weekly downloads
16
License
MIT
Repository
-
Last release
4 years ago

@leveluptuts/motion-elements

Motion Elements

Mr Wave On

Demo

Install

yarn add @leveluptuts/motion-elements

Usage

The Syntax

import { Accordion } from '@leveluptuts/motion-elements';

...
<Accordion>
	<p>Another example</p>
</Accordion>
...

More options

import React, { useState } from 'react';
import { Accordion } from '@leveluptuts/motion-elements';

const App = () => {
	const [isToggled, setToggle] = useState(true);
	return (
		<div>
			<button onClick={() => setToggle(prev => !prev)}>Toggle</button>
			<Accordion isToggled={isToggled} useButton={false}>
				<p>Some text.</p>
			</Accordion>
		</div>
	)

API

Accordion

The parent of an array of components

PropTypeDefaultDescription
childrenComponentsAn array of React Components
isToggledBooleanOPTIONAL _ The bool that toggles the accordion
useButtonBoolean(data) => dataOPTIONAL _ if you want to bring your own b, byob if you will

Contributing

yarn yarn start

(in another tab) to run example

cd example yarn yarn start

Prior Art and Inspirations

This lib is just basic wrappers around https://www.framer.com/motion/

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago