ui
namespace uiFunctions
ButtonRow(props: ButtonRowProps): ReactElement
A pressable TableRow in its settings group, as Discord draws actions such as Log Out; it asks first when
confirmation is set. danger draws the label red behind a red trash icon.
Returns
The row.
CheckboxRow(props: CheckboxRowProps): ReactElement
A settings row with a checkbox, Discord's TableCheckboxRow.
Returns
The row.
ChecklistRow(props: ChecklistRowProps): ReactElement
A titled group of checkbox rows, one per option, for picking several.
Returns
The group.
ColorRow(props: ColorRowProps): ReactElement
A settings row that shows a color swatch, opens Discord's color picker when pressed and offers a reset back to the default. Discord's picker reports its current color when dismissed, so a pick matching the shown color is ignored.
Returns
The row.
DurationRow(props: DurationRowProps): ReactElement
A settings input for a duration: an amount, and the unit it is in. The duration saves in milliseconds.
Returns
The row.
EntityRow(props: EntityRowProps): ReactElement
A settings input for a Discord id, showing the name the client's stores hold for it. It takes an id typed or pasted; it has no search.
Returns
The input.
InputRow(props: InputRowProps): ReactElement
A settings row, Discord's way: the label, and the saved text trailing (masked when secret). Pressing it opens Discord's dialog with the focused input, its description and error, which saves only on Save.
Returns
The row.
ListRow(props: ListRowProps): ReactElement
A titled, editable list of strings: each row moves up or down, or is deleted after a confirmation; the delete button stands apart from the arrows so it is hard to hit by mistake. An Add row opens Discord's input dialog for a new one.
Returns
The group.
MultilineRow(props: MultilineRowProps): ReactElement
A settings text input that grows with its text, Discord's TextArea.
Returns
The input.
NumberRow(props: NumberRowProps): ReactElement
A settings input for a number with no slider range, checked against whether it must be whole, its range and its step before it saves.
Returns
The input.
The standard settings page wrapper. A scroll view padded to 16 with a bottom safe-area inset and a 24px gap between form groups, matching how Discord lays out its own settings screens. Use it as the root of every settings page.
PickerRow(props: PickerRowProps): ReactElement
A row showing the picked option that opens Discord's action sheet listing every option, for choices too many for a radio group.
Returns
The row.
RadioRow(props: RadioRowProps): ReactElement
A titled group of radio rows, one per option with its sub-label, Discord's TableRadioGroup as its appearance settings use it.
Returns
The group.
ResetRow(props: ResetRowProps): ReactElement
A settings group with one row that puts every setting on the page back to its default.
Returns
The group.
RestartRow(): ReactElement
Discord's InlineNotice saying a change applies after Discord restarts, with a button that restarts
it now; on builds without one, a card holding the same text and button.
Returns
The notice.
SchemaPanel(props: SchemaPanelProps): ReactElement
The settings panel generated from a plugin's settings schema: a row per setting, a section per
setting.section, a restart hint once a requiresRestart setting changes, and a reset row.
Returns
The page.
SecretRow(props: SecretRowProps): ReactElement
A settings text input that hides what is typed, for tokens and passwords. A snapshot of the settings masks its value.
Returns
The input.
Section(props: SectionProps): ReactElement
A titled group of settings rows, Discord's TableRowGroup.
Returns
The group.
SegmentedRow(props: SegmentedRowProps): ReactElement
A settings row with Discord's SegmentedControl under its label, as Discord's own settings draw one,
for two to four short options. A value changed elsewhere moves the control along with it.
Returns
The row.
SliderRow(props: SliderRowProps): ReactElement<unknown, string | JSXElementConstructor<any>> | null
Discord's TableSliderRow, as its own settings draw one: the label and live value over the slider
with its default mark. A sub-label, which that row cannot show, moves it to a TableRow holding the same slider.
The value is saved when the drag ends; Android's slider and iOS's take differently named props, so it passes both.
Returns
The row, or null when Discord's slider is unavailable.
StepperRow(props: StepperRowProps): ReactElement
A settings row with minus and plus buttons around the current number, each press moving it one step within its range.
Returns
The row.
SwitchRow(props: SwitchRowProps): ReactElement
A settings row with a switch, Discord's TableSwitchRow.
Returns
The row.
UrlRow(props: UrlRowProps): ReactElement
A settings input for an http or https URL, which saves only a URL or nothing.
Returns
The input.
Types
Props for ButtonRow.
Props for CheckboxRow.
Props for ChecklistRow.
One option of a choice row.
Props for ColorRow.
What storage.define returns: a schema's settings, bound to one Bucket.
Props for DurationRow.
Props for EntityRow.
The keyboard an input opens.
Props for InputRow.
How an input shows its text.
Props for ListRow.
Props for MultilineRow: an InputRow's, without its variant.
The constraints a numeric input checks typed text against.
Props for NumberRow.
Props for PickerRow.
Props for RadioRow.
Props for ResetRow.
Props for SchemaPanel.
Props for SecretRow: an InputRow's, without its variant.
Props of Section: Discord's TableRowGroup props, such as title.
Props for SegmentedRow.
One export of src/actions.ts: it takes nothing, and may be async.
The functions a plugin's src/actions.ts exports, which its setting.button rows run, by name.
One setting's lifted predicates.
A predicate the build lifted out of settings.ts: it reads every setting and returns whether its row shows or is enabled.
Each setting's lifted predicates, by its dot-separated key.
A plugin's settings as an object: reads apply defaults, writes are validated and saved. Sections are nested objects.
Props for SliderRow.
Props for StepperRow.
Props for UrlRow: an InputRow's, without its variant and validation.