Components

NavigationElement

<NavigationElement />

This component is responsible for rendering elements on the sidebar navigation.

Usage

import { NavigationElement } from '@admin-bro/design-system'

return (
  <NavigationElement
    href="#"
    open={true}
    isSelected={false}
    icon='Car'
    label="Cars"
    onClick={(event, props) => {console.log(event, props)}}
  />
)

Prop types

By default all the data are passed via NavigationElementProps - check them out below.

Example

This is a working example of a NavigationElement:

New:
  • In version 3.3
See:

View Source admin-bro-design-system/src/molecules/navigation-element/navigation-element.tsx, line 20

Type Definitions

Handler function for a NavigationElementProps['onClick']

Parameters:
Name Type Description
event React.MouseEvent.<HTMLAnchorElement, MouseEvent>

React.MouseEvent

props NavigationElementProps

All props (along with the id) are also passed to the handler

View Source admin-bro-design-system/src/molecules/navigation-element/navigation-element-props.ts, line 4

object

Prop Types of a NavigationElement component.

Properties:
Name Type Attributes Description
href string <optional>

Link href property

icon string <optional>

Icon name

isOpen boolean <optional>

Indicates if navigation element should be open(able). If set to undefined: element wont be, "openable". Tf set to either false or true - element will be open or close.

isSelected boolean <optional>

If element should be selected

label string

Label of the element

id string <optional>

Element uniq ID

onClick NavigationElementOnClickHandler <optional>

On Click handler

View Source admin-bro-design-system/src/molecules/navigation-element/navigation-element-props.ts, line 13

SoftwareBrothers

Proudly built and maintained by SoftwareBrothers

Software House with a passion for both JavaScript and TypeScript.

See what we do See what we believe in

Proudly built and maintained by

SoftwareBrothers