MCPcopy Create free account
hub / github.com/SyntaxUI/syntaxui / Tab

Function Tab

src/showcase/components/tabs/ButtonShapeTabs.tsx:14–34  ·  view source on GitHub ↗
({ text, selected, setSelected }: TabProps)

Source from the content-addressed store, hash-verified

12}
13
14const Tab = ({ text, selected, setSelected }: TabProps) => {
15 return (
16 <button
17 onClick={() => setSelected(text)}
18 className={`${
19 selected
20 ? 'text-white'
21 : 'text-gray-500 hover:text-gray-900 dark:hover:text-gray-100'
22 } relative rounded-md px-2 py-1 text-sm font-medium transition-colors`}
23 >
24 <span className="relative z-10">{text}</span>
25 {selected && (
26 <motion.span
27 layoutId="tab"
28 transition={{ type: 'spring', duration: 0.4 }}
29 className="absolute inset-0 z-0 rounded-md bg-red-500"
30 ></motion.span>
31 )}
32 </button>
33 )
34}
35
36const ButtonShapeTabs = () => {
37 const [selected, setSelected] = useState<string>(tabs[0])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected