0.9.2 • Published 27 days ago
@cypress-design/react-tabs v0.9.2
Tabs
Install
npm install @cypress-design/react-tabs
or with yarn
yarn add @cypress-design/react-tabs
Usage
import Tabs from '@cypress-design/react-tabs'
import { IconActionPlayVideo } from '@cypress-design/react-icon'
export default () => (
<Tabs
activeId="ov"
tabs={[
{ id: 'ov', label: 'Overview' },
{ id: 'cl', label: 'Command Log', icon: IconActionPlayVideo },
{ id: 'err', label: 'Errors', href: 'https://www.cypress.io' },
{ id: 'reco', label: 'Recommendations' },
]}
/>
)
import { useState } from 'react'
import { IconActionPlayVideo } from '@cypress-design/react-icon'
export default () => {
const [allowMove, setAllowMove] = useState(true)
return (
<>
<fieldset>
<input
id="allow-move"
type="checkbox"
onClick={() => setAllowMove(!allowMove)}
checked={allowMove}
class="mr-2"
/>
<label for="allow-move">allow tab move</label>
</fieldset>
<Tabs
activeId="ov"
tabs={[
{ id: 'ov', label: 'Overview' },
{ id: 'cl', label: 'Command Log', icon: IconActionPlayVideo },
{ id: 'err', label: 'Errors', href: 'https://www.cypress.io' },
{ id: 'reco', label: 'Recommendations' },
]}
onSwitch={(_, e) => {
if (!allowMove) e.preventDefault()
}}
/>
</>
)
}
0.9.2
27 days ago
0.9.0
28 days ago
0.9.1
27 days ago
0.8.6
1 month ago
0.8.5
2 months ago
0.8.4
2 months ago
0.8.3
2 months ago
0.8.2
2 months ago
0.8.1
9 months ago
0.7.2
10 months ago
0.8.0
10 months ago
0.7.1
10 months ago
0.6.2
10 months ago
0.7.3
10 months ago
0.7.0
10 months ago
0.6.1
10 months ago
0.6.0
11 months ago
0.3.0
1 year ago
0.2.0
1 year ago
0.5.0
1 year ago
0.4.1
1 year ago
0.4.0
1 year ago
0.3.1
1 year ago
0.5.2
12 months ago
0.5.1
12 months ago
0.1.0
1 year ago