正在加载视频...

视频加载失败

The new version of React Native Bottom Tabs is out! 🎉 A new highly anticipated feature: Custom JavaScript Tabs! ✨ Provide your custom tab bar while leveraging native navigation underneath 🚀 Here is a demo of it in the 🦋 app! This demonstrates smooth screen transitions using native animations...

35,725 次观看 • 1 年前 •via X (Twitter)

11 条评论

Fabrizio 的头像
Fabrizio1 年前

That was the missing piece on the React Native ecosystem, nice to see it working

Weather, Maps and some AI 的头像
Weather, Maps and some AI2 年前

Don't you need a new weather widget?

Michał Pierzchała 的头像
Michał Pierzchała1 年前

damn that's smooth

DrAriu 的头像
DrAriu1 年前

Now the only missing part: Web support

Oskar Kwaśniewski 的头像
Oskar Kwaśniewski1 年前

As mentioned in another comment: On web you should use `@⁠react-navigation/bottom-tabs` this can be done conditionally using .web.tsx extensions. I will make sure to add examples of this in the docs.

maxi 的头像
maxi1 年前

LFG

Olowoyo 的头像
Olowoyo1 年前

What’s the difference between this and expo tab(expo-router/ui) ?

Oskar Kwaśniewski 的头像
Oskar Kwaśniewski1 年前

You can read more about the differences here:

Giovanni Padova 的头像
Giovanni Padova1 年前

Awesome work ! Now I don't see any reason why not making the default for Expo Router.

DrAriu 的头像
DrAriu1 年前

Fantastic!

MONARCH 的头像
MONARCH1 年前

Can this be used in tandem with expo router, ie expo router’s components for everything else, then this for a bottom navigator

相关视频

CSS Trick 🤙 You can create these tab bar controls by using :has() to count the number of tabs ⭐️ .tabs:has(input:nth-of-type(3)){--count: 3;} .tabs:has(:checked:nth-of-type(3)){--active: 200%;} .tabs::after{ translate:var(--active) 0;} Let's break it down in this ! 📼 Couple of CSS :has() tricks here combined with custom properties 😎 First things first, lay out the tabs using display: grid. This gives you a way to create equal-width tabs 🙏 .tabs { display: grid; grid-auto-flow: column; } Then you use :has() to count the number of tabs and store that in a custom property 🤓 .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(input:nth-of-type(4)) { --count: 4; } Using the cascade, the last valid :has() gives you the number of tabs 🫶 Using the tab count, you can size the tab indicator. For the tab indicator, use the tabs pseudoelement: .tabs::after { content: ""; position: absolute; height: 100%; width: calc(100% / var(--count)); } See how you can use --count to determine its size 📏 Next, use :has() to determine which tab is active or :checked with input [type=radio] .tabs:has(:checked:nth-of-type(2)) { --active: 1; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } You can use a zero-indexed translation here. If the second input is :checked, set --active: 1, then translate the pseudoelement on the tabs to that position 👉 .tabs::after { translate: calc(var(--active, 0) * 100%) 0; } Or you could set active to the translation: .tabs:has(:checked:nth-of-type(2)) { --active: 100%; } Setting the custom property allows you to use the index elsewhere if you need it 🤙 The final piece is using mix-blend-mode 👀 The tabs have a black background-color, the pseudoelement is white, and the label text is white. When you use mix-blend-mode: difference on the pseudoelement it will give this effect that the text transitions from white to black sliding across 😎 .tabs::after { color: hsl(0 0% 100%); mix-blend-mode: difference; } You can totally mix up the colors here though and go with a different effect. The mechanics of how you can use CSS :has() is the main point here 🙏 As always, any questions, suggestions, etc. let me know CodePen.IO link below! 👇 (There's even a Tailwind CSS play for this one too 👀)

jhey ʕ•ᴥ•ʔ

70,670 次观看 • 2 年前