From f3aab8f425d24c849f837194e2538f8e2433d385 Mon Sep 17 00:00:00 2001
From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com>
Date: Wed, 29 Dec 2021 11:41:05 -0600
Subject: [PATCH] action row docs
---
library/core/components/action-row.tsx | 21 +++++++++++++++++++++
todo.md | 1 +
2 files changed, 22 insertions(+)
diff --git a/library/core/components/action-row.tsx b/library/core/components/action-row.tsx
index 639e95b..0711fd7 100644
--- a/library/core/components/action-row.tsx
+++ b/library/core/components/action-row.tsx
@@ -4,10 +4,31 @@ import { ReacordElement } from "../../internal/element.js"
import type { MessageOptions } from "../../internal/message"
import { Node } from "../../internal/node.js"
+/**
+ * Props for an action row
+ * @category Components
+ */
export type ActionRowProps = {
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
+ *
+ *
+ *
+ *
+ * ```
+ *
+ * @category Components
+ * @see https://discord.com/developers/docs/interactions/message-components#action-rows
+ */
export function ActionRow(props: ActionRowProps) {
return (
new ActionRowNode(props)}>
diff --git a/todo.md b/todo.md
index 5620039..0e8cc22 100644
--- a/todo.md
+++ b/todo.md
@@ -37,6 +37,7 @@
- [ ] combine `MessageOptions` and `Message` into a single message object (?)
- [x] consider always calling `deferUpdate` on component interactions
+- [ ] more unit tests instead of integration tests probably
# cool ideas / polish