No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Tile

A tile groups information into an interactive element to let users browse and take action on a group of related items.

usage
import { Tile, TileLink, TileGroup, Heading, Content } from "@sharegate/orbit-ui";
sources
Github

Guidelines

When to use

  • To let the user make a choice while giving more context than with a radio group or a checkbox.
  • To let the user navigate to another page while giving more context than with a link.

Content

  • Have an heading and a content.

Usage

Tiles behaves like a radio button or a checkbox depending if it's used in a single or multiple selection context.

Basic

A tile consists of minimally an heading and some content.

Editable example

Image

A tile can have an image.

Editable example

Or an illustration with a background color.

Editable example

Checked

A tile can be checked.

Editable example

Disabled

A tile can be disabled.

Editable example

Orientation

A tile can render horizontally.

Editable example

Controlled

A tite can handle checked state in controlled mode.

Editable example

A tile can also be navigable. It is similar to a link and it does share the same props.

Editable example

React router

To integrate with a third-party routing library like React Router any link component can be rendered as a React Router Link or as any other custom component.

import { Link } from "react-router-dom";
const RouterTileLink = as(TileLink, Link);
() => {
return (
<RouterTileLink to="/buy">
<Heading>Buy a ticket</Heading>
<Content>Purchase a ticket for any of our space travel adventure.</Content>
</RouterTileLink>
);
};

TileGroup

Related tiles can be grouped together. By default a tile group doesn't allow any selection. This is usually what you want if you need to group together navigable tiles.

Editable example

Single selection

A tile group can allow a single selection. This is a behavior similar to a radio group.

Editable example

Multiple selection

A tile group can allow a multiple selection. This is a behavior similar to a checkbox group.

Editable example

Row size

A tile group can have multiple tiles on the same row.

Editable example

Wrap

A tile group tiles will wrap on multiple lines automatically.

Editable example

Controlled

A tile group with selection can handle value state in controlled mode.

Editable example

API

Tile

usage
import { Tile } from "@sharegate/orbit-ui";
slots
"image", "illustration", "heading", "content"
NameDescriptionDefault
autoFocus
Whether or not the tile should autoFocus on render.
numberfalsetrue
-
checked
A controlled checked value.
falsetrue
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
defaultChecked
The initial value of checked when uncontrolled.
falsetrue
-
onChange
Called when the tile checked state change.
(event: SyntheticEvent<Element, Event>, isChecked: boolean) => void
eventReact's original event.
isCheckedWhether the tile is checked or not.
-
orientation
The orientation of the tile.
"horizontal" | "vertical" | ResponsiveValue<TileOrientation>
-
value
The value to associate with when in a group.
string
-
usage
import { TileLink } from "@sharegate/orbit-ui";
slots
"image", "illustration", "heading", "content"
NameDescriptionDefault
autoFocus
Whether or not the link should autoFocus on render.
numberfalsetrue
-
disabled
Whether or not the link is disabled.
falsetrue
-
external
Whether or not this is an external link.
falsetrue
-
href
See MDN.
string
-
orientation
The orientation of the tile.
"horizontal" | "vertical" | ResponsiveValue<TileOrientation>
vertical
rel
See MDN.
string
-
slot
Slot to render into.
string
-
target
See MDN.
string
-

TileGroup

usage
import { TileGroup } from "@sharegate/orbit-ui";
NameDescriptionDefault
align
The alignment of the elements.
"center" | "end" | "start" | ResponsiveValue<FlexAlignment>
-
autoFocus
Whether or not the first tile of the group should autoFocus on render.
numberfalsetrue
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
defaultValue
The initial value of value.
string[]
-
disabled
Whether or not the tiles are disabled.
falsetrue
-
inline
Whether or not the element generate line breaks before or after himself.
falsetrue
-
onChange
Called when any of the children is checked or unchecked..
(event: SyntheticEvent<Element, Event>, value: string[]) => void
eventReact's original event.
valueThe new value.
-
reverse
Whether or not to reverse the order of the elements.
falsetrue
-
rowSize
The number of tiles per row.
number | ResponsiveValue<number>
1
selectionMode
The type of selection that is allowed.
"none""multiple""single"
"none"
value
The value of the tile group.
string[]
-

Heading

usage
import { Heading } from "@sharegate/orbit-ui";
NameDescriptionDefault
size
An heading can vary in size.
"xs" | "sm" | "md" | "lg" | "xl" | "2xs" | ResponsiveValue<"xs" | "sm" | "md" | "lg" | "xl" | "2xs">
-
slot
Slot to render into.
string
-

Content

usage
import { Content } from "@sharegate/orbit-ui";
NameDescriptionDefault
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
slot
Slot to render into.
string
-