Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/huozhi/react-jsx-style

React library to render CSS dynamic with JSX component or hooks
https://github.com/huozhi/react-jsx-style

animation animation-css css-in-js css-in-react dynamic-css hooks-api styling

Last synced: 20 days ago
JSON representation

React library to render CSS dynamic with JSX component or hooks

Awesome Lists containing this project

README

        

# React JSX Style
> create dynamic injected styles with react component or hooks

## Installation

```sh
npm install -S react-jsx-style
```

## Usage

### Animation

```js
import {Keyframe} from 'react-jsx-style'

// Using react component - Keyframe, Keyframe.Block +
// Scale animation
function AnimatedBlock() {
return (
<div
style={{
textAlign: 'center',
width: 200,
animation: 'scale_2 3000ms infinite',
transformOrigin: 'center',
}}
>
<h3>scale</h3>
<style>
<Keyframe identity={'scale_2'}>
<Keyframe.Block selector={'from'} value={{WebkitTransform: 'scale(1)'}} />
<Keyframe.Block selector={'to'} value={{WebkitTransform: 'scale(2)'}} />
</Keyframe>


)
}

// Using hooks - useKeyframe
// Rotate animation
function HookAnimationBlock() {
return (



Rotate


)
}

```

## License

[MIT](https://github.com/reduxjs/react-redux/blob/master/LICENSE.md)