use browser ui components inside your app!
npm install react-browser-ui

> use browser ui components inside your app!
 
Chrome (showHeader = true) | Chrome (showHeader = false)
:-------------------------:|:-------------------------:
!Browser ui example 1 | !Browser ui example 2
Firefox (showHeader = true) | Firefox (showHeader = false)
!Browser firefox ui example 1 | !Browser firefox ui example 2
Safari |
!Browser safari ui example 1 |
``bash`
npm install --save react-browser-ui
jsx
import React from 'react'
import Browser, { Chrome } from 'react-browser-ui'const { Tab, Divider, AddButton } = Chrome
export default function ChromeExample ({ showHeader = false }) {
const tabEnd = (
)
return (
type={'chrome'}
showHeader={showHeader}
activeTabKey={'green'}
tabEnd={tabEnd}>
{'Your component here'}
{'Your component here'}
)
}
`$3
`jsx
import React from 'react'
import Browser, { Firefox } from 'react-browser-ui'const { Tab, Divider, AddButton } = Firefox
export default function FirefoxExample () {
const tabEnd = (
)
return (
type={'firefox'}
showHeader={false}
activeTabKey={'green'}
tabEnd={tabEnd}>
{'Your component here'}
{'Your component here'}
)
}
`$3
`jsx
import React from 'react'
import Browser, { Safari } from 'react-browser-ui'const { Tab, Divider, AddButton } = Safari
export default function SafariExample () {
const tabEnd = (
)
return (
type={'safari'}
showHeader={false}
activeTabKey={'green'}
tabEnd={tabEnd}>
{'Your component here'}
{'Your component here'}
)
}
`
API
$3
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| type | String | 'chrome' | browser type (currently chrome, firefox and safari is supported) |
| showHeader | Boolean | false | whether to show header of the browser |
| activeTabKey | String, Number | undefined | active tab's key |
| tabEnd | ReactElements | | additional react elements that will be insterted end of the tabs |
| children | ReactElements | | Tab element collection will passed as a child in here |
| onChange | Function | undefined | if you want your browser to be controlled by your state use 'onChange' property that sends 'key' of the 'Tab' as first parameter |
| onClose | Function | undefined | action will be fired when browser close button clicked |
| onMinifyClick | Function | undefined | action will be fired when browser minify button clicked |
| onFullscreenClick | Function | undefined | action will be fired when browser fullscreen button clicked |$3
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| key | String, Number | undefined | tab key is required and will be used when determining active tab |
| imageUrl | String | undefined | thumbnail image of the tab |
| imageAlt | String | '' | alt attribute of image |
| title | String, ReactElements | '' | title of the tab |
| children | ReactElements | | tab content, your component will go here |
| onClose | Function | undefined` | action will be fired when tab close button clicked |MIT © ismailnamdar