0.1.6 • Published 4 years ago
geonorge-web-components v0.1.6
Geonorge.WebComponents
Installation
Geonorge Web Components is available as an npm package.
// with npm
npm install geonorge-web-components
// with yarn
yarn add geonorge-web-components
Usage
HTML site
<!doctype html>
<html lang="no">
<head>
<meta charset="utf-8">
<title>HTML site</title>
<meta content="width=device-width,initial-scale=1" name="viewport">
</head>
<body>
<main-navigation englishurl="/" norwegianurl="/" environment="dev" ></main-navigation>
<!-- Content here -->
<script src="main-navigation.js"></script>
</body>
</html>
React app
import React from 'react';
import ReactDOM from 'react-dom';
import { MainNavigation } from 'geonorge-web-components/main-navigation';
function App() {
return (<React.Fragment>
<main-navigation environment="dev"></main-navigation>
/* Content here */
</React.Fragment>;
}
ReactDOM.render(<App />, document.querySelector('#app'));