There are following components included:
Icon
Name | Type | Default | Description |
---|---|---|---|
badge | ReactNode | Icon badge | |
badgeColors | object | Badge colors. Object with Tailwind CSS colors classes | |
badgeColors.bg | string | 'bg-primary' | Badge bg color |
badgeColors.text | string | 'text-white' | Badge text color |
component | string | 'i' | Component's HTML Element |
ios | ReactNode | Icon to render in "ios" theme | |
material | ReactNode | Icon to render in "material" theme |
import React from 'react';import {Page,Navbar,NavbarBackLink,Badge,Icon,Link,List,ListItem,Tabbar,TabbarLink,} from 'konsta/react';import {PersonCircleFill,EnvelopeFill,Calendar,CloudUploadFill,} from 'framework7-icons/react';import { MdPerson, MdEmail, MdToday, MdFileUpload } from 'react-icons/md';import DemoIcon from '../components/DemoIcon';export default function BadgePage() {return (<Page><Navbartitle="Badge"right={<Link navbar iconOnly><Iconios={<PersonCircleFill className="w-7 h-7" />}material={<MdPerson className="w-6 h-6" />}badge="5"badgeColors={{ bg: 'bg-red-500' }}/></Link>}/><Tabbar labels icons className="left-0 bottom-0 fixed"><TabbarLinkactiveicon={<Iconios={<EnvelopeFill className="w-7 h-7" />}material={<MdEmail className="w-6 h-6" />}badge="5"badgeColors={{ bg: 'bg-green-500' }}/>}label="Inbox"/><TabbarLinkicon={<Iconios={<Calendar className="w-7 h-7" />}material={<MdToday className="w-6 h-6" />}badge="7"badgeColors={{ bg: 'bg-red-500' }}/>}label="Calendar"/><TabbarLinkicon={<Iconios={<CloudUploadFill className="w-7 h-7" />}material={<MdFileUpload className="w-6 h-6" />}badge="1"badgeColors={{ bg: 'bg-red-500' }}/>}label="Upload"/></Tabbar><List strong inset><ListItemmedia={<DemoIcon />}title="Foo Bar"after={<Badge colors={{ bg: 'bg-gray-500' }}>0</Badge>}/><ListItemmedia={<DemoIcon />}title="Ivan Petrov"after={<Badge>CEO</Badge>}/><ListItemmedia={<DemoIcon />}title="John Doe"after={<Badge colors={{ bg: 'bg-green-500' }}>5</Badge>}/><ListItemmedia={<DemoIcon />}title="Jane Doe"after={<Badge colors={{ bg: 'bg-yellow-500' }}>NEW</Badge>}/></List></Page>);}