Skip to content
silverpoint
Documentation menu

UI components · Data display

Tag

A framed, toned label; closable. Group: Data display · component 12 of 17, new in silverpoint 0.3.
draft
size="lg"
draft
mode="precision"
draft
substrate="green"

States

The 2 reference states silverpoint declares for Tag, live on both grounds, with their code. As in upstream's documentation the examples are uncontrolled: the state's value is the default value. Pick a framework once and every example on the site follows it.

tone-1

draft
silverpoint · cream
draft
cyanotype · prussian
tsx
import '@silverpoint/fonts/fonts.css';
import '@silverpoint/grounds/styles.css';
import '@silverpoint/grounds/ui.css';
import { SpTag } from '@silverpoint/react/ui/tag';

<SpTag tone={1}>draft</SpTag>

closable

review
silverpoint · cream
review
cyanotype · prussian
tsx
import '@silverpoint/fonts/fonts.css';
import '@silverpoint/grounds/styles.css';
import '@silverpoint/grounds/ui.css';
import { SpTag } from '@silverpoint/react/ui/tag';

<SpTag tone={3} closable>review</SpTag>

Import

Each component has its own subpath under ui/, and every adapter exports them all from ui. Import @silverpoint/grounds/ui.css once, beside styles.css; Reflex adds it for you.

FrameworkImport
Reactimport { SpTag } from '@silverpoint/react/ui/tag';
Vueimport { SpTag } from '@silverpoint/vue/ui/tag';
Angularimport { SpTag } from '@silverpoint/angular/ui/tag'; // <sp-tag>
Reflexfrom reflex_silverpoint_react import sp_tag

Props

The props Tag adds to the ones every UI component takes.

React / AngularVueReflexTypeDescription
tonetonetoneLiteral[1, 2, 3, 4]Tonal level 1 to 4 (1 by default).
closableclosableclosableboolAdds a native close button, which fires on_close.
closeLabelclose-labelclose_labelstrAccessible name of the close button (Remove <text> by default).
onCloseon-closeon_closeeventThe close button was clicked.

Common props

Every UI component also takes these. Like a chart's, they fall back to the dashboard the component sits in, then to the provider. Read more about the UI components.

React / AngularVueReflexTypeDescription
idididstrThe frame variant and every related id derive from it.
groundgroundgroundLiteral['silverpoint', 'cyanotype'] | str | dict[str, Any]Style ground: "silverpoint" or "cyanotype", or a ground object. Defaults to the dashboard's, then the provider's, or silverpoint.
substratesubstratesubstrateLiteral['cream', 'green', 'blue', 'ochre', 'prussian']Prepared substrate within the ground.
modemodemodeLiteral['ink', 'precision']ink by default; precision disables inking.
seedseedseedstr | intSeed of the frame's hand; overrides id for the frame variant only.
sizesizesizeLiteral['sm', 'md', 'lg']Control size: sm, md (default) or lg.
palettepalettepalettedict[str, str]Colours over the ground's (set with palette=), merged over the dashboard's and the provider's.
classNameclass-nameclass_namestrAdded to the component's root element, after its own classes.
Report it
Found something wrong with SpTag? Open an issue on GitHub — the form comes pre-filled with the component and the version.