Skip to content

Form Components

SigPro UI provides a complete set of reactive form components including select dropdowns, checkboxes, radio buttons, and range sliders.

Select Dropdown (_select)

Creates a reactive dropdown select with options.

javascript
const $role = $('user')

_select({
  label: 'User Role',
  options: [
    { value: 'admin', label: 'Administrator' },
    { value: 'user', label: 'Standard User' },
    { value: 'guest', label: 'Guest' }
  ],
  $value: $role
})

Checkbox (_checkbox)

Reactive checkbox with label.

javascript
const $agreed = $(false)

_checkbox({
  label: 'I agree to the terms and conditions',
  $value: $agreed
})

Radio Button (_radio)

Radio buttons for selecting one option from a group.

javascript
const $payment = $('credit')

_radio({ name: 'payment', label: 'Credit Card', value: 'credit', $value: $payment })
_radio({ name: 'payment', label: 'PayPal', value: 'paypal', $value: $payment })
_radio({ name: 'payment', label: 'Crypto', value: 'crypto', $value: $payment })

Range Slider (_range)

Reactive range slider for numeric values.

javascript
const $volume = $(50)

_range({
  label: 'Volume',
  min: 0,
  max: 100,
  step: 1,
  $value: $volume
})

Complete Form Example

API Reference

_select

PropTypeDescription
labelstringField label
optionsArray<{value: any, label: string}>Select options
$valueSignal<any>Selected value signal

_checkbox

PropTypeDescription
labelstringCheckbox label
$valueSignal<boolean>Checked state signal

_radio

PropTypeDescription
namestringRadio group name
labelstringRadio option label
valueanyValue for this option
$valueSignal<any>Group selected value signal

_range

PropTypeDescription
labelstringSlider label
minnumberMinimum value
maxnumberMaximum value
stepnumberStep increment
$valueSignal<number>Current value signal