UI element components provide the building blocks for creating custom interfaces in BetterDiscord plugins. These components offer consistent styling and behavior across Discord’s UI.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/betterdiscord/betterdiscord/llms.txt
Use this file to discover all available pages before exploring further.
Text
A text component with color and size variants.Text content to display
HTML element type to render (e.g.,
"span", "p", "h1")Text color variant. Available colors:
Text.Colors.STANDARD- Standard text colorText.Colors.MUTED- Muted/secondary textText.Colors.ERROR- Error/danger colorText.Colors.BRAND- Brand colorText.Colors.LINK- Link colorText.Colors.HEADER_PRIMARY- Primary header colorText.Colors.HEADER_SECONDARY- Secondary header colorText.Colors.STATUS_YELLOW- Yellow status colorText.Colors.STATUS_GREEN- Green status colorText.Colors.STATUS_RED- Red status colorText.Colors.ALWAYS_WHITE- Always white textText.Colors.CUSTOM- No color class applied
Text size variant. Available sizes:
Text.Sizes.SIZE_10- 10pxText.Sizes.SIZE_12- 12pxText.Sizes.SIZE_14- 14pxText.Sizes.SIZE_16- 16pxText.Sizes.SIZE_20- 20pxText.Sizes.SIZE_24- 24pxText.Sizes.SIZE_32- 32px
Whether the text can be selected
Whether to apply bold font weight
Additional CSS classes to apply
Inline styles to apply
Usage
Flex
A flexbox container component with alignment and direction utilities.Child elements to layout
Flex direction. Available directions:
Flex.Direction.VERTICAL- Column layoutFlex.Direction.HORIZONTAL- Row layoutFlex.Direction.HORIZONTAL_REVERSE- Reversed row layout
Justify content alignment. Available options:
Flex.Justify.START- Align to startFlex.Justify.END- Align to endFlex.Justify.CENTER- Center itemsFlex.Justify.BETWEEN- Space between itemsFlex.Justify.AROUND- Space around items
Align items. Available options:
Flex.Align.START- Align to startFlex.Align.END- Align to endFlex.Align.CENTER- Center itemsFlex.Align.STRETCH- Stretch itemsFlex.Align.BASELINE- Align to baseline
Flex wrap behavior. Available options:
Flex.Wrap.NO_WRAP- No wrappingFlex.Wrap.WRAP- Wrap itemsFlex.Wrap.WRAP_REVERSE- Wrap in reverse
Flex shrink factor
Flex grow factor
Flex basis value
Additional CSS classes to apply
Inline styles to apply
Click event handler
Usage
Flex.Child
A wrapper component that applies flex child styling.Button
A button component with multiple style variants, colors, and sizes.Button content
Click event handler
Button style variant. Available looks:
Button.Looks.FILLED- Filled backgroundButton.Looks.OUTLINED- Outlined borderButton.Looks.LINK- Link-styled buttonButton.Looks.BLANK- No styling
Button color. Available colors:
Button.Colors.BRAND- Brand colorButton.Colors.BLURPLE- Discord blurpleButton.Colors.RED- Red/dangerButton.Colors.GREEN- Green/successButton.Colors.YELLOW- Yellow/warningButton.Colors.PRIMARY- Primary colorButton.Colors.LINK- Link colorButton.Colors.WHITE- WhiteButton.Colors.TRANSPARENT- TransparentButton.Colors.CUSTOM- No color class
Button size. Available sizes:
Button.Sizes.NONE- No size stylingButton.Sizes.TINY- Tiny buttonButton.Sizes.SMALL- Small buttonButton.Sizes.MEDIUM- Medium buttonButton.Sizes.LARGE- Large buttonButton.Sizes.ICON- Icon button
HTML button type (
"button", "submit", "reset")Whether the button is disabled
Whether the button should grow to fill available space
Additional CSS classes to apply
React ref for the button element
Keyboard event handler
Usage
Spinner
A loading spinner component with multiple animation types.Spinner animation type. Available types:
Spinner.Type.WANDERING_CUBES- Two wandering cubesSpinner.Type.CHASING_DOTS- Chasing dots animationSpinner.Type.PULSING_ELLIPSIS- Pulsing ellipsis (three dots)Spinner.Type.SPINNING_CIRCLE- Spinning circleSpinner.Type.SPINNING_CIRCLE_SIMPLE- Simple spinning circleSpinner.Type.LOW_MOTION- Low motion variant (automatically used when reduced motion is enabled)
Whether the spinner should animate
Additional CSS classes to apply
CSS classes to apply to the spinner’s motion items
Accessibility label for screen readers
Usage
Tooltip
Discord’s tooltip component for displaying contextual information on hover.BdApi.Components.Tooltip is Discord’s internal tooltip component. For creating tooltips programmatically, use BdApi.UI.createTooltip().Tooltip content to display
A function that receives tooltip props and returns a single React element. The element must accept
onMouseEnter, onMouseLeave, and onFocus props.Tooltip position. Available positions:
"top"- Above the element"bottom"- Below the element"left"- To the left of the element"right"- To the right of the element
Tooltip color. Available colors:
"primary"- Primary color"black"- Black tooltip"grey"- Grey tooltip"brand"- Brand color"green"- Green tooltip"red"- Red tooltip"yellow"- Yellow tooltip
Spacing between tooltip and target element
Whether to hide the tooltip when the element is clicked
Usage
ErrorBoundary
A React error boundary component that catches errors in child components.Child components to protect with error boundary
Identifier for debugging purposes (appears in error logs)
Name for debugging purposes (appears in error logs)
Whether to hide the default error message in the UI (never shown if a fallback is provided)
Custom fallback UI to display when an error occurs
Callback function called when an error is caught. Receives the error object.