Skip to content

Latest commit

 

History

History
121 lines (100 loc) · 2.33 KB

checkbox.md

File metadata and controls

121 lines (100 loc) · 2.33 KB

Default checkbox

    nb-checkbox()
  • size — m
  • type — checkbox

Optional attributes

  • 'size' {string} 's' / 'm'
  • 'id' {string}...
  • 'name' {string}...
  • 'class' {array} ['my_class1', 'my_class2'] — additional classes
  • 'type' {string} 'checkbox' / 'radio' / 'button'
  • 'disabled' {boolean} — disabled button
  • 'value' {string} — value
  • 'tabindex' {string} — tabindex
  • 'checked' {boolean} — checked button
  • 'theme' {string} 'normal' / 'action' (yellow) / 'dark' / 'pseudo' / 'promo' (big yellow) — theme for button type
  • 'content' {string} — text (or custom html) of the label, can be string or xml xss warning!
  • 'attrs' {object} {'attr2': 'value2'} — custom DOM attributes for checkbox input

Yate Example

checked

    nb-checkbox({
        'checked': true()
    })

checkbox with label

    nb-checkbox({
        'content': 'Do you want to be an icon for the disfranchised masses?'
        'name': 'is_rock_star'
    })

Sizes

    nb-checkbox({
        'size': 'm'
    })
    ' '
    nb-checkbox({
        'size': 's'
    })

Types

Button type of checkbox

   nb-checkbox({
       'type': 'button'
       'content': 'Greet the world?'
   })

Disabled

    nb-checkbox({
        'content': 'Bet you can`t check me!'
        'disabled': true()
    })
    nb-checkbox({
        'type': 'button'
        'content': 'I`m sorry, but you can`t do it anymore'
        'disabled': true()
    })

Radio

Radio buttons

    nb-checkbox({
        'name': 'radio1'
        'type': 'radio'
        'content': 'Variant #1'
    })
    nb-checkbox({
        'name': 'radio1'
        'type': 'radio'
        'content': 'Variant #2'
    })
    nb-checkbox({
        'name': 'radio1'
        'type': 'radio'
        'content': 'Variant #3'
    })