1.0.7 • Published 11 months ago

@zalxon/components v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

zalxon / components

shared react components for our websites

GitHub Build Status MIT License NPM Version

These are a set of modular but opinionated react components. They assume and make extensive use of theme-ui and next, and are meant to be composed with our theme. The main use cases are to encourage consistency throughout our design and streamline building our own websites by reducing boilerplate. However, over time we might expand them to enable easier embedding of our content into other websites.

See them demoed at zalxon.com/design.

usage

Initializing the Theme Provider

When working with some of the components, it is important to have a theme object in place. Therefore, to ensure smooth functioning of the components, you must initialize the theme provider in your Next.js project. Here's an example of how you can achieve this in pages/_app.js:

import { ThemeProvider } from 'theme-ui'

// import your theme or define it here
const theme = {}

export default function App({ Component, pageProps }) {
  return (
    <ThemeProvider theme={theme}>
      <Component {...pageProps} />
    </ThemeProvider>
  )
}

Using the components

To use, import the component(s) you want into your next project. Here are some examples.

Use our logo and monogram:

import { Logo, Monogram } from '@zalxon/components'

Use our icons:

import { Icons } from '@zalxon/components'

const { Check, Question, Info } = Icons

Render a simple layout without a footer

import { Layout, Logo, Monogram } from '@zalxon/components'

const Index = () => {
  return (
    <Layout footer={false}>
      <Logo sx={{ width: 180 }} />
      <Monogram sx={{ width: 60 }} />
    </Layout>
  )
}

export default Index

For more usage examples checkout our design sample which showcases all these components live.

development

To update a component and publish a new version, first make your changes, then follow these steps

  • Increase the version number in package.json
  • npm run build
  • npm publish

license

All the code in this repository is MIT licensed, but we request that you please provide attribution if reusing any of our digital content (graphics, logo, articles, etc.).

about us

Zalxon is a non-profit organization that uses data and science for healthcare action. We aim to improve the transparency and scientific integrity of healthcare solutions with open data and tools. Find out more at zalxon.com or get in touch by opening an issue or sending us an email.

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago