
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
react-bottom-fixed
Advanced tools
A React component for iOS that keeps your bottom-positioned elements fixed and safely visible, automatically adjusting their positions when viewport changes (e.g., virtual keyboard appearance).
A smart React component that keeps your bottom buttons visible even when the iOS keyboard appears
If you've ever built mobile web apps, you've probably experienced this frustration:
position: fixed
doesn't work properly on iOS Safari/ChromeThis library solves exactly that problem! While Android fixed this issue back in 2019, iOS still hasn't caught up.
It automatically adjusts your button position in real-time whenever the keyboard appears:
visualViewport
API to calculate exact keyboard heighttransform
(no reflow!)npm install react-bottom-fixed
Super simple! Just wrap your bottom button with BottomFixed
and you're done:
import { BottomFixed } from 'react-bottom-fixed';
function MyApp() {
return (
<div>
{/* Regular page content */}
<h1>Hello World!</h1>
<input type="text" placeholder="Try typing here" />
{/* Button that stays visible above keyboard */}
<BottomFixed>
<button onClick={() => alert('Done!')}>Complete</button>
</BottomFixed>
</div>
);
}
<BottomFixed className="my-custom-style">
<button className="fancy-button">Fancy Button</button>
</BottomFixed>
BottomFixed
PropsProperty | Type | Required | Description |
---|---|---|---|
children | ReactNode | ✅ | Component to be fixed at bottom |
className | string | ❌ | Additional CSS class name |
On non-iOS environments, it automatically behaves like a normal container with zero performance overhead.
🌐 Live Demo - Try it right now!
Or clone and run locally:
git clone https://github.com/almond-bongbong/react-bottom-fixed.git
cd react-bottom-fixed/example
npm install
npm run dev
Test it on iPhone or Chrome DevTools mobile mode – you'll see the difference immediately!
visualViewport
: Gracefully falls back to regular container on older browsersFound a bug or have ideas for improvement? We'd love to hear from you!
MIT License - feel free to use it however you like!
See the CHANGELOG.md file for details.
FAQs
A React component for iOS that keeps your bottom-positioned elements fixed and safely visible, automatically adjusting their positions when viewport changes (e.g., virtual keyboard appearance).
We found that react-bottom-fixed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.