Library of accessible & reusable React UI components for developing interactive module/plugins on helsingborg.se and other websites built with Municipio (Open Source Theme for Wordpress).
- UI Components depends on CSS styles from helsingborg-stad/styleguide
- UI Components are written in TypeScript
- Library can be used without Wordpress just as long the styleguide CSS is included
# using npm
npm install @helsingborg-stad/municipio-react-ui
# using yarn
yarn add @helsingborg-stad/municipio-react-ui
Include the latest styleguide and fonts in your app:
<!-- styleguide css -->
<link
rel="stylesheet"
id="styleguide-css"
type="text/css"
href="https://styleguide.getmunicipio.com/assets/dist/css/styleguide-css.min.css"
media="all"
/>
<!-- roboto font -->
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;0,900;1,400;1,500&display=swap"
rel="stylesheet"
/>
<!-- material icons -->
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
Stylesheet can also be built & imported as a ES6 module but it requires your build pipeline to support SASS.
import { Button, Icon } from '@helsingborg-stad/municipio-react-ui'
const App = () => (
<>
<Icon name="phone">
<Button>Example button</Button>
</>
);
git clone helsingborg-stad/municipio-react-ui
cd municipio-react-ui
yarn
yarn start
Open your browser and visit http://localhost:6006.
yarn lint
yarn format
yarn test
You can submit any ideas as pull requests or as GitHub issues.
The CHANGELOG.md is regularly updated to reflect what's changed in each new release.