
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-material-bottom-sheet
Advanced tools
A React component library for Material Design bottom sheets
A modern, accessible React component library for Material Design bottom sheets with smooth drag gestures, snap points, and TypeScript support.
Watch the demo to see the drag and snap behavior in action.
npm install react-material-bottom-sheet
This library requires React 18+ and React DOM 18+:
npm install react@^18.0.0 react-dom@^18.0.0
Note: The library is compatible with both React 18 and React 19.
import React, { useState } from 'react';
import { BottomSheet } from 'react-material-bottom-sheet';
import 'react-material-bottom-sheet/style.css';
function App() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
<button onClick={() => setIsOpen(true)}>
Open Bottom Sheet
</button>
<BottomSheet
isOpen={isOpen}
onClose={() => setIsOpen(false)}
>
<div style={{ padding: '20px' }}>
<h2>Bottom Sheet Content</h2>
<p>This is the content of the bottom sheet.</p>
<button onClick={() => setIsOpen(false)}>Close</button>
</div>
</BottomSheet>
</div>
);
}
import { BottomSheet } from 'react-material-bottom-sheet';
function CustomSnaps() {
const [isOpen, setIsOpen] = useState(false);
return (
<BottomSheet
isOpen={isOpen}
onClose={() => setIsOpen(false)}
snapPoints={[0.2, 0.5, 0.9]} // 20%, 50%, 90% of screen height
initialSnap={1} // Start at 50% height
>
<div style={{ padding: '20px' }}>
<h3>Custom Snap Points</h3>
<p>Drag me to different heights!</p>
</div>
</BottomSheet>
);
}
function FormSheet() {
const [isOpen, setIsOpen] = useState(false);
return (
<BottomSheet isOpen={isOpen} onClose={() => setIsOpen(false)}>
<div style={{ padding: '20px' }}>
<h3>Contact Form</h3>
<form onSubmit={(e) => {
e.preventDefault();
// Handle form submission
setIsOpen(false);
}}>
<input type="text" placeholder="Name" required />
<input type="email" placeholder="Email" required />
<textarea placeholder="Message" rows={4} />
<button type="submit">Send</button>
</form>
</div>
</BottomSheet>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | - | Required. Controls bottom sheet visibility |
onClose | () => void | - | Required. Called when user closes the sheet |
children | React.ReactNode | - | Required. Content to display inside the sheet |
snapPoints | number[] | [0.3, 0.8] | Array of snap points as screen height fractions (0-1) |
initialSnap | number | 0 | Index of initial snap point to show |
closeOnDragDown | boolean | true | Allow closing by dragging down from top snap |
closeThreshold | number | 0.3 | Drag distance threshold for close (as fraction) |
velocityThreshold | number | 0.3 | Velocity threshold for fling gestures (pixels/ms) |
import type { BottomSheetProps } from 'react-material-bottom-sheet';
const customProps: BottomSheetProps = {
isOpen: true,
onClose: () => console.log('Closed'),
snapPoints: [0.25, 0.5, 0.75],
initialSnap: 1,
children: <div>Content</div>
};
The component uses CSS custom properties for easy theming:
/* Override default styles */
:root {
--bottom-sheet-background: #ffffff;
--bottom-sheet-border-radius: 16px;
--bottom-sheet-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
--bottom-sheet-handle-color: #e0e0e0;
}
<BottomSheet
isOpen={isOpen}
onClose={() => setIsOpen(false)}
className="my-custom-sheet"
>
{/* Your content */}
</BottomSheet>
.my-custom-sheet {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
npm test
npm run test:e2e
react-material-bottom-sheet/
├── src/
│ ├── BottomSheet.tsx # Main component
│ ├── BottomSheet.css # Styles
│ ├── index.ts # Exports
│ └── __tests__/ # Unit tests
├── example/ # Demo application
├── docs/ # Documentation site
├── dist/ # Built library
└── tests/ # E2E tests
# Clone the repository
git clone https://github.com/sitharaj88/react-material-bottom-sheet.git
cd react-material-bottom-sheet
# Install dependencies
npm install
# Start development server
npm run dev
# Run tests
npm test
# Build for production
npm run build
npm run build
This creates optimized bundles in the dist/ directory.
cd example
npm install
npm run dev
Visit http://localhost:5173 to see the demo.
For comprehensive documentation, API reference, and more examples, visit our documentation site.
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-featurenpm testThis project uses ESLint for code linting. Please run:
npm run lint
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Made with ❤️ by sitharaj88
FAQs
A React component library for Material Design bottom sheets
We found that react-material-bottom-sheet 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.