Dynamic Css-in-Js styles engine, based on Emotion for React-Native
npm install @dyst/native
stylesheets and link them to functional components using the React hook pattern.
@emotion/react: As fast and lightweight as emotion
jsx
// Create dynamic stylesheet that has access to the previously specified theme and parameters
const useStyles = styleSheet.create(({theme, params}) => ({
root: / Dynamic Styles /,
button: / Dynamic Styles /,
text: / Dynamic Styles /,
}));
const MyComponent = (props) => {
// Access dynamic styles as class names using the created 'useStyles()' hook
// and specify the corresponding parameters
const { styles } = useStyles({ color: props.color, fontSize: 10 });
return (
{/ /}
);
}
`
$3
`bash
$ yarn add @dyst/native @emotion/react @emotion/native
or
$ npm install @dyst/native @emotion/react @emotion/native
``