Tab Trigger as Remix Link #1721
hauptrolle
started this conversation in
General
Replies: 2 comments 5 replies
-
You using a controlled |
Beta Was this translation helpful? Give feedback.
4 replies
-
Using controlled tabs needs an equivalent Here's a working code: export default function App() {
const { pathname } = useLocation();
const navigate = useNavigate();
const lastPathFragment = pathname.substring(pathname.lastIndexOf('/') + 1);
const activeTab = lastPathFragment.length > 0 ? lastPathFragment : 'homepage';
return (
<Document>
<Tabs.Root
activationMode="manual"
value={activeTab}
onValueChange={({ value }) => {
navigate(`/${value === 'homepage' ? '' : value}`);
}}
className="mx-auto my-6"
>
{/*...*/}
</Document>
);
} Here's the Stackblitz demo: https://stackblitz.com/edit/remix-ark-tabs-5ffyg7?file=app%2Froot.tsx The Tab Indicator works, and you can even do without |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 👋
if I want to use the
Tabs
component to be used as a navigation with RemixLink
Component theTabs.Inficator
animation sometimes breaks (on the first clicks). Also the navigation with the arrow keys work, but I cant active the links withenter
orspace
.Here is an example repo: https://stackblitz.com/edit/remix-ark-tabs
Any ideas why this breaks?
Beta Was this translation helpful? Give feedback.
All reactions