<div class="set segmented-buttons">
  {{ $name := .Get "name" }}
  {{ $type := .Get "type" }}
  {{ $buttons := .Get "buttons" | unmarshal }}

  {{ range $index, $button := $buttons }}
    <label
    {{ $button.disabled }}
    class="component button segmented
    {{ if eq $index 0 }}
      start
    {{ else if eq $index (sub (len $buttons) 1) }}
      end
    {{ end }}">

    <input
      type="{{ $type }}"
      id="{{ $button.id }}"
      name="{{ $name }}"
      value="{{ $button.value }}"
      {{ $butt