Skip to content

Latest commit

 

History

History
179 lines (152 loc) · 3.02 KB

input.md

File metadata and controls

179 lines (152 loc) · 3.02 KB

Default input

nb-input({
  'content': 'hello, world!',
  'name': 'greetings'
})
  • size: 's'

Options

  • 'id' {string}
  • 'name' {string}
  • 'attrs' {object} - attrubutes for input node
  • 'content' {string|xml} - value of the input
  • 'type' {string} — 'multiline' textarea
  • 'ghost' {boolean} — ghost mode input
  • 'disabled' {boolean}
  • 'reset' {boolean} — reset control in input
  • 'tabindex' {string} — tabindex
  • 'size' {string} - input size. 's' (no other sizes supported)
  • 'error' {object} {content: 'error content', direction: 'right|left'}
  • 'leftContent' {string|xml} — content of the left field of input
  • 'rightContent' {string|xml} — content of the right field of input
  • 'hint' {string | Object} — content of hint or { text: '...', ghost: true() } for ghost hint

Yate examples

Types

nb-input({
    'leftContent': 'hello, world!'
    'name': 'greetings'
})
nb-input({
    'rightContent': 'hello, world!'
    'name': 'greetings'
})
nb-input({
    'reset': true()
    'content': 'hello, world!'
    'name': 'greetings'
})
nb-input({
    'name': 'greetings'
    'hint': 'Can you greet the world?'
})
nb-input({
    'name': 'greetings'
    'hint': {
         'text': 'Can you greet the world?'
         'ghost': true()
    }
})
nb-input({
    'name': 'greetings'
    'error': {
         'content': 'Ooops... It`s a wrong way'
    }
})
nb-input({
    'content': 'hello, world!'
    'name': 'greetings'
    'type': 'multiline'
})
nb-input({
    'rightContent': 'hello, world!'
    'name': 'greetings'
    'type': 'multiline'
})

Sizes

nb-input({
    'size': 's'
    'content': 'hello, world!'
    'name': 'greetings'
})
nb-input({
    'size': 'm'
    'content': 'hello, world!'
    'name': 'greetings'
})

Disabled

nb-input({
    'content': 'hello, world!'
    'name': 'greetings'
    'disabled': true()
})
nb-input({
    'content': 'hello, world!'
    'name': 'greetings'
    'type': 'multiline'
    'disabled': true()
})

Events

nb-input

On native control input

Arguments:

  • event name
  • block
  • original event

nb-changed

On native control change

Arguments:

  • event name
  • block
  • original event