Is there a Plugin Component for entering Numbers?

Is there a separate component for entering Numbers or should I just use TextComponent and check the returned value?

You can create an input and sets it’s type to number

new Setting(this.containerEl)
      .setName("Words per dot")
      .setDesc("How many words should be represented by a single dot?")
      .addText((textfield) => {
        textfield.inputEl.type = "number";
        textfield.onChange(async (value) => {
          this.plugin.writeOptions(() => ({
            wordsPerDot: value !== "" ? Number(value) : undefined,

That is an extract from fantasy calendar

1 Like