Skip to content

Bottom Navigation Compound

The bottom navigation component that offers global, persistent navigation throughout an app.

Importing

To use the bottom navigation component, first you need to register the component inside the page. You can register the component manually by importing the register function:

ts
import { register } from "@tapsioss/web-components/bottom-navigation";

register(); // Now the bottom navigation component is ready to use!
ts
import { registerBottomNavigation } from "@tapsioss/web-components";

registerBottomNavigation(); // Now the bottom navigation component is ready to use!

Also you can automatically register the component by importing it with the following approach:

ts
import "@tapsioss/web-components/bottom-navigation/element";

TIP

If you want to use all the component in your app, you can call registerAll at the root of your project.

ts
import { registerAll } from "@tapsioss/web-components";

registerAll(); // All the components are now available

INFO

By registering the bottom navigation component, its compound parts will also be registered:

  • tapsi-bottom-navigation-item

In the React package, you can easily add the component using the following code:

ts
import { BottomNavigation } from "@tapsioss/react-components";

Component Usage

html
<tapsi-bottom-navigation></tapsi-bottom-navigation>
tsx
<BottomNavigation />

Properties

NameAttribute NameDescriptionTypeDefault Value
labellabelDefines a string value that can be used to set a label
for assistive technologies.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
string""

Slots

NameValueDescription
DEFAULT-The default slot for navigation items.

TIP

The value of slots are available for developer as JavaScript Variables:

ts
// Option 1
import { BottomNavigationSlots, BottomNavigationItemSlots } from "@tapsioss/web-components";

// Option 2
import { Slots, ItemSlots } from "@tapsioss/web-components/bottom-navigation";
ts
// Option 1
import { BottomNavigationSlots, BottomNavigationItemSlots } from "@tapsioss/react-components";

// Option 2
import { Slots, ItemSlots } from "@tapsioss/react-components/BottomNavigation";

Events

NameDescriptionTypeBubblesCancelable
activechangeFired when the items activation state changes.ActiveChangeEvent

TIP

Event details are available as JavaScript variables:

ts
// Option 1
import {
 ActiveChangeEvent
} from "@tapsioss/web-components/bottom-navigation";

// Option 2
import {
 BottomNavigationActiveChangeEvent
} from "@tapsioss/web-components";

You can have access to the event name using the type property:

ts
// Option 1
element.addEventListener(ActiveChangeEvent.type, handleActiveChange);

// Option 2
element.addEventListener(BottomNavigationActiveChangeEvent.type, handleActiveChange);

Compound Parts

Item

The item part of the bottom navigation.

Importing

By registering the parent component, the bottom navigation item will also be registered.

In the React package, you can easily add the component using the following code:

ts
import { BottomNavigationItem } from "@tapsioss/react-components";

Component Usage

html
<tapsi-bottom-navigation-item></tapsi-bottom-navigation-item>
tsx
<BottomNavigationItem />

Properties

NameAttribute NameDescriptionTypeDefault Value
activeactiveWhether the item is active or not.booleanfalse
valuevalueThe value associated with the item.
This value has to be unique among sibling items.
string""

Slots

NameValueDescription
DEFAULT-The slot for the icon element.
ICONiconThe slot for the icon element.

Created with 🧡