1111 const theme = getTheme (" tabItem" );
1212 const activeClasses = getContext <string >(" activeClasses" );
1313 const ctx: TabCtxType = getContext (" ctx" );
14-
14+
1515 const compoTabStyle = $derived (tabStyle ?? ctx .tabStyle ?? " full" );
1616 const { active, inactive } = $derived (tabs ({ tabStyle: compoTabStyle , hasDivider: true }));
1717
1818 const tabId = $props .id ();
19- const tabIdentifier = key ?? tabId ;
19+ const tabIdentifier = key ?? tabId ;
2020 const self: SelectedTab = { id: tabIdentifier , snippet: children };
2121
2222 const registerTab = getContext <(tab : SelectedTab ) => void >(" registerTab" );
2727 $effect (() => {
2828 updateSingleSelection (open , self );
2929 registerTab ?.(self );
30-
30+
3131 return () => {
3232 if (self .id ) {
3333 unregisterTab ?.(self .id );
3434 }
35- };
35+ };
3636 });
3737
3838 const { base, button } = $derived (tabItem ({ open , disabled }));
3939 </script >
4040
4141<li {...restProps } class ={base ({ class: clsx (theme ?.base , className ) })} role =" presentation" >
42- <button
43- type =" button"
44- onclick ={() => (open = true )}
45- role =" tab"
46- id ={self .id }
47- aria-controls ={ctx .panelId }
48- aria-selected ={open }
49- {disabled }
50- class ={button ({
51- class: clsx (
52- open ? (activeClass ?? active ({ class: activeClasses })) : (inactiveClass ?? inactive ()),
53- theme ?.button ,
54- classes ?.button
55- )
42+ <button
43+ type =" button"
44+ onclick ={() => (open = true )}
45+ role =" tab"
46+ id ={self .id }
47+ aria-controls ={ctx .panelId }
48+ aria-selected ={open }
49+ {disabled }
50+ class ={button ({
51+ class: clsx (open ? (activeClass ?? active ({ class: activeClasses })) : (inactiveClass ?? inactive ()), theme ?.button , classes ?.button )
5652 })}
5753 >
5854 {#if titleSlot }
6157 {title }
6258 {/if }
6359 </button >
64- </li >
60+ </li >
61+
62+ <!--
63+ @component
64+ [Go to docs](https://flowbite-svelte.com/)
65+ ## Type
66+ [TabitemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1730)
67+ ## Props
68+ @prop children
69+ @prop titleSlot
70+ @prop open = $bindable(false)
71+ @prop title = "Tab title"
72+ @prop key
73+ @prop activeClass
74+ @prop inactiveClass
75+ @prop class: className
76+ @prop classes
77+ @prop disabled
78+ @prop tabStyle
79+ @prop ...restProps
80+ -->
0 commit comments