N

ui

namespace ui

Functions

F

ButtonRow(props: ButtonRowProps): ReactElement

Discord's full-width Row Button, which runs something when pressed and asks first when confirmation is set; danger leads with a red trash icon.

Returns

The row.

F

CheckboxRow(props: CheckboxRowProps): ReactElement

A settings row with a checkbox, Discord's TableCheckboxRow.

Returns

The row.

F

ChecklistRow(props: ChecklistRowProps): ReactElement

A titled group of checkbox rows, one per option, for picking several.

Returns

The group.

F

ColorRow(props: ColorRowProps): ReactElement

A settings row that shows a color swatch, opens Discord's color picker when pressed, takes a typed hex code and offers a reset back to the default. A typed code is saved even when it matches the default, which the picker cannot do: Discord's picker reports its current color when it is dismissed, so a pick that matches the color already shown is ignored.

Returns

The row.

F

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.

F

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.

F

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 titled action sheet with the input, its description and error, which saves only on Save.

Returns

The row.

F

ListRow(props: ListRowProps): ReactElement

A titled, editable list of strings: each row moves up or down or is removed, and an input adds one.

Returns

The group.

F

MultilineRow(props: MultilineRowProps): ReactElement

A settings text input that grows with its text, Discord's TextArea.

Returns

The input.

F

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.

F

Page(__namedParameters: PageProps): ReactElement

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.

F

PaletteRow(props: PaletteRowProps): ReactElement

A settings row with a grid of color swatches, the picked one ringed, for a fixed set of colors.

Returns

The row.

F

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.

F

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.

F

ResetRow(props: ResetRowProps): ReactElement

A settings group with one row that puts every setting on the page back to its default.

Returns

The group.

F

RestartRow(): ReactElement

A settings group saying a change applies after Discord restarts, with a button that restarts it now.

Returns

The group.

F

Row(props: RowProps): ReactElement

One settings row, Discord's TableRow.

Returns

The row.

F

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.

F

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.

F

Section(props: SectionProps): ReactElement

A titled group of settings rows, Discord's TableRowGroup.

Returns

The group.

F

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.

F

SliderRow(props: SliderRowProps): ReactElement<unknown, string | JSXElementConstructor<any>> | null

A settings row with Discord's form slider, as its own settings draw one: the label, then the slider with its value label and default mark. The value updates while dragging and 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.

F

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.

F

SwitchRow(props: SwitchRowProps): ReactElement

A settings row with a switch, Discord's TableSwitchRow.

Returns

The row.

F

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.

The props of Page.

Props for PaletteRow.

Props for PickerRow.

Props for RadioRow.

Props for ResetRow.

Props of Row: Discord's TableRow props, such as label, subLabel and onPress, and an IconInput icon.

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 of SwitchRow: Discord's TableSwitchRow props, such as label, value and onValueChange, and an IconInput icon.

Props for UrlRow: an InputRow's, without its variant and validation.