How to use the @storybook/addon-knobs/react.number function in @storybook/addon-knobs

To help you get started, we’ve selected a few @storybook/addon-knobs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github teamleadercrm / ui / stories / counter.js View on Github external
.add('Basic', () => (
    
  ))
  .add('With extra text', () => (
github teamleadercrm / ui / stories / box.js View on Github external
.add('Basic', () => (
    
      I'm body text inside a Box component
github commercetools / merchant-center-application-kit / packages / application-components / src / components / dialogs / confirmation-dialog / confirmation-dialog.story.js View on Github external
{({ isOpen, setIsOpen }) => (
           setIsOpen(false)
            }
            size={select('size', ['m', 'l', 'scale'], 'l')}
            zIndex={number('z-index', 1000)}
            labelSecondary={text('label secondary', '') || undefined}
            labelPrimary={text('label primary', '') || undefined}
            isPrimaryButtonDisabled={boolean('isPrimaryButtonDisabled', false)}
            onCancel={() => {
              alert('cancelled');
              setIsOpen(false);
            }}
            onConfirm={() => {
              alert('confirmed');
              setIsOpen(false);
            }}
          >
            
              {boolean('show paragraph 1', true) && (
                
                  {text(
github commercetools / ui-kit / src / components / collapsible-motion / collapsible-motion.story.js View on Github external
<div>
          <h2>Controlled example</h2>
          <button> this.setState({ isClosed: false })}&gt;
            Open
          </button>
          <button> this.setState({ isClosed: true })}&gt;
            Close
          </button>
          <div>
            <div>Some content before</div>
            
              {({ toggle, containerStyles, registerContentNode }) =&gt; (
                <div>
                  <div>
                    <button>Toggle</button>
                  </div>
                  <div style="{containerStyles}">
                    <div>
                      </div></div></div></div></div>
github wfp / ui / src / components / Unit / Unit-story.js View on Github external
type: select('Unit type (type)', typeOptions, 'Usd'),
        output: select(
          'Output decimal name (output)',
          decimalOptions,
          'million'
        ),
        from: select('Input decimal name (from)', decimalOptions, undefined),
        minimumFractionDigits: number(
          'minimum number of fraction digits to use (minimumFractionDigits)',
          undefined
        ),
        maximumFractionDigits: number(
          'minimum number of fraction digits to use (maximumFractionDigits)',
          undefined
        ),
        maximumSignificantDigits: number(
          'maximum number of significant digits to use (maximumSignificantDigits)',
          undefined
        ),
        hideEmpty: text('hide value if empty (hideEmpty)', undefined),
      };
      const value = text('value', 1000000);

      return {value};
    },
    {
github teamleadercrm / ui / stories / pagination.js View on Github external
.add('Compact', () =&gt; (
    
      
        {({ number, text, isActive, ...others }) =&gt; {
          return (
            <button size="small" disabled="{isActive}" label="{text}">
          );
        }}
      </button>
github i-novus-llc / n2o-framework / frontend / n2o / src / components / controls / Slider / Slider.story.js View on Github external
.add('Компонент', () =&gt; {
    const props = {
      multiple: boolean('multiple', meta.multiple),
      showTooltip: boolean('showTooltip', meta.showTooltip),
      tooltipPlacement: select(
        'tooltipPlacement',
        ['top', 'bottom', 'left', 'right'],
        meta.tooltipPlacement
      ),
      step: number('step', meta.step),
      vertical: boolean('vertical', meta.showTooltip),
      disabled: boolean('disabled', meta.showTooltip),
      dots: boolean('dots', meta.showTooltip),
      min: number('min', meta.min),
      max: number('min', meta.max),
      marks: {},
      pushable: boolean('pushable', meta.showTooltip),
    };

    return ;
  })
  .add('Метаданные', form(() =&gt; meta))
github expo / expo / apps / storybook / stories / components / SVG.stories.js View on Github external
() =&gt; {
    return (
      
        <section>
          <svg width="{100}" height="{100}">
            
            
          </svg>
        </section>
      
    );
  },
  { notes }
github expo / expo / apps / storybook / stories / Components / LinearGradient.stories.js View on Github external
min: 0.0,
    max: 1.0,
    step: 0.05,
  };

  const colors = [color('colors 0', 'red'), color('colors 1', 'blue')];

  const props = {
    colors,
    start: {
      x: number('start x', 0.5, options),
      y: number('start y', 0.0, options),
    },
    end: {
      x: number('end x', 0.5, options),
      y: number('end y', 1.0, options),
    },
    locations: [number('locations 0', 0, options), number('locations 1', 1, options)],
  };
  return (
    &lt;&gt;
       (