To implement the Itinerary component into your project you’ll need to add the import:
import Itinerary , {
ItinerarySegment ,
ItineraryStatus ,
ItineraryBadgeList ,
ItinerarySegmentStop ,
ItinerarySegmentDetail ,
} from "@kiwicom/orbit-components/lib/Itinerary" ;
After adding import to your project you can use it simply like:
< Itinerary >
< ItinerarySegment spaceAfter = " large " >
< ItinerarySegmentStop
city = " Moscow "
station = " Sheremetyevo International Airport (SVO) "
date = " Fri, 19.10 "
time = " 14:05 "
/>
< ItinerarySegmentDetail duration = " 2h 30m " summary = { < BadgeGroup /> } >
< CollapsedContent />
</ ItinerarySegmentDetail >
< ItinerarySegmentStop
city = " Prague "
station = " Václav Havel Airport Prague (PRG) "
date = " Fri, 19.10 "
time = " 16:35 "
/>
</ ItinerarySegment >
</ Itinerary >
Namedata-transfer-vertical Type Required Default Description children React.ReactNode:heavy_check_mark: The content of Itinerary component dataTest stringOptional prop for testing purposes. spaceAfter enumAdditional margin-bottom after component.
spaceAfter "none""smallest""small""normal""medium""large""largest"
The ItinerarySegment component serves as a wrapper of atomic unit ItinerarySegmentStop and `ItinerarySegmentDetail, have a status prop for showing important information about the connection between two segments of a journey.
Namedata-transfer-vertical Type Required Default Description label React.ReactNodeStatus message of ItinerarySegment children React.ReactNode:heavy_check_mark: The content of ItinerarySegment dataTest stringOptional prop for testing purposes. id stringSet id for Itinerary noElevation booleanTurn off elevation (box-shadow) for a segment. spaceAfter enumAdditional margin-bottom after component. actionable booleantrueApplies actionable styles for ItinerarySegment wrapper banner React.NodeAdditional information for ItinerarySegment onClick event => void \| PromiseFunction for handling onClick event. onExpand event => void \| PromiseFunction to be triggered when ItinerarySegment is expanded. onCollapse event => void \| PromiseFunction to be triggered when ItinerarySegment is collapsed.
spaceAfter "none""smallest""small""normal""medium""large""largest"
ItinerarySegmentStop is an atomic unit of the Itinerary component, shows two locations, date and time, have the warning property which changes the icon to <AlertCircle color="warning" /> to attract user attention to some important information about a journey.
Namedata-transfer-vertical Type Required Default Description date React.NodeThe date of ItinerarySegmentStop time React.NodeThe time of ItinerarySegmentStop cancelledTime React.NodeThe cancelled time of ItinerarySegmentStop cancelledDate React.NodeThe cancelled date of ItinerarySegmentStop cancelledStation React.NodeThe cancelled station of ItinerarySegmentStop cancelledCity React.NodeThe cancelled city of ItinerarySegmentStop city React.Node:heavy_check_mark: The city of ItinerarySegmentStop station React.Node:heavy_check_mark: The station of ItinerarySegmentStop hidden booleanItinerarySegmentStop which status is hiddenhiddenCityText React.NodeHidden cityText which appears above city icon React.NodeItinerarySegmentStop custom iconcanceled booleanShows segment stop as canceled with striked through Text type StatusThe color of ItinerarySegmentStop icon minWidth number70sets min-width for first column with date and time
ItineraryStatus is a wrapper for ItinerarySegment or a group of segments. Shows the status of the Itinerary or ItinerarySegment
Namedata-transfer-vertical Type Required Default Description type StatusThe type of ItineraryStatus component label React.NodeThe label of the ItineraryStatus offset number0The offset for the label actionable booleantrue Applies actionable styles for ItineraryStatus children React.ReactNode:heavy_check_mark: The content of ItineraryStatus component
ItinerarySegmentDetail serves as a connection between two ItinerarySegmentStop components (segments)
Namedata-transfer-vertical Type Required Default Description summary React.ReactNode:heavy_check_mark: The content of ItinerarySegmentDetail component, when it’s not expanded duration string:heavy_check_mark: The duration between two ItinerarySegmentStop components content ContentItem[]The content of ItinerarySegmentDetail component, shown when it’s expanded icon React.ReactNode<Airplane />The icon of ItinerarySegmentDetail component
The table below contains the types of props of objects of type ContentItem.
Namedata-transfer-vertical Type Description title React.NodeThe title of the content item items ContentDetail[]The items of the content item
The table below contains the types of props of objects of type ContentDetail.
Namedata-transfer-vertical Type Description icon React.Nodename React.Nodevalue React.Node
Namedata-transfer-vertical Type Required Default Description children React.ReactNode:heavy_check_mark: The content of ItinerarySegmentBanner component, onClick React.ReactNodefor handling onClick callback inItinerarySegmentBanner
Namedata-transfer-vertical Type Required Default Description children React.ReactNode:heavy_check_mark: The content of ItinerarySeparator component type StatusThe type of ItinerarySeparator component color "string"The color of ItinerarySeparator component
Status Type "warning""dashed""critical""dotted""info""solid""success""none""neutral""double"