const tabsInAssets = ['Coupe', 'Graph']
const [tabSelectedIndex, setTabSelectedIndex] = useState<number>(0)
// html:
{ tabsInAssets.map((elem, index) =>
<button key={index}
className={tabSelectedIndex === index ?
'bg-gray-400 mr-2 w-12 rounded font-Inter font-medium':
'bg-gray-200 mr-2 w-12 rounded font-Inter font-medium'}
onClick={() => {setTabSelectedIndex(index) }}>{elem}</button>
)}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter