Skip to content

SegmentedControl

A row of segments where one is selected, rendered as Tabler’s nav-segmented. Each segment is a Bootstrap tab (data-bs-toggle="tab"), so tabler.js moves the selection on click. Segments are <button type="button">, so they never submit an enclosing form.

To show a panel per segment, add data-bs-target="#pane-id" to each item; attributes are forwarded to the <button>. Without a target, the control only switches its selected segment: listen to Bootstrap’s shown.bs.tab event to react to it.

Put an icon before the label with the nav-link-icon class:

fullWidth stretches the control, and its segments, to the width of the container. A segment takes the native disabled attribute:

vertical stacks the segments in a column:

Prop Type Default Description
fullWidth bool false Stretches to the container (w-100)
vertical bool false Stacks the segments (nav-segmented-vertical)
size string 'md' sm md lg (nav-sm, nav-lg)

Other attributes go to the root <nav role="tablist">: give it an aria-label.

Component Renders
SegmentedControl:Item <button type="button" class="nav-link" role="tab" data-bs-toggle="tab">, with aria-selected

SegmentedControl:Item takes one prop:

Prop Type Default Description
active bool false The selected segment (active, aria-selected="true"); the others get tabindex="-1"

Its type is button unless you pass another one, such as type="submit".