Chips (Tags) React component represent complex entities in small blocks, such as a contact. They can contain a photo, short title string, and brief information
Chip Components
There are following components included:
Chip
Name | Type | Default | Description |
---|---|---|---|
colors | object | Object with Tailwind CSS colors classes | |
colors.fillBgIos | string | 'bg-black bg-opacity-10 dark:bg-white dark:bg-opacity-10' | |
colors.fillBgMaterial | string | 'bg-md-light-secondary-container dark:bg-md-dark-secondary-container' | |
colors.fillTextIos | string | 'text-current' | |
colors.fillTextMaterial | string | 'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container' | |
colors.outlineBorderIos | string | 'border-black border-opacity-20 dark:border-white dark:border-opacity-20' | |
colors.outlineBorderMaterial | string | 'border-md-light-outline dark:border-md-dark-outline' | |
colors.outlineTextIos | string | 'text-current' | |
colors.outlineTextMaterial | string | 'text-md-light-on-surface dark:text-md-dark-on-surface' | |
component | string | 'div' | Component's HTML Element |
deleteButton | boolean | false | Defines whether the Chip has additional "delete" button or not |
media | ReactNode | Content of the chip media area (e.g. icon) | |
outline | boolean | false | Makes chip outline |
onDelete | function(e) | Event will be triggered on Chip delete button click |
import React from 'react';import {Page,Navbar,NavbarBackLink,Chip,Block,BlockTitle,} from 'konsta/react';export default function ChipsPage() {return (<Page><Navbartitle="Chips"/><BlockTitle>Chips With Text</BlockTitle><Block strongIos outlineIos><Chip className="m-0.5">Example Chip</Chip><Chip className="m-0.5">Another Chip</Chip><Chip className="m-0.5">One More Chip</Chip><Chip className="m-0.5">Fourth Chip</Chip><Chip className="m-0.5">Last One</Chip></Block><BlockTitle>Outline Chips</BlockTitle><Block strongIos outlineIos><Chip outline className="m-0.5">Example Chip</Chip><Chip outline className="m-0.5">Another Chip</Chip><Chip outline className="m-0.5">One More Chip</Chip><Chip outline className="m-0.5">Fourth Chip</Chip><Chip outline className="m-0.5">Last One</Chip></Block><BlockTitle>Contact Chips</BlockTitle><Block strongIos outlineIos><ChipclassName="m-0.5"media={<imgalt="avatar"className="ios:h-7 material:h-6 rounded-full"src="https://cdn.framework7.io/placeholder/people-100x100-9.jpg"/>}>Jane Doe</Chip><ChipclassName="m-0.5"media={<imgalt="avatar"className="ios:h-7 material:h-6 rounded-full"src="https://cdn.framework7.io/placeholder/people-100x100-3.jpg"/>}>John Doe</Chip><ChipclassName="m-0.5"media={<imgalt="avatar"className="ios:h-7 material:h-6 rounded-full"src="https://cdn.framework7.io/placeholder/people-100x100-7.jpg"/>}>Adam Smith</Chip></Block><BlockTitle>Deletable Chips / Tags</BlockTitle><Block strongIos outlineIos><ChipclassName="m-0.5"deleteButtononDelete={() => console.log('Delete Chip')}>Example Chip</Chip><ChipclassName="m-0.5"deleteButtononDelete={() => console.log('Delete Chip')}media={<imgalt="avatar"className="ios:h-7 material:h-6 rounded-full"src="https://cdn.framework7.io/placeholder/people-100x100-7.jpg"/>}>Adam Smith</Chip></Block><BlockTitle>Color Chips</BlockTitle><Block strongIos outlineIos><ChipclassName="m-0.5"colors={{ fillBg: 'bg-red-500', fillText: 'text-white' }}>Red Chip</Chip><ChipclassName="m-0.5"colors={{ fillBg: 'bg-green-500', fillText: 'text-white' }}>Green Chip</Chip><ChipclassName="m-0.5"colors={{ fillBg: 'bg-blue-500', fillText: 'text-white' }}>Blue Chip</Chip><ChipclassName="m-0.5"colors={{ fillBg: 'bg-yellow-500', fillText: 'text-white' }}>Yellow Chip</Chip><ChipclassName="m-0.5"colors={{ fillBg: 'bg-pink-500', fillText: 'text-white' }}>Pink Chip</Chip><ChipclassName="m-0.5"outlinecolors={{outlineBorder: 'border-red-500',outlineText: 'text-red-500',}}>Red Chip</Chip><ChipclassName="m-0.5"outlinecolors={{outlineBorder: 'border-green-500',outlineText: 'text-green-500',}}>Green Chip</Chip><ChipclassName="m-0.5"outlinecolors={{outlineBorder: 'border-blue-500',outlineText: 'text-blue-500',}}>Blue Chip</Chip><ChipclassName="m-0.5"outlinecolors={{outlineBorder: 'border-yellow-500',outlineText: 'text-yellow-500',}}>Yellow Chip</Chip><ChipclassName="m-0.5"outlinecolors={{outlineBorder: 'border-pink-500',outlineText: 'text-pink-500',}}>Pink Chip</Chip></Block></Page>);}