Orbit Design System
repository·master·Indexed 23 days ago
https://github.com/kiwicom/orbitA design system and component library for building travel products with consistent design and user experience. It includes @kiwicom/orbit-components, a set of React components such as Alert, Accordion, and AirportIllustration, and @kiwicom/babel-plugin-orbit-components to optimize bundle size by transforming destructured imports into granular, direct imports.
What's inside Orbit
- This glossary provides the standard terminology and preferred phrasing used across Kiwi.com products to ensure consistency in user interfaces and documentation. Developers should use these specific terms when implementing form labels, input fields, or instructional text.
Understand the core principles of Orbit
masterOrbit is more than a component library; it is a design system built on years of experience in travel products, incorporating accessibility, internationalization, advanced theming, and travel-specific components. The development of Orbit is guided by several core values intended to balance the needs of designers and developers:
- Finding the middle ground: Orbit aims to balance consistency, designer/developer experience, maintainability, and composability.
- Transparency: Design decisions are documented to provide historical context and avoid repetitive discussions.
- Listening and reacting: The system is built on research and active user feedback to ensure it meets real-world needs.
- Intuitive design: Focuses on clarity and using familiar patterns and vocabulary to make components self-explanatory.
- Controlled flexibility: Provides delightful components that work out-of-the-box with "appropriate defaults," while offering enough flexibility for consumers to extend them for specific use cases.
- Contextual documentation: Documentation is designed to be a partner that solves problems at the right moment, rather than just describing obvious visual styles.
Use the Box component
masterTheBoxcomponent is a versatile layout primitive used to build UI structures. It supports a wide range of styling props including flexbox properties, spacing, positioning, and typography alignment. You can also specify different styles for different viewports using media query objects.What is progressive disclosure and when to use it
masterProgressive disclosure is a design principle used to manage information overload by showing users only what they need at a given time to make a decision, while keeping secondary options just a tap away.
Use this principle to:
- Simplify designs: Highlight the primary goal of a specific screen or step.
- Reduce cognitive load: Prevent users from being overwhelmed by too many choices at once.
- Manage advanced options: Hide complex or infrequent settings behind interactions so they don't clutter the primary user flow.
When deciding what to disclose progressively, ask:
- What is the user's primary goal at this moment?
- Is there information needed only some of the time?
- If all info were visible, what would users choose to hide?
- Is the information an additional explanation of something already present?
Use Orbit Themer to generate design tokens
masterOrbit Themer is a visual tool used to define color palettes. Once you have configured your colors in the tool, it generates the specific object required to call thegetTokensfunction in your application, allowing you to apply custom themes to Orbit components.Content constraints for NotificationBadge
masterBecause
NotificationBadgeis small and circular, it has strict content limitations:- Content types: Use either an icon OR a number. If an icon is used, the number is not displayed.
- Length: If using a number, limit it to no more than 2 digits.
- Accessibility: If you use only an icon, you must include the same information non-visually (e.g., via screen reader text) to ensure the message is accessible to users who cannot see the icon.
Breadcrumbs responsive behavior and content structure
masterThe Breadcrumbs component adapts its content based on the screen size to maintain usability:
Desktop
On larger screens, the component displays the full path:
- Root item: Usually the name of your product.
- Full path: Shows the hierarchy leading to the current page.
- Current page: The final item in the list, showing the name of the page the user is currently on.
Mobile
On smaller screens, to avoid clutter and line-breaking issues, the component simplifies to a single option:
- Back button: Shows only the immediate parent, allowing users to navigate one step back in the hierarchy.
How TooltipPrimitive positioning and behavior works
masterPositioning Logic
Whenever
onMouseEnter,onFocus, oronClickevents fire, the component calculates possible positions and applies the first valid one. You can influence this by providing a preferredplacement. If the preferred position is unavailable, it falls back to a default order defined in the component's internal enum.Mobile Behavior
On mobile devices, users must click on the children to open the
TooltipPrimitive.DOM Rendering
To ensure the Tooltip renders in a specific location, add a
divwithid="tooltips"to your application. If this element is not found, the Tooltip will be rendered at the end of the DOM.Use dashes and hyphens correctly
masterDistinguish between these three types of dashes:
- Hyphen (-): Use for compound words without spaces (e.g.,
1-hour flight,co-traveler). - En-dash (–): Use for ranges of numbers or dates without spaces (e.g.,
12:30–14:35,1–2 days). When describing locations, replace with an arrow with spaces (e.g.,Prague → Barcelona). - Em-dash (—): Use instead of commas or colons, with spaces before and after (e.g.,
We checked you in — now you can download your boarding passes.).
- Hyphen (-): Use for compound words without spaces (e.g.,
How Accordion handles automatic accessibility
masterWhen
expandOnTileClickis set totrueon anAccordionSection, the component automatically manages several ARIA attributes and keyboard behaviors to ensure the header acts as a functional interactive element:- Role: The header is assigned
role="button". - State:
aria-expandedis toggled betweentrueandfalsebased on the section's state. - Relationship:
aria-controlsis used to associate the header with its corresponding content section. - Focus:
tabIndexis set to0, allowing the header to be included in the natural tab order.
Keyboard Navigation Support:
- Enter/Space: Toggles the expansion state when the header is focused.
- Tab / Shift + Tab: Navigates focus between headers and interactive elements within expanded sections.
<Accordion id="faq-accordion"> <AccordionSection id="section-1" header="What is Orbit?" expandOnTileClick> Orbit is Kiwi.com's design system for creating consistent user experiences across products. </AccordionSection> <AccordionSection id="section-2" header="How do I use Accordion?" expandOnTileClick> Import the Accordion and AccordionSection components and nest the sections within the accordion. </AccordionSection> </Accordion>- Role: The header is assigned
Use NotificationBadge for circled badges
masterIf your design requires acircledbadge, do not use the standardBadgecomponent. Instead, use the NotificationBadge component.Table visual behavior and styling
masterHover behavior
To help users match rows to columns in multi-column tables, Orbit tables feature a hover state. When a row is hovered, it receives a
<InlineToken name="paletteCloudNormal" />background, making the data easier to scan.Colors and styling
The
Tablecomponent supports configuration for:- Row backgrounds: Options for whether or not the table is striped.
- Text color: Options to adjust the color of the text within the table.