Module

Halogen.Widgets.SegmentedControl

Package
purescript-halogen-widgets
Repository
afcondon/purescript-halogen-widgets

A controlled segmented control / tab bar. The parent owns active and renders the corresponding pane itself (the SegmentedControl is just the selector — see CONTRACT.md rule 5: content stays with the parent). Picking a segment requests it via Selected.

#Segment Source

type Segment = { color :: Maybe String, key :: String, label :: String }

One segment. color tints the segment to mark what it selects — a shelf, a channel, a category — rather than relying on position alone; Nothing leaves it on the theme's own surface tokens, which is the right default for an ordinary tab bar. (Knob and DoubleKnob carry a color for the same reason; theirs defaults to the theme accent, where a segment's absence of colour is meaningful.)

#segment Source

segment :: String -> String -> Segment

The common case: a segment that takes its colour from the theme.

#Input Source

type Input = { active :: String, disabled :: Boolean, segments :: Array Segment }

#Output Source

data Output

Constructors

#Query Source

data Query a

Constructors

#component Source