@blockly/field-slider
TypeScript icon, indicating that this package has built-in type declarations

6.1.5 • Public • Published

@blockly/field-slider Built on Blockly

A Blockly slider field.

Installation

Yarn

yarn add @blockly/field-slider

npm

npm install @blockly/field-slider --save

Usage

This field is an extension of the Blockly.FieldNumber field. See the Blockly.FieldNumber documentation on what parameters and configurations this field supports.

JavaScript

import * as Blockly from 'blockly';
import {FieldSlider} from '@blockly/field-slider';
Blockly.Blocks['test_field_slider'] = {
  init: function () {
    this.appendDummyInput()
      .appendField('slider: ')
      .appendField(new FieldSlider(50), 'FIELDNAME');
  },
};

JSON

import * as Blockly from 'blockly';
import '@blockly/field-slider';
Blockly.defineBlocksWithJsonArray([
  {
    type: 'test_field_slider',
    message0: 'slider: %1',
    args0: [
      {
        type: 'field_slider',
        name: 'FIELDNAME',
        value: 50,
      },
    ],
  },
]);

License

Apache 2.0

Readme

Keywords

Package Sidebar

Install

npm i @blockly/field-slider

Weekly Downloads

375

Version

6.1.5

License

Apache-2.0

Unpacked Size

49.8 kB

Total Files

13

Last publish

Collaborators

  • google-wombot
  • samelhusseini