Skip to content

Commit c5c0f4a

Browse files
committed
docs: add jsx section
1 parent 9b41e7e commit c5c0f4a

File tree

3 files changed

+25
-50
lines changed

3 files changed

+25
-50
lines changed

CHANGELOG.md

-50
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Text Display
3+
description: Use the Text Display component using JSX
4+
---
5+
6+
## Usage
7+
8+
```ts title="src/app/commands/ping.tsx"
9+
import { type ChatInputCommand, TextDisplay } from 'commandkit';
10+
import { MessageFlags } from 'discord.js';
11+
12+
export const chatInput: ChatInputCommand = async (ctx) => {
13+
const textComponent = <TextDisplay content="This is a text display component" />
14+
15+
await ctx.interaction.reply({
16+
components: [textComponent],
17+
flags: MessageFlags.IsComponentsV2,
18+
})
19+
};
20+
```

apps/website/sidebars.ts

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ const sidebars: SidebarsConfig = {
2222
//
2323
],
2424
},
25+
{
26+
type: 'category',
27+
label: 'Using JSX',
28+
items: ['guide/jsx/text-display'],
29+
},
2530
'guide/using-cli',
2631
'guide/commandkit-config',
2732
'guide/caching',

0 commit comments

Comments
 (0)