Menu List is an extension of List View. Menu List unlike usual links list is designed to indicate currently active screen (or section) of your app. Think about it like a Tabbar but in a form of a list.
There are following components included:
MenuList
- menu list componentMenuListItem
- menu list item elementMenuList
component doesn't have specific props, but as it extends List
component, it supports all List
props
MenuListItem
component extends ListItem
component, it supports all ListItem
props and the following additional props:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | false | Makes menu list item highlighted (active) |
href | string | boolean | Menu list item link's | |
media | ReactNode | Content of the chip media area (e.g. icon) | |
subtitle | ReactNode | Content of the menu list item "subtitle" area |
import React, { useState } from 'react';import {Page,Navbar,NavbarBackLink,Block,MenuList,MenuListItem,} from 'konsta/react';import DemoIcon from '../components/DemoIcon';export default function MenuListPage() {const [selected, setSelected] = useState('home');const [selectedMedia, setSelectedMedia] = useState('home');return (<Page><Navbartitle="Menu List"/><Block strong inset><p>Menu list unlike usual links list is designed to indicate currentlyactive screen (or section) of your app. Think about it like a Tabbarbut in a form of a list.</p></Block><MenuList strongIos outlineIos><MenuListItemtitle="Home"active={selected === 'home'}onClick={() => setSelected('home')}media={<DemoIcon />}/><MenuListItemtitle="Profile"active={selected === 'profile'}onClick={() => setSelected('profile')}media={<DemoIcon />}/><MenuListItemtitle="Settings"active={selected === 'settings'}onClick={() => setSelected('settings')}media={<DemoIcon />}/></MenuList><MenuList strongIos outlineIos><MenuListItemtitle="Home"subtitle="Home subtitle"active={selectedMedia === 'home'}onClick={() => setSelectedMedia('home')}media={<DemoIcon />}/><MenuListItemtitle="Profile"subtitle="Profile subtitle"active={selectedMedia === 'profile'}onClick={() => setSelectedMedia('profile')}media={<DemoIcon />}/><MenuListItemtitle="Settings"subtitle="Settings subtitle"active={selectedMedia === 'settings'}onClick={() => setSelectedMedia('settings')}media={<DemoIcon />}/></MenuList></Page>);}