Skip to content

Commit 3a505ca

Browse files
committed
Add page for UI kit
1 parent 8d5ae43 commit 3a505ca

4 files changed

Lines changed: 114 additions & 42 deletions

File tree

assets/uikit/hero.png

112 KB
Loading

assets/uikit/streaks_examples.png

86.3 KB
Loading

docs.json

Lines changed: 53 additions & 42 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",
@@ -654,28 +687,6 @@
654687
]
655688
}
656689
],
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"
667-
},
668-
{
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"
677-
}
678-
],
679690
"navbar": {
680691
"links": [
681692
{

uikit/overview.mdx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: UI Kit
3+
mode: center
4+
---
5+
6+
<Frame>
7+
<img
8+
height="200"
9+
width="100%"
10+
noZoom
11+
src="../assets/uikit/hero.png"
12+
/>
13+
</Frame>
14+
15+
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.
16+
17+
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.
18+
19+
## Prerequisites {#prerequisites}
20+
21+
- **React 18+** — Components are client-side React.
22+
- **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).
23+
- **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).
24+
25+
## Getting Started {#getting-started}
26+
27+
Components are available via the shadcn CLI:
28+
29+
```bash
30+
npx shadcn@latest add https://ui.trophy.so/<component>
31+
```
32+
33+
For example, to install the Streak Badge component:
34+
35+
```bash
36+
npx shadcn@latest add https://ui.trophy.so/streak-badge
37+
```
38+
39+
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.
40+
41+
For example, after installing the [Streak Badge](https://ui.trophy.so/streak-badge) component, you can compose it on a page like the following:
42+
43+
```tsx
44+
"use client"
45+
46+
import { StreakBadge } from "@/components/ui/streak-badge"
47+
48+
export default function Page() {
49+
const streak = 7
50+
51+
return (
52+
<div className="flex items-center justify-center p-8">
53+
<StreakBadge length={streak} />
54+
</div>
55+
)
56+
}
57+
```
58+
59+
The default import path is `@/components/ui/<component>`. If your `components.json` uses another directory or alias, update the import to match.
60+
61+
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)