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

Function Tab

src/showcase/components/tabs/IconTabs.tsx:50–82  ·  view source on GitHub ↗
({ text, selected, setSelected, index, children }: TabProps)

Source from the content-addressed store, hash-verified

48}
49
50const Tab = ({ text, selected, setSelected, index, children }: TabProps) => {
51 return (
52 <motion.button
53 variants={buttonVariants}
54 initial="initial"
55 animate="animate"
56 custom={selected}
57 onClick={() => setSelected(tabs[index])}
58 transition={transition}
59 className={`${
60 selected
61 ? 'bg-red-500/15 text-red-500 '
62 : ' hover:text-gray-900 dark:hover:text-gray-100'
63 } relative flex items-center rounded-full px-4 py-2 text-sm font-medium text-gray-500 transition-colors duration-300 focus-within:outline-red-500/50`}
64 >
65 {children}
66 <AnimatePresence>
67 {selected && (
68 <motion.span
69 variants={spanVariants}
70 initial="initial"
71 animate="animate"
72 exit="exit"
73 transition={transition}
74 className="overflow-hidden"
75 >
76 {text}
77 </motion.span>
78 )}
79 </AnimatePresence>
80 </motion.button>
81 )
82}
83
84// IconTabs component
85const IconTabs = ({ center }: { center?: boolean }) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected