A collapsible sidebar navigation component with ASCII styling and bracket notation.
Current section: dashboard
Click on sidebar items to see active state changes. The sidebar uses bracket notation and supports icons, active states, and click handlers.
npm install react-ascii-ui
import { AsciiSidebar } from 'react-ascii-ui';
const items = [
{
label: 'Dashboard',
onClick: () => console.log('Dashboard clicked'),
active: true,
icon: '⬢'
},
{
label: 'Users',
href: '/users',
icon: '👤'
}
];
export default function App() {
return (
<AsciiSidebar
title="My App"
items={items}
width="w-64"
/>
);
}Selected: None
These items are links that will navigate to different pages.
| Prop | Type | Default | Description |
|---|---|---|---|
| items | AsciiSidebarItem[] | - | Array of sidebar items |
| title | string | undefined | Optional sidebar title |
| width | string | "w-64" | Sidebar width class |
| className | string | "" | Additional CSS classes |
| Property | Type | Description |
|---|---|---|
| label | string | Display text for the item |
| href | string | Optional link URL |
| onClick | () => void | Optional click handler |
| active | boolean | Whether item is active |
| icon | string | Optional icon character |