
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
@zohabulhassan/sidebar
Advanced tools
A customizable React sidebar component with tabs and menu items, crafted by Zohab
Sidebar Navigation Component Guide body { font-family: Arial, sans-serif; line-height: 1.6; padding: 20px; } h1, h2 { color: #333; } pre { background-color: #f8f9fa; padding: 10px; border-radius: 5px; border: 1px solid #ccc; white-space: pre-wrap; word-wrap: break-word; } .code-example { margin-top: 20px; padding: 20px; background-color: #f8f9fa; border: 1px solid #ccc; border-radius: 5px; }
The Sidebar component is a customizable, responsive navigation sidebar for React applications. It features a tabbed interface, nested menu items, and seamless integration with Bootstrap for responsive layouts. It is ideal for dashboards, admin panels, or any application requiring hierarchical navigation.
bootstrap/dist/css/bootstrap.min.css
) for stylingstyles.css
) for sidebar-specific stylesEnsure Sidebar.jsx
is in your project’s src
directory.
Copy the provided styles.css
to your project’s src
directory.
Install Bootstrap via npm:
npm install bootstrap
Alternatively, add it via CDN in your index.html
:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
import Sidebar from './Sidebar';
import './styles.css';
import 'bootstrap/dist/css/bootstrap.min.css';
The Sidebar component is typically used alongside a main content area. Here’s an example:
import React, { useState } from 'react';
import Sidebar from './Sidebar';
import './styles.css';
import 'bootstrap/dist/css/bootstrap.min.css';
const tabs = [
{
key: 'home',
label: 'Home',
menuItems: [
{ key: 'dashboard', text: 'Dashboard', onClick: () => console.log('Dashboard clicked') },
{ key: 'settings', text: 'Settings', onClick: () => console.log('Settings clicked') },
{
key: 'help',
text: 'Help',
subItems: [
{ key: 'faq', text: 'FAQ', onClick: () => console.log('FAQ clicked') },
{ key: 'contact', text: 'Contact Us', onClick: () => console.log('Contact clicked') },
],
},
],
},
{
key: 'tools',
label: 'Tools',
menuItems: [
{ key: 'analytics', text: 'Analytics', onClick: () => console.log('Analytics clicked') },
// Additional menu items...
],
},
];
const handleNavigate = (key) => {
console.log(\`Navigating to: \${key}\`);
};
function App() {
const [activeKey, setActiveKey] = useState('dashboard');
return (
<div className="d-flex flex-column flex-md-row min-vh-100">
<Sidebar
tabs={tabs}
activeKey={activeKey}
setActiveKey={setActiveKey}
logoSrc="https://placehold.co/65/png"
logoText="MyApp"
onNavigate={handleNavigate}
glow={false}
/>
<div className="main-content flex-grow-1 p-3 p-md-4">
{/* Main content goes here */}
</div>
</div>
);
}
export default App;
Prop
Type
Description
Default
tabs
Array
Array of tab objects with `key`, `label`, and `menuItems`.
[]
activeKey
String
The key of the currently active menu item.
''
setActiveKey
Function
Function to update the `activeKey` state.
() => {}
logoSrc
String
URL or path to the logo image.
''
logoText
String
Text displayed next to the logo.
''
onNavigate
Function
Callback triggered when a menu item is clicked, receives the key.
() => {}
glow
Boolean
Enables/disables the glow animation on menu item icons/letters.
false
Each tab object in the tabs
array follows this structure:
{
key: String, // Unique identifier for the tab
label: String, // Display text for the tab
menuItems: Array // Array of menu items
}
Each menu item in menuItems
follows this structure:
{
key: String, // Unique identifier for the menu item
text: String, // Display text for the menu item
onClick: Function, // Callback function for click events
subItems: Array, // (Optional) Array of sub-menu items (same structure)
icon: String // (Optional) Icon class (e.g., 'eye' for Bootstrap icons)
}
The sidebar’s appearance is controlled by styles.css
, which defines:
#1F2A44 → #3A4A6E
)#D4A017
) for active states and bordersmax-width: 1000px
)<div className="d-flex flex-column flex-md-row">
<!-- Sidebar + Main Content -->
</div>
styles.css
is imported after Bootstrap.glow={false}
on low-performance devices to disable animations.The Sidebar component is licensed under the MIT License. Feel free to use, modify, and distribute it with attribution.
Maintainer / Developer
Name: Zohab Ul Hassan
Email: zohabulhassan@gmail.com
For source code access, feature requests, or contributions, please contact the development team or open an issue on GitHub.
Last updated: April 16, 2025
FAQs
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
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.