Skip to content

Commit 8b7162c

Browse files
committed
Correct supported types in docs for modal components
1 parent b1479aa commit 8b7162c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

discord/ui/label.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
class Label(Item[V]):
5151
"""Represents a UI label within a modal.
5252
53+
This is a top-level layout component that can only be used on :class:`Modal`.
54+
5355
.. versionadded:: 2.6
5456
5557
Parameters
@@ -60,7 +62,7 @@ class Label(Item[V]):
6062
description: Optional[:class:`str`]
6163
The description text to display right below the label text.
6264
Can only be up to 100 characters.
63-
component: Union[:class:`discord.ui.TextInput`, :class:`discord.ui.Select`]
65+
component: :class:`Item`
6466
The component to display below the label.
6567
id: Optional[:class:`int`]
6668
The ID of the component. This must be unique across the view.
@@ -74,8 +76,7 @@ class Label(Item[V]):
7476
The description text to display right below the label text.
7577
Can only be up to 100 characters.
7678
component: :class:`Item`
77-
The component to display below the label. Currently only
78-
supports :class:`TextInput` and :class:`Select`.
79+
The component to display below the label.
7980
"""
8081

8182
__item_repr_attributes__: Tuple[str, ...] = (

discord/ui/text_display.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
class TextDisplay(Item[V]):
4444
"""Represents a UI text display.
4545
46-
This is a top-level layout component that can only be used on :class:`LayoutView` or :class:`Section`.
46+
This is a top-level layout component that can only be used on :class:`LayoutView`,
47+
:class:`Section`, :class:`Container`, or :class:`Modal`.
4748
4849
.. versionadded:: 2.6
4950

discord/ui/text_input.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
class TextInput(Item[V]):
5454
"""Represents a UI text input.
5555
56+
This a top-level layout component that can only be used in :class:`Label`.
57+
5658
.. container:: operations
5759
5860
.. describe:: str(x)

0 commit comments

Comments
 (0)