@neynar/ui
Version:
React UI component library built on shadcn/ui and Tailwind CSS
49 lines (39 loc) • 1.04 kB
Markdown
# SidebarTrigger
**Type**: component
Interactive button component for toggling sidebar visibility A pre-styled button that toggles the sidebar between expanded and collapsed states on desktop, or opens/closes the mobile sheet overlay on smaller screens. Features a panel icon and proper accessibility attributes.
## JSX Usage
```jsx
import { SidebarTrigger } from '@neynar/ui';
<SidebarTrigger
className="value"
onClick={handleClick}
/>
```
## Component Props
### className
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### onClick
- **Type**: `(event: React.MouseEvent<HTMLButtonElement>) => void`
- **Required**: No
- **Description**: No description available
## Examples
### Example 1
```tsx
// Basic usage in header
<header className="flex items-center gap-2 p-4">
<SidebarTrigger />
<h1>My Application</h1>
</header>
```
### Example 2
```tsx
// With custom click handler
<SidebarTrigger
onClick={(e) => {
console.log('Sidebar toggled')
// Additional logic here
}}
/>
```