ASCII-styled navigation bar with brackets around menu items and optional brand text.
npm install react-ascii-ui
import { AsciiNavbar } from 'react-ascii-ui'; export default function Example() { const items = [ { label: 'Home', href: '/', active: true }, { label: 'About', href: '/about' }, { label: 'Contact', href: '/contact' } ]; return ( <AsciiNavbar items={items} brand="MyApp" /> ); }
<AsciiNavbar items={[ { label: 'Home', href: '#', active: true }, { label: 'About', href: '#' }, { label: 'Services', href: '#' } ]} />
<AsciiNavbar items={[ { label: 'Dashboard', href: '#', active: true }, { label: 'Users', href: '#' }, { label: 'Settings', href: '#' } ]} brand="Admin Panel" />
<AsciiNavbar items={[ { label: 'Home', onClick: () => handleNavigation('home'), active: activeItem === 'home' }, { label: 'About', onClick: () => handleNavigation('about'), active: activeItem === 'about' } ]} brand="Interactive" />
<AsciiNavbar items={[ { label: 'Home', href: '/' }, { label: 'Shop', href: '/shop', active: true }, { label: 'Cart', onClick: () => openCart() }, { label: 'Account', onClick: () => showAccountMenu() } ]} brand="E-Shop" />
Prop | Type | Default | Description |
---|---|---|---|
items | AsciiNavbarItem[] | - | Array of navigation items |
brand | string | - | Optional brand text displayed on the left |
className | string | "" | Additional CSS classes |
Property | Type | Required | Description |
---|---|---|---|
label | string | Yes | Text label for the navigation item |
href | string | No | URL for navigation link (creates anchor tag) |
onClick | () => void | No | Click handler function (creates button) |
active | boolean | No | Whether this item is currently active |
AsciiNavbar extends all HTML nav element attributes and supports all React nav props.