Created
May 20, 2022 12:51
-
-
Save kwltrs/0e89c84000d85117b3f13527f1ebb886 to your computer and use it in GitHub Desktop.
ffe-tabs-react proposal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react; | |
import { TabList, Tab } from '@sb1/ffe-tabs-react'; | |
() => { | |
const ids = { house: 'house', car: 'car' }; | |
const [activeTab, setActiveTab] = useState(ids.house); | |
const tabpanelProps = id => id === activeTab ? {} : {style: {display: 'none'}}; | |
return <> | |
<TabList value={activeTab} onChange={value => setAvtiveTab(value)}> | |
<Tab value={ids.house} aria-controls={id.house}>Huslån</Tab> | |
<Tab value={ids.car} aria-controls={id.house}>Billån</Tab> | |
</TabList> | |
<div role="tabpanel" id={ids.house} {...tabpanelProps(id.house}}>Ta opp huslån</div> | |
<div role="tabpanel" id={ids.car} {...tabpanelProps(id.car}}>Ta opp billån</div> | |
<>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment