openbridge-web-components-update
v0.4.1
Published
WebComponents of openbridge and svgs. The original version doesn't get published anymore for some reason. This package will be removed as soon as the original gets updated
Readme
OpenBridge Web Components
This is an implementation of the openbridge design system in web components.
Demo
A storybook demo is available here.
How to use the components
With npm
The project can be used directly from npm.
Install the package by:
npm install openbridge-web-componentsInstall openbridge-css:
npm install openbridge-cssInclude the package in you javascript code (vue/react/angular)
import "openbridge-web-components";Include the openbridge css in your project
openbridge-css/dist/css/openbridge.cssSet the theme in the html tag, for instance
<html theme="day">Use the components, e.g.,:
`<ob-rudder-medium rudderAngle="5" rudderSetPointAngle="3" clipAngle="60" showPortStarboard="false" showSetPoint="true"/>`
Directly in html
The components can be used directly in html (see also demo.html):
<html lang="en" theme="day"> <!-- set theme="day for day pallett -->
<head>
<script src="https://unpkg.com/[email protected]"></script> <!--import web components-->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/openbridge.css"> <!--import openbridge css-->
</head>
<body>
<ob-azimuth-large target="90" value = "80" angle = "45" targetAngle="60"/>
</body>
</html># SVG exportThere is also a tool for exporting SVG components from Figma. To run the exporter you need to acquire an token here. The exporter generates SVGs. The project also includes WebComponents.
Generated SVGs cleaned Generated SVGs with inline style
How to contribute
We welcome all contributions! This could for instance be bug reports or implementation of components. We accept implementation in all major frameworks, but prefer web-components and vue.js.
Implementation guideline
- Use basic components if possible. For instance use the WatchFace component.
- Export SVG components by defining the component in
src/exports.ts. This ensures that the component works in all palettes. - Center of the SVG viewbox should be (0,0).
