mastodon-instancepicker

November 15, 2023 ยท View on GitHub

This component lets the user pick a Mastodon instance by typing. A list of matching instances is shown for selection by mouse or keyboard navigation.

End users usually will not use this component directly, it is used internally by other components.

Adding this component will add the dialog as closed. You can open it by calling the pickInstance() method, which will return a promise that resolves to the selected instance.

Overview

A dialog widget to let a user pick their Mastodon instance.

Properties

PropertyAttributeDescriptionTypeDefault
accountaccountcurrently unusedstringundefined

Methods

close(event: MouseEvent) => Promise<void>

Close the dialog without picking an instance.

Returns

Type: Promise<void>

pickInstance() => Promise<string>

Open the dialog and let the user pick an instance.

Returns

Type: Promise<string>

CSS Custom Properties

NameDescription
--button-backgroundbackground color of the selected instance and the picker button
--button-colortext color of the selected/highlighted instance and the picker button
--button-hoverbackground color of the highlighted instance and the picker button on hover
--color-backgroundbackground color of the dialog
--color-linklink color
--color-texttext color used in the dialog

Dependencies

Used by

Graph

graph TD;
  mastodon-follow --> mastodon-instancepicker
  mastodon-share --> mastodon-instancepicker
  style mastodon-instancepicker fill:#f9f,stroke:#333,stroke-width:4px

Built with StencilJS