1.10.0 • Published 5 years ago

@sibipro/caffeine v1.10.0

Weekly downloads
235
License
MIT
Repository
-
Last release
5 years ago

@sibipro/caffeine

Component library for Sibi. Not really intended for public consumption.

Components here are built around the Material-UI library, and in some cases those components are exposed directly.

Check out http://caffeine.sibi.sh for information about the components.

Installation

Install the package and all peer dependencies.

// yarn is the best, use it
yarn add @sibipro/caffeine

// add peer dependencies
yarn add react react-dom prop-types

Usage

You can use components directly, and they will automatically use the "website" theme.

import React from 'react';
import Button from '@sibipro/caffeine/components/Button';

const App = () => (
  <>
    <p>I am some React app.</p>
    <Button color="primary" variant="contained" onClick={() => alert('You clicked me!')}>Click Me</Button>
  </>
);

If you would like to modify the appearance of your components by using a different theme, use the <ThemeProvider /> component. This is a provider that you pass the theme into, then make the rest of your app a child of it.

import React from 'react';
import theme from '@sibipro/caffeine/themes/website'
import ThemeProvider from '@sibipro/caffeine/components/ThemeProvider';
import Button from '@sibipro/caffeine/components/Button';

const App = () => (
  <ThemeProvider theme={theme}>
    <p>I am some React app.</p>
    <Button color="primary" variant="contained" onClick={() => alert('You clicked me!')}>Click Me</Button>
  </ThemeProvider>
);

export default App;

You can also override a theme by nesting another <ThemeProvider /> in the main app. This works exactly like the Material-UI Theme Provider.

1.10.0

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.5.2

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.8

5 years ago

1.2.9

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago