Tag
A short label, optionally removable.
SourceStyles source@monoline/react 0.4.0Markdown for AI toolsstable
- Built on native elements
- The remove control is a real button named "Remove <label>".
- Styles in one file:
19-avatar.css
Import
import '@monoline/css';
import {Tag} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add tag
Usage
import {Tag} from '@monoline/react';
<Tag>design</Tag>
Examples
Plain
Removable
Props
TagProps
| Prop | Type | Default | Description |
|---|---|---|---|
onRemove | (() => void) | – | Shows a remove button and calls this when it is pressed. |
label | string | – | Text used in the remove button's name: "Remove <label>". Defaults to the child text. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.avatar | 19-avatar.css |
.avatar-group | 19-avatar.css |
.avatar-lg | 19-avatar.css |
.avatar-line | 19-avatar.css |
.avatar-sm | 19-avatar.css |
.stat | 19-avatar.css |
.stat-note | 19-avatar.css |
.stat-value | 19-avatar.css |
.tag | 19-avatar.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.avatar {
border-color: var(--accent);
}
Try the props
Change a prop and the component above updates; the code below is what you would write. To edit the code itself, use the Playground.
design
example.tsx
<Tag>design</Tag>
Accessibility
- The remove control is a real button named "Remove <label>".