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

6.1.7 • 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 6.1.7
    13
    • latest

Version History

Package Sidebar

Install

npm i @blockly/field-slider

Weekly Downloads

73

Version

6.1.7

License

Apache-2.0

Unpacked Size

49.8 kB

Total Files

13

Last publish

Collaborators

  • google-wombot
  • samelhusseini