@digitransit-component/digitransit-component-control-panel
CtrlPanel
CtrlPanel gathers multiple components to same area (desktop-size: left or mobile-size: bottom)
Parameters
-
propsObject
Examples
<CtrlPanel language="fi" position="left">
<CtrlPanel.SeparatorLine />
<CtrlPanel.NearStopsAndRoutes
modearray={['bus', 'tram', 'subway', 'rail', 'ferry', 'citybike']}
language="fi"
/>
</CtrlPanel>
CtrlPanel.NearStopsAndRoutes
Parameters
-
propsObject-
props.modeArrayArray<string> Names of transport modes to show buttons for. Should be in lower case. Also defines button order -
props.languagestring Language used for accessible labels -
props.titleObject Custom titles per language -
props.alertsContextObjectprops.alertsContext.getModesWithAlertsfunction Function which should return an array of transport modes that have active alerts (e.g. [BUS, SUBWAY])props.alertsContext.currentTimeNumber Time stamp with which the returned alerts are validated withprops.alertsContext.feedIdsNumber feedIds for which the alerts are fetched for
-
props.colorsObject theme color configuration -
props.urlPrefixstring URL prefix for links
-
Examples
const alertsContext = {
getModesWithAlerts: () => ({}),
currentTime: 123456789,
feedIds: [HSL]
}
<CtrlPanel.NearStopsAndRoutes
modeArray={['bus', 'tram', 'subway', 'rail', 'ferry', 'citybike']}
language="fi"
alertsContext={alertsContext}
/>
---
This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @digitransit-component/digitransit-component-control-panel