Skip to main content

Switchable View

Renders a bar with left and right section, and a Mantine SegmentedControl component to the right of the bar with data views below.
Optionally controlled or uncontrolled.

Storybook Docs

Props

NameTypeDefaultDescription
views *IDataView[][]Array of all data views
valuenumber-Index of the active view, when component is controlled
defaultValuenumber-Default index of the active view
topBarLeftReactNode-ReactNode for the left section of the top bar
topBarRightReactNode-ReactNode for the right section of the top bar, to the left of the SegmentedControl buttons
topContentReactNode-ReactNode for the content below the top bar
onChange(index: number) => void-Called when active view changes
segmentedControlPropsOmit<SegmentedControlProps, 'data' | 'defaultValue' | 'onChange' | 'value'>-Props of SegmentedControl, or function returning props, except 'data', 'defaultValue', 'onChange' and 'value' which are handled by this component
...--extends Paper props

IDataView

AttributeTypeDescription
dataViewReactNodeContent displayed for the view