A pack of extensions for grommet 2
created:7/7/2021
updated:7/7/2021
loc
99
comments
3%
passed
12
failed
12
coverage
50%

Tag

Component

import { Tag } from 'grommet-controls';

Round

() => (
<Tag round="medium" background="accent-2" label="round" />
)

Commits

Date
Author
Commit Message
8/31/2020

atanasster

avatar of atanasster
update stories titles and navigation
8/30/2020

atanasster

avatar of atanasster
update eslint and add component-controls
2/9/2020

atanasster

avatar of atanasster
formatting
12/7/2019

atanasster

avatar of atanasster
ts cleanup
10/24/2019

atanasster

avatar of atanasster
typescript fixes
8/27/2019

atanasster

avatar of atanasster
initial commit 2.x alpha
6 commits

External dependencies

package
imports
peer
grommet
^2.15.0
TextKeyboard
*
FormClose
*
react
^17.0.1
React
*
ThemeContext
*

Internal dependencies

file
imports
"./StyledTag"
StyledTagStyledIcon
"./TagProps"
ITagProps

Component JSX

<Keyboard
onEnteronSpace
>
grommet
^2.15.0
<ThemeContext.Consumer
>

Stories

Main

props => <Tag {...props} />

A 11 Y Title

() => <Tag a11yTitle="Tag component" />

Icon

() => <Tag icon={<FormSubtract />} />

Disabled

() => <Tag disabled={true} label="Disabled" />

Focusable

() => (
<Tag focusable={false} label="Cant focus" />
)

Background

() => (
<Tag background="accent-1" label="accent-1" />
)

Border

() => (
<Tag
border={{
side: 'all',
size: 'medium',
color: 'accent-1',
}}
round="medium"
label="border"
/>
)

On Click

() => (
<Tag onClick={() => console.log('onClick')} />
)

On Change

() => {
const [iconIndex, setIconIndex] = React.useState(0);
const onToggle = () => {
setIconIndex(1 - iconIndex);
};
return (
<Tag
icon={tagIcons[iconIndex]}
onClick={() => console.log('onClick')}
onChange={onToggle}
/>
);
}

Reverse

() => <Tag reverse={true} label="Adam" />

Size

() => <Tag size="large" label="Large" />