Docs Components Primitives

Sticker

React example follows below.
ts
const stickerFixture = {
id: "sticker",
items: [
{ label: "What I build", tone: "accent", rotate: -3 },
{ label: "Boring tech", tone: "neutral", rotate: 2 },
{ label: "It just runs", tone: "success", rotate: -1 },
],
} satisfies {
id: string;
items: ReadonlyArray<{
label: string;
tone: "accent" | "neutral" | "success" | "info";
rotate: number;
}>;
};
import { Sticker } from "@grassroot/ui-react";
export default function StickerDemo() {
return (
<div>
{stickerFixture.items.map((item) => (
<Sticker key={item.label} tone={item.tone} rotate={item.rotate}>
{item.label}
</Sticker>
))}
</div>
);
}
ts
<script setup lang="ts">
const stickerFixture = {
id: "sticker",
items: [
{ label: "What I build", tone: "accent", rotate: -3 },
{ label: "Boring tech", tone: "neutral", rotate: 2 },
{ label: "It just runs", tone: "success", rotate: -1 },
],
} satisfies {
id: string;
items: ReadonlyArray<{
label: string;
tone: "accent" | "neutral" | "success" | "info";
rotate: number;
}>;
};
import { Sticker } from "@grassroot/ui-vue";
</script>
<template>
<div>
<Sticker
v-for="item in stickerFixture.items"
:key="item.label"
:tone="item.tone"
:rotate="item.rotate"
>{{ item.label }}</Sticker
>
</div>
</template>
ts
import { Component } from "@angular/core";
const stickerFixture = {
id: "sticker",
items: [
{ label: "What I build", tone: "accent", rotate: -3 },
{ label: "Boring tech", tone: "neutral", rotate: 2 },
{ label: "It just runs", tone: "success", rotate: -1 },
],
} satisfies {
id: string;
items: ReadonlyArray<{
label: string;
tone: "accent" | "neutral" | "success" | "info";
rotate: number;
}>;
};
import { GrassrootSticker } from "@grassroot/ui-angular";
@Component({
selector: "app-sticker-demo",
standalone: true,
imports: [GrassrootSticker],
template: `
<div>
@for (item of fixture.items; track item.label) {
<grassroot-sticker [tone]="item.tone" [rotate]="item.rotate">{{
item.label
}}</grassroot-sticker>
}
</div>
`,
})
export class StickerDemoComponent {
protected readonly fixture = stickerFixture;
}
export default StickerDemoComponent;
ts
<script lang="ts">
const stickerFixture = {
id: "sticker",
items: [
{ label: "What I build", tone: "accent", rotate: -3 },
{ label: "Boring tech", tone: "neutral", rotate: 2 },
{ label: "It just runs", tone: "success", rotate: -1 },
],
} satisfies {
id: string;
items: ReadonlyArray<{
label: string;
tone: "accent" | "neutral" | "success" | "info";
rotate: number;
}>;
};
import { Sticker } from "@grassroot/ui-svelte";
</script>
<div>
{#each stickerFixture.items as item (item.label)}
<Sticker tone={item.tone} rotate={item.rotate}>{item.label}</Sticker>
{/each}
</div>
ts
/** @jsxImportSource solid-js */
import { Sticker } from "@grassroot/ui-solid";
const stickerFixture = {
id: "sticker",
items: [
{ label: "What I build", tone: "accent", rotate: -3 },
{ label: "Boring tech", tone: "neutral", rotate: 2 },
{ label: "It just runs", tone: "success", rotate: -1 },
],
} satisfies {
id: string;
items: ReadonlyArray<{
label: string;
tone: "accent" | "neutral" | "success" | "info";
rotate: number;
}>;
};
export default function StickerDemo() {
return (
<div>
{stickerFixture.items.map((item) => (
<Sticker tone={item.tone} rotate={item.rotate}>
{item.label}
</Sticker>
))}
</div>
);
}

Installation

API Reference

Import

import { Sticker } from "@grassroot/ui-react";

Props

Prop
Type
Default
Requirement
Description
tone
"info" | "success" | "neutral" | "accent" | undefined
"accent"
optional
rotate
number | undefined
-2
optional
Degrees of rotation for the tilt.
Prop
tone
Type
"info" | "success" | "neutral" | "accent" | undefined
Default
"accent"
Requirement
optional
Description
Prop
rotate
Type
number | undefined
Default
-2
Requirement
optional
Description
Degrees of rotation for the tilt.

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { Sticker } from "@grassroot/ui-vue";

Props

Prop
Type
Default
Requirement
tone
"accent" | "neutral" | "success" | "info" | undefined
"accent"
optional
rotate
number | undefined
-2
optional
Prop
tone
Type
"accent" | "neutral" | "success" | "info" | undefined
Default
"accent"
Requirement
optional
Prop
rotate
Type
number | undefined
Default
-2
Requirement
optional

Content regions

  • default

Import

import { Component } from "@angular/core";
import { GrassrootSticker } from "@grassroot/ui-angular";

Props

Prop
Type
Default
Requirement
tone
StickerTone
"accent"
optional
rotate
number
-2
optional
Prop
tone
Type
StickerTone
Default
"accent"
Requirement
optional
Prop
rotate
Type
number
Default
-2
Requirement
optional

Content regions

  • default

Import

import { Sticker } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
tone
StickerTone
"accent"
optional
rotate
number
-2
optional
Prop
tone
Type
StickerTone
Default
"accent"
Requirement
optional
Prop
rotate
Type
number
Default
-2
Requirement
optional

Content regions

  • children

Import

import { Sticker } from "@grassroot/ui-solid";

Props

Prop
Type
Default
Requirement
tone
StickerTone
optional
rotate
number
optional
Prop
tone
Type
StickerTone
Default
Requirement
optional
Prop
rotate
Type
number
Default
Requirement
optional

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.