Add the appropriate device status and navigation bar to your web application and bring your mocks/prototypes/screenshots to the next level.
npm install device-bars --save<!-- index.html -->
<html>
<head>
<script src='node_modules/device-bars/dist/device-bars.js'></script>
</head>
...
</html>Option 2: Script Tag (via unpkg)
<!-- index.html -->
<html>
<head>
<script type="module" src="https://unpkg.com/[email protected]/dist/device-bars/device-bars.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/device-bars/device-bars.js"></script>
</head>
...
</html>Use the elements <device-status-bar /> and <device-navigation-bar /> anywhere in your template, JSX, html etc
<!-- index.html -->
<html>
<body>
<device-status-bar device="iPhone 11" color="#000" background="transparent"></device-status-bar>
<div id="root"></div>
<device-navigation-bar device="iPhone 11"></device-navigation-bar>
</body>
</html>| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
background |
background |
Sets the background color of the status bar | string |
undefined |
color |
color |
Set the color of the status bar text | string |
undefined |
date |
date |
The date to be displayed | string |
undefined |
device |
device |
Predefined device descriptor name, such as "iPhone X" or "Pixel 2". For a complete list please see: DEVICES at ./../utils/device.ts |
string |
undefined |
height |
height |
Sets the height of the navigation bar. By default, the height is derived from the specified device safe-area, but it can also be adjusted manually. | string |
undefined |
hide |
hide |
Hides the Statusbar | boolean |
false |
inline |
inline |
Set the Statusbar inline | boolean |
false |
mode |
mode |
The mode determines which platform styles to use. | string |
undefined |
safeArea |
safe-area |
Adds an additional safe-area for the status and navigation bar. The respective height is derived from the specified device. By default, the safe-area is implemented via padding on the body. If an element is detected, the css variable --ion-safe-area-* will be set. | boolean |
true |
time |
time |
The time to be displayed | string |
undefined |
| Name | Description |
|---|---|
--background |
Background color of the status bar. |
--color |
Color of the status bar. |
--height |
Height of the status bar. |
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
background |
background |
Sets the background color of the navigation bar | string |
undefined |
color |
color |
Set the color of the navigation bar | string |
undefined |
device |
device |
Predefined device descriptor name, such as "iPhone X" or "Pixel 2". For a complete list please see: DEVICES at ./../utils/device.ts |
string |
undefined |
fill |
fill |
(Android only) Sets the color to fill the icons in the navigation bar. | string |
undefined |
height |
height |
Sets the height of the navigation bar. By default, the height is derived from the specified device safe-area, but it can also be adjusted manually. | string |
undefined |
hide |
hide |
Hides the Statusbar | boolean |
false |
inline |
inline |
Set the Statusbar inline. | boolean |
false |
safeArea |
safe-area |
Adds an additional safe-area for the status and navigation bar. The respective height is derived from the specified device. By default, the safe-area is implemented via padding on the body. If an element is detected, the css variable --ion-safe-area-* will be set. | boolean |
true |
| Name | Description |
|---|---|
--background |
Background color of the status bar. |
--color |
Color of the status bar. |
--fill |
Height of the status bar. |
--height |
Height of the status bar. |
Galaxy Note 3,Galaxy Note 3 landscapeGalaxy Note II,Galaxy Note II landscapeGalaxy S III,Galaxy S III landscapeGalaxy S5,Galaxy S5 landscapeNexus 10,Nexus 10 landscapeNexus 4,Nexus 4 landscapeNexus 5,Nexus 5 landscape,Nexus 5X,Nexus 5X landscapeNexus 6,Nexus 6 landscape,Nexus 6P,Nexus 6P landscapeNexus 7,Nexus 7 landscapePixel 2,Pixel 2 landscape,Pixel 2 XL,Pixel 2 XL landscape
iPad (gen 6),iPad (gen 6) landscapeiPad (gen 7),iPad (gen 7) landscapeiPad Mini,iPad Mini landscapeiPad Pro 11,iPad Pro 11 landscapeiPad Pro 13,iPad Pro 13 landscapeiPhone 6,iPhone 6 landscape,iPhone 6 Plus,iPhone 6 Plus landscapeiPhone 7,iPhone 7 landscape,iPhone 7 Plus,iPhone 7 Plus landscapeiPhone 8,iPhone 8 landscape,iPhone 8 Plus,iPhone 8 Plus landscapeiPhone SE,iPhone SE landscapeiPhone X,iPhone X landscapeiPhone XR,iPhone XR landscapeiPhone 11,iPhone 11 landscapeiPhone 11 Pro,iPhone 11 Pro landscape,iPhone 11 Pro Max,iPhone 11 Pro Max landscape
To start developing the device-bars web component using Stencil, clone this repo to a new directory:
git clone https://github.com/SimonGolms/device-bars.git device-bars
cd device-bars
git remote rm originnpm install
npm startTo build device-bars for production, run:
npm run buildnpm testThis command may be useful when obscure errors or issues are encountered. It removes and recreates dependencies of your project.
npm run repairRun npm run release to create a new build & release with semantic-release. This bumps the version of package.json, uses conventional-changelog to update CHANGELOG.md and references in the README.md, commits package.json, CHANGELOG.md and tags a new release.
The new release gets published to GitHub and npm automatically.
Check out the Stencil docs here.
Run npx git-cz to generate a valid commit message. It’s easy to forget about the commit convention so to be consistent use commitizen to generate our commits and husky to manage a Git commit-msg hook to validate the commit message.
Further information: How to automate versioning and publication of an npm package
Simon Golms
- Digital Card:
npx simongolms - Github: @SimonGolms
- Website: gol.ms
- Support Status (e.g. Call, GPS, Record)
- Angular Component
- React Component
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 Simon Golms.
This project is MIT licensed.
