Start small
Publish one component today. A page that exists beats a plan that does not.
All components · Category: Carousels and showcases
A pile of cards you flick away, with the keyboard as an equal.
Flick the top card left or right and it goes to the back of the pile. The same action is on the arrow keys and on visible buttons, with an undo, so nothing depends on dragging.
01
Props
Generated from the component's manifest and the values above.
index.html
<card-stack-swipe locale="en"></card-stack-swipe>
<script>
const element = document.querySelector("card-stack-swipe");
element.addEventListener("card-stack-swipe:swiped", (event) => {
console.log(event.detail);
});
</script>
taggor-component.js
const element = document.createElement("card-stack-swipe");
element.setAttribute("locale", "en");
element.addEventListener("card-stack-swipe:swiped", (event) => {
console.log(event.detail);
});
document.body.append(element);
CardStackSwipe.tsx
import { useEffect, useRef } from "react";
export function CardStackSwipe() {
const ref = useRef<HTMLElement>(null);
useEffect(() => {
const element = ref.current;
if (!element) return;
const onSwiped = (event: Event) => {
console.log((event as CustomEvent).detail);
};
element.addEventListener("card-stack-swipe:swiped", onSwiped);
return () => {
element.removeEventListener("card-stack-swipe:swiped", onSwiped);
};
}, []);
return <card-stack-swipe ref={ref} locale="en" />;
}
CardStackSwipe.tsx
import { useEffect, useRef } from "react";
export function CardStackSwipe() {
const ref = useRef<HTMLElement>(null);
useEffect(() => {
const element = ref.current;
if (!element) return;
const onSwiped = (event: Event) => {
console.log((event as CustomEvent).detail);
};
element.addEventListener("card-stack-swipe:swiped", onSwiped);
return () => {
element.removeEventListener("card-stack-swipe:swiped", onSwiped);
};
}, []);
return <card-stack-swipe ref={ref} locale="en" />;
}
src/CardStackSwipe.vue
<script setup lang="ts">
function onSwiped(event: Event) {
console.log((event as CustomEvent).detail);
}
</script>
<template>
<card-stack-swipe locale="en" @card-stack-swipe:swiped="onSwiped" />
</template>
vite.config.ts
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag === "card-stack-swipe",
},
},
}),
],
});
src/app/card-stack-swipe.component.ts
import { afterNextRender, Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, ElementRef, inject } from "@angular/core";
@Component({
selector: "app-card-stack-swipe",
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<card-stack-swipe locale="en"></card-stack-swipe>
`,
})
export class CardStackSwipeComponent {
constructor() {
const host = inject<ElementRef<HTMLElement>>(ElementRef);
const element = () => host.nativeElement.querySelector("card-stack-swipe");
const onSwiped = (event: Event) => {
console.log((event as CustomEvent).detail);
};
afterNextRender(() => element()?.addEventListener("card-stack-swipe:swiped", onSwiped));
inject(DestroyRef).onDestroy(() => element()?.removeEventListener("card-stack-swipe:swiped", onSwiped));
}
}
src/TaggorComponent.svelte
<script>
function onSwiped(event) {
console.log(event.detail);
}
</script>
<card-stack-swipe locale="en" oncard-stack-swipe:swiped={onSwiped}></card-stack-swipe>
How an agent gets a component like this onto a site:
taggor checktaggor publishThe CSS variables the component exposes, set the way a customer's page would.
styles.css
card-stack-swipe {
--cs-radius: 20px;
}02
| Prop | Type | Default | What it does |
|---|---|---|---|
| cards | list | none | The cards; the component's own tips when empty. |
| locale | pt-BR | en | en | – |
Prop names and descriptions are the component's own, in English, as its author wrote them.
03
| Event | When it fires |
|---|---|
| swiped | A card was sent to the back. |
04
Paste this into your agent. It asks you before it signs in, pays or goes further than checking and publishing.
Build me a Taggor component like "Swipeable card stack" (card-stack-swipe): A pile of cards you flick away, with the keyboard as an equal.
Fetch https://taggor.dev/agent-setup/prompt.md and follow its instructions to set me up for Taggor. Ask me before you sign in, create an account, accept terms, pay for anything or type a secret.
Check it with `taggor check` and publish it with `taggor publish`, and stop there.
Do not promote it to production, attach it to a site, roll back anything or use --yes, --force or --force-drop-invalid unless I ask for exactly that in this conversation.
05