Use with Remax

Installation#

npm install @fower/remax

Usage#

Now we're going to build a user profile card ui with View,Image,Text.

import { View, Text, Image } from '@fower/remax'
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^
LIVE DEMO

As you can see, we can build a more complex interface with few code. At first glance, you might say: "Isn't this a disguised inline style?" This is indeed similar to the inline style. They both write the style on JSX, but maybe this is the only similarity of them. The way to writing styles of Fower, I call it "Atomic props".

Compared with inline style, "Atomic props" has many advantages:

  • Less Code, inline styles has a larger amount of code, which can easily make JSX messy, but "Atomic props" retains the simplicity of JSX and is more readable.

  • Style reuse, using inline styles, it is easy to quickly expand the code, using "Atomic props", the code size will not expand too much as the project grows.