action row docs
This commit is contained in:
@@ -4,10 +4,31 @@ import { ReacordElement } from "../../internal/element.js"
|
|||||||
import type { MessageOptions } from "../../internal/message"
|
import type { MessageOptions } from "../../internal/message"
|
||||||
import { Node } from "../../internal/node.js"
|
import { Node } from "../../internal/node.js"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Props for an action row
|
||||||
|
* @category Components
|
||||||
|
*/
|
||||||
export type ActionRowProps = {
|
export type ActionRowProps = {
|
||||||
children?: ReactNode
|
children?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An action row is a top-level container for message components.
|
||||||
|
*
|
||||||
|
* You don't need to use this; Reacord automatically creates action rows for you.
|
||||||
|
* But this can be useful if you want a specific layout.
|
||||||
|
*
|
||||||
|
* ```tsx
|
||||||
|
* // put buttons on two separate rows
|
||||||
|
* <ActionRow>
|
||||||
|
* <Button onClick={handleFirst}>First</Button>
|
||||||
|
* </ActionRow>
|
||||||
|
* <Button onClick={handleSecond}>Second</Button>
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @category Components
|
||||||
|
* @see https://discord.com/developers/docs/interactions/message-components#action-rows
|
||||||
|
*/
|
||||||
export function ActionRow(props: ActionRowProps) {
|
export function ActionRow(props: ActionRowProps) {
|
||||||
return (
|
return (
|
||||||
<ReacordElement props={props} createNode={() => new ActionRowNode(props)}>
|
<ReacordElement props={props} createNode={() => new ActionRowNode(props)}>
|
||||||
|
|||||||
1
todo.md
1
todo.md
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
- [ ] combine `MessageOptions` and `Message` into a single message object (?)
|
- [ ] combine `MessageOptions` and `Message` into a single message object (?)
|
||||||
- [x] consider always calling `deferUpdate` on component interactions
|
- [x] consider always calling `deferUpdate` on component interactions
|
||||||
|
- [ ] more unit tests instead of integration tests probably
|
||||||
|
|
||||||
# cool ideas / polish
|
# cool ideas / polish
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user