We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you make example with whole layout with tabs? I try to use it like this, but it cover <Outlet/>. And i can't scroll to see full page.
<Outlet/>
return <div> <div> <Outlet/> </div> <Tabbar > {tabs.map(({ id, text, Icon, to }) => <RouterLink to={to} key={id}> <Tabbar.Item key={id} text={text} selected={id === currentTab} onClick={() => setCurrentTab(id)}> <Icon /> </Tabbar.Item> </RouterLink> )} </Tabbar> </div>;
The text was updated successfully, but these errors were encountered:
I made it work Original example lacks the part where you make you tab visible In my example it is {tab()}
{tab()}
import { FixedLayout, Tabbar } from "@telegram-apps/telegram-ui"; import { useState } from "react"; export default function NewHomePage() { const tabs = [ { id: "search", text: "Search", Icon: () => <img src="/Search-icon.png" />, Tab: () => <div>Search</div>, }, { id: "meets", text: "Meets", Icon: () => <img src="/Meets-icon.png" />, Tab: () => <div>Meets</div>, }, { id: "profile", text: "Profile", Icon: () => <img src="/Profile-icon.png" />, Tab: () => <div>Profile</div>, }, ]; const [currentTabId, setCurrentTab] = useState(tabs[0].id); const tab = tabs.find(({ id }) => id === currentTabId)?.Tab!; return ( <FixedLayout vertical="top"> {tab()} <Tabbar> {tabs.map(({ id, text, Icon }) => ( <Tabbar.Item key={id} text={text} selected={id === currentTabId} onClick={() => setCurrentTab(id)}> <Icon /> </Tabbar.Item> ))} </Tabbar> </FixedLayout> ); }
Sorry, something went wrong.
No branches or pull requests
Can you make example with whole layout with tabs?
I try to use it like this, but it cover
<Outlet/>
. And i can't scroll to see full page.The text was updated successfully, but these errors were encountered: