Skip to content

Commit 35dc814

Browse files
Merge pull request #65 from trophyso/ui-kit-page
UI kit page
2 parents 8d5ae43 + 9544227 commit 35dc814

8 files changed

Lines changed: 199 additions & 41 deletions

File tree

assets/uikit/hero.png

112 KB
Loading

assets/uikit/streaks_examples.png

86.3 KB
Loading

docs.json

Lines changed: 58 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,30 @@
4848
{
4949
"language": "en",
5050
"default": true,
51+
"global": {
52+
"anchors": [
53+
{
54+
"anchor": "GitHub",
55+
"href": "https://github.com/trophyso",
56+
"icon": "github"
57+
},
58+
{
59+
"anchor": "Status",
60+
"href": "https://status.trophy.so",
61+
"icon": "radio-tower"
62+
},
63+
{
64+
"anchor": "llms.txt",
65+
"href": "https://docs.trophy.so/llms-full.txt",
66+
"icon": "bot"
67+
},
68+
{
69+
"anchor": "Help",
70+
"href": "mailto:support@trophy.so",
71+
"icon": "life-buoy"
72+
}
73+
]
74+
},
5175
"tabs": [
5276
{
5377
"tab": "Home",
@@ -330,28 +354,13 @@
330354
]
331355
}
332356
]
333-
}
334-
],
335-
"anchors": [
336-
{
337-
"anchor": "GitHub",
338-
"href": "https://github.com/trophyso",
339-
"icon": "github"
340-
},
341-
{
342-
"anchor": "Status",
343-
"href": "https://status.trophy.so",
344-
"icon": "radio-tower"
345357
},
346358
{
347-
"anchor": "llms.txt",
348-
"href": "https://docs.trophy.so/llms-full.txt",
349-
"icon": "bot"
350-
},
351-
{
352-
"anchor": "Help",
353-
"href": "mailto:support@trophy.so",
354-
"icon": "life-buoy"
359+
"tab": "UI Kit",
360+
"icon": "shapes",
361+
"pages": [
362+
"uikit/overview"
363+
]
355364
}
356365
],
357366
"navbar": {
@@ -370,6 +379,30 @@
370379
},
371380
{
372381
"language": "es",
382+
"global": {
383+
"anchors": [
384+
{
385+
"anchor": "GitHub",
386+
"href": "https://github.com/trophyso",
387+
"icon": "github"
388+
},
389+
{
390+
"anchor": "Estado",
391+
"href": "https://status.trophy.so",
392+
"icon": "radio-tower"
393+
},
394+
{
395+
"anchor": "llms.txt",
396+
"href": "https://docs.trophy.so/llms-full.txt",
397+
"icon": "bot"
398+
},
399+
{
400+
"anchor": "Ayuda",
401+
"href": "mailto:support@trophy.so",
402+
"icon": "life-buoy"
403+
}
404+
]
405+
},
373406
"tabs": [
374407
{
375408
"tab": "Inicio",
@@ -652,28 +685,13 @@
652685
]
653686
}
654687
]
655-
}
656-
],
657-
"anchors": [
658-
{
659-
"anchor": "GitHub",
660-
"href": "https://github.com/trophyso",
661-
"icon": "github"
662-
},
663-
{
664-
"anchor": "Estado",
665-
"href": "https://status.trophy.so",
666-
"icon": "radio-tower"
667688
},
668689
{
669-
"anchor": "llms.txt",
670-
"href": "https://docs.trophy.so/llms-full.txt",
671-
"icon": "bot"
672-
},
673-
{
674-
"anchor": "Ayuda",
675-
"href": "mailto:support@trophy.so",
676-
"icon": "life-buoy"
690+
"tab": "Kit de UI",
691+
"icon": "shapes",
692+
"pages": [
693+
"es/uikit/overview"
694+
]
677695
}
678696
],
679697
"navbar": {

es/uikit/overview.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Kit de UI de Gamificación
3+
---
4+
5+
<Frame>
6+
<img
7+
height="200"
8+
width="100%"
9+
noZoom
10+
src="../../assets/uikit/hero.png"
11+
/>
12+
</Frame>
13+
14+
El Kit de UI de Gamificación de Trophy es una biblioteca de componentes construida sobre [shadcn/ui](https://ui.shadcn.com) que te ayuda a crear experiencias de gamificación más rápido. Proporciona componentes prediseñados para rachas, logros, clasificaciones, puntos y más.
15+
16+
El Kit de UI está diseñado para funcionar con cualquier plataforma de gamificación, pero todas las props y formas de datos están diseñadas intencionalmente para trabajar sin problemas con Trophy.
17+
18+
## Requisitos Previos {#prerequisites}
19+
20+
- **React 18+** — Los componentes son React del lado del cliente.
21+
- **Tailwind v4+** — El estilo utiliza clases de utilidad de Tailwind. Configura Tailwind para que esas clases se compilen, y agrega los [tokens de tema semántico](https://ui.trophy.so/docs/styles) que Trophy espera (o mapéalos a tu sistema de diseño).
22+
- **Estructura de shadcn/ui** — Mantén un proyecto que ya siga la configuración de [shadcn/ui](https://ui.shadcn.com/docs/installation) (`components.json`, alias y diseño opcional `src/`).
23+
24+
## Comenzar {#getting-started}
25+
26+
Los componentes están disponibles a través del CLI de shadcn:
27+
28+
```bash
29+
npx shadcn@latest add https://ui.trophy.so/<component>
30+
```
31+
32+
Por ejemplo, para instalar el componente Insignia de Racha:
33+
34+
```bash
35+
npx shadcn@latest add https://ui.trophy.so/streak-badge
36+
```
37+
38+
Una vez que un componente está instalado, puedes importarlo y usarlo como cualquier otro componente de React. Los archivos se agregan a tu proyecto (el mismo modelo de [código abierto](https://ui.shadcn.com/docs) que shadcn/ui), por lo que puedes ajustar el marcado y alinear los estilos con tu sistema de diseño.
39+
40+
Por ejemplo, después de instalar el componente [Insignia de Racha](https://ui.trophy.so/streak-badge), puedes componerlo en una página como la siguiente:
41+
42+
```tsx
43+
"use client"
44+
45+
import { StreakBadge } from "@/components/ui/streak-badge"
46+
47+
export default function Page() {
48+
const streak = 7
49+
50+
return (
51+
<div className="flex items-center justify-center p-8">
52+
<StreakBadge length={streak} />
53+
</div>
54+
)
55+
}
56+
```
57+
58+
La ruta de importación predeterminada es `@/components/ui/<component>`. Si tu `components.json` usa otro directorio o alias, actualiza la importación para que coincida.
59+
60+
Para props, variantes y formas de datos, usa la sección API de cada componente en su página de documentación—consulta [Todos los componentes](https://ui.trophy.so/docs/components) para ver la lista completa.

i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"webhooks/events/achievements/*.mdx",
3434
"webhooks/events/leaderboards/*.mdx",
3535
"webhooks/events/points/*.mdx",
36-
"webhooks/events/streaks/*.mdx"
36+
"webhooks/events/streaks/*.mdx",
37+
"uikit/*.mdx"
3738
],
3839
"exclude": [
3940
"snippets/*.mdx",

i18n.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3908,3 +3908,21 @@ checksums:
39083908
content/36: 11d9354aad0938839619ea2cd6bfc84e
39093909
content/37: 10e8e9a59847ddd720c6d06b12c7b120
39103910
content/38: 9799b973234bf2d10d5c971b267f55a5
3911+
f88bb06e37f2be82f58b7d21aea2fe12:
3912+
meta/title: 2b3d02ff56b5f77b272637252681667c
3913+
meta/mode: a6cca5f712b7678312ceb49c46ffcb9d
3914+
content/0: 1555401e851bd6d479e2e36e6687a71d
3915+
content/1: c4ef90329fd83d07df032f692a7050f6
3916+
content/2: c4c0244c4b4fcca018bbb9032318b161
3917+
content/3: c6db7efc321794d0986f60cc02c849cb
3918+
content/4: 1b7803dd632c88fb68ac5771e43b1e67
3919+
content/5: dd5c8b58f93ed0bd38958d9d79f75822
3920+
content/6: aa62f0c8be91f77935d44319fa3fceff
3921+
content/7: 72f96436175045df70316598955c59aa
3922+
content/8: f7fbf729aa0f2e8cc83ef8147da52c3d
3923+
content/9: 99d873b2bf99292be94504028a60d59e
3924+
content/10: 9039522c2b3618714202c30c34332e9d
3925+
content/11: f1b31adcd18d3a5ba1910f43a7ff6152
3926+
content/12: 8ea8277db62ca77a99cdfed5c411ad61
3927+
content/13: 93bbdcf95ad6354d6c69125734abb2a8
3928+
content/14: fc6449de67653e33298100f149b39bd8

styles/config/vocabularies/Trophy/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ APNs
1919
Strava
2020
grayscale
2121
localStorage
22+
shadcn
2223

2324
# Markdown rich text
2425
_[\w\s]+_

uikit/overview.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Gamification UI Kit
3+
---
4+
5+
<Frame>
6+
<img
7+
height="200"
8+
width="100%"
9+
noZoom
10+
src="../assets/uikit/hero.png"
11+
/>
12+
</Frame>
13+
14+
Trophy's Gamification UI Kit is a component library built on top of [shadcn/ui](https://ui.shadcn.com) that helps you build gamification experiences faster. It provides pre-built components for streaks, achievements, leaderboards, points, and more.
15+
16+
The UI Kit is designed to work with any gamification platform, but all props and data shapes are designed intentionally to work seamlessly with Trophy.
17+
18+
## Prerequisites {#prerequisites}
19+
20+
- **React 18+** — Components are client-side React.
21+
- **Tailwind v4+** — Styling is Tailwind utility classes. Configure Tailwind so those classes compile, and add the [semantic theme tokens](https://ui.trophy.so/docs/styles) Trophy expects (or map them to your design system).
22+
- **shadcn/ui structure** — Maintain a project that already follows the [shadcn/ui](https://ui.shadcn.com/docs/installation) setup (`components.json`, aliases, and optional `src/` layout).
23+
24+
## Getting Started {#getting-started}
25+
26+
Components are available via the shadcn CLI:
27+
28+
```bash
29+
npx shadcn@latest add https://ui.trophy.so/<component>
30+
```
31+
32+
For example, to install the Streak Badge component:
33+
34+
```bash
35+
npx shadcn@latest add https://ui.trophy.so/streak-badge
36+
```
37+
38+
Once a component is installed, you can import and use it like any other React component. Files are added into your project (the same [open-code](https://ui.shadcn.com/docs) model as shadcn/ui), so you can adjust markup and align styles with your design system.
39+
40+
For example, after installing the [Streak Badge](https://ui.trophy.so/streak-badge) component, you can compose it on a page like the following:
41+
42+
```tsx
43+
"use client"
44+
45+
import { StreakBadge } from "@/components/ui/streak-badge"
46+
47+
export default function Page() {
48+
const streak = 7
49+
50+
return (
51+
<div className="flex items-center justify-center p-8">
52+
<StreakBadge length={streak} />
53+
</div>
54+
)
55+
}
56+
```
57+
58+
The default import path is `@/components/ui/<component>`. If your `components.json` uses another directory or alias, update the import to match.
59+
60+
For props, variants, and data shapes, use each component’s API section on its doc page—see [All components](https://ui.trophy.so/docs/components) for the full list.

0 commit comments

Comments
 (0)