TileA 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";
Guidelines When to useTo 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 . ContentHave an heading and a content. UsageTiles behaves like a radio button or a checkbox depending if it's used in a single or multiple selection context .
BasicA tile consists of minimally an heading and some content.
Buy a ticket Purchase a ticket for any of our space travel adventure. Editable example
< Tile >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
ImageA tile can have an image .
Buy a ticket Tickets are not refundable and not transferable. A confirmation email will be sent within the next few minutes. Editable example
< Tile >
< Image src = { SpacePortraitHorizontal } alt = " Planet over another planet " />
< Heading > Buy a ticket </ Heading >
< Content >
Tickets are not refundable and not transferable. A confirmation email will be sent within
the next few minutes.
</ Content >
</ Tile >
Or an illustration with a background color.
Buy a ticket Tickets are not refundable and not transferable. A confirmation email will be sent within the next few minutes Editable example
< Tile >
< Illustration backgroundColor = " alias-accent-light " >
< Image src = { Planet } width = " 100px " alt = " Planet " />
</ Illustration >
< Heading > Buy a ticket </ Heading >
< Content >
Tickets are not refundable and not transferable. A confirmation email will be sent within
the next few minutes
</ Content >
</ Tile >
CheckedA tile can be checked.
Buy a ticket Purchase a ticket for any of our space travel adventure. Editable example
< Tile defaultChecked >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
DisabledA tile can be disabled.
Buy a ticket Purchase a ticket for any of our space travel adventure. Editable example
< Tile disabled >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
OrientationA tile can render horizontally.
Buy a ticket Tickets are not refundable and not transferable. A confirmation email will be sent within the next few minutes. Buy a ticket Tickets are not refundable and not transferable. A confirmation email will be sent within the next few minutes. Editable example
< Inline
wrap = { {
base : true ,
md : false
} }
>
< Tile orientation = " horizontal " >
< Image src = { SpacePortrait } alt = " Space Portrait " />
< Heading > Buy a ticket </ Heading >
< Content >
Tickets are not refundable and not transferable. A confirmation email will be sent
within the next few minutes.
</ Content >
</ Tile >
< Tile orientation = " horizontal " >
< Illustration >
< Image src = { Planet } width = " 100px " alt = " Planet " />
</ Illustration >
< Heading > Buy a ticket </ Heading >
< Content >
Tickets are not refundable and not transferable. A confirmation email will be sent
within the next few minutes.
</ Content >
</ Tile >
</ Inline >
ControlledA tite can handle checked
state in controlled mode.
Buy a ticket Purchase a ticket for any of our space travel adventure. Editable example
( ) => {
const [ isChecked , setIsChecked ] = useState ( false ) ;
const handleChange = useCallback ( ( ) => {
setIsChecked ( x => ! x ) ;
console . log ( ! isChecked ) ;
} , [ isChecked , setIsChecked ] ) ;
return (
< Tile checked = { isChecked } onChange = { handleChange } >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
) ;
} ;
TileLinkA tile can also be navigable. It is similar to a link and it does share the same props.
Editable example
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ TileLink >
React routerTo 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 >
) ;
} ;
TileGroupRelated 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
< TileGroup >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ TileLink >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Refund a ticket </ Heading >
< Content > Get a refund for any space travel adventure ticket. </ Content >
</ TileLink >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Manage Account </ Heading >
< Content > Update your address or any other information related to your account. </ Content >
</ TileLink >
</ TileGroup >
Single selectionA tile group can allow a single selection. This is a behavior similar to a radio group .
Buy a ticket Purchase a ticket for any of our space travel adventure. Refund a ticket Get a refund for any space travel adventure ticket. Manage Account Update your address or any other information related to your account. Editable example
< TileGroup selectionMode = " single " >
< Tile value = " buy " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
< Tile value = " refund " >
< Heading > Refund a ticket </ Heading >
< Content > Get a refund for any space travel adventure ticket. </ Content >
</ Tile >
< Tile value = " manage-account " >
< Heading > Manage Account </ Heading >
< Content > Update your address or any other information related to your account. </ Content >
</ Tile >
</ TileGroup >
Multiple selectionA tile group can allow a multiple selection. This is a behavior similar to a checkbox group .
Buy a ticket Purchase a ticket for any of our space travel adventure. Refund a ticket Get a refund for any space travel adventure ticket. Manage Account Update your address or any other information related to your account. Editable example
< TileGroup selectionMode = " multiple " >
< Tile value = " buy " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
< Tile value = " refund " >
< Heading > Refund a ticket </ Heading >
< Content > Get a refund for any space travel adventure ticket. </ Content >
</ Tile >
< Tile value = " manage-account " >
< Heading > Manage Account </ Heading >
< Content > Update your address or any other information related to your account. </ Content >
</ Tile >
</ TileGroup >
Row sizeA tile group can have multiple tiles on the same row.
Editable example
< TileGroup
rowSize = { {
base : "1" ,
md : "2" ,
lg : "3"
} }
>
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ TileLink >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Refund a ticket </ Heading >
< Content > Get a refund for any space travel adventure ticket. </ Content >
</ TileLink >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Manage Account </ Heading >
< Content > Update your address or any other information related to your account. </ Content >
</ TileLink >
</ TileGroup >
WrapA tile group tiles will wrap on multiple lines automatically.
Editable example
< TileGroup rowSize = { 2 } >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ TileLink >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Refund a ticket </ Heading >
< Content > Get a refund for any space travel adventure ticket. </ Content >
</ TileLink >
< TileLink href = " https://www.virgingalactic.com " >
< Heading > Manage Account </ Heading >
< Content > Update your address or any other information related to your account. </ Content >
</ TileLink >
</ TileGroup >
ControlledA tile group with selection can handle value
state in controlled mode.
Buy a ticket Purchase a ticket for any of our space travel adventure. Refund a ticket Get a refund for any space travel adventure ticket. Manage Account Update your address or any other information related to your account. Editable example
( ) => {
const [ value , setValue ] = useState ( [ ] ) ;
const handleChange = useCallback (
( event , newValue ) => {
setValue ( newValue ) ;
console . log ( newValue ) ;
} ,
[ setValue ]
) ;
return (
< TileGroup
value = { value }
selectionMode = " multiple "
onChange = { handleChange }
rowSize = { {
base : "1" ,
md : "2" ,
lg : "3"
} }
>
< Tile value = " buy " >
< Heading > Buy a ticket </ Heading >
< Content > Purchase a ticket for any of our space travel adventure. </ Content >
</ Tile >
< Tile value = " refund " >
< Heading > Refund a ticket </ Heading >
< Content > Get a refund for any space travel adventure ticket. </ Content >
</ Tile >
< Tile value = " manage-account " >
< Heading > Manage Account </ Heading >
< Content >
Update your address or any other information related to your account.
</ Content >
</ Tile >
</ TileGroup >
) ;
} ;
API Tile
usage import { Tile } from "@sharegate/orbit-ui";
slots "image", "illustration", "heading", "content"
Name Description Default autoFocus Whether or not the tile should autoFocus on render.
- checked A controlled checked value.
- children * React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
- defaultChecked The initial value of checked
when uncontrolled.
- onChange Called when the tile checked state change.
(event: SyntheticEvent<Element, Event>, isChecked: boolean) => void
event
React's original event. isChecked
Whether 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.
-
TileLink
usage import { TileLink } from "@sharegate/orbit-ui";
slots "image", "illustration", "heading", "content"
Name Description Default autoFocus Whether or not the link should autoFocus on render.
- disabled Whether or not the link is disabled.
- external Whether or not this is an external link.
- href - orientation The orientation of the tile.
"horizontal" | "vertical" | ResponsiveValue<TileOrientation>
vertical
rel - slot - target -
TileGroup
usage import { TileGroup } from "@sharegate/orbit-ui";
Name Description Default 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.
- 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.
- inline Whether or not the element generate line breaks before or after himself.
- onChange Called when any of the children is checked or unchecked..
(event: SyntheticEvent<Element, Event>, value: string[]) => void
event
React's original event. value
The new value.
- reverse Whether or not to reverse the order of the elements.
- rowSize The number of tiles per row.
number | ResponsiveValue<number>
1
selectionMode The type of selection that is allowed.
"none"
value The value of the tile group.
string[]
-
Heading
usage import { Heading } from "@sharegate/orbit-ui";
Name Description Default size An heading can vary in size.
"xs" | "sm" | "md" | "lg" | "xl" | "2xs" | ResponsiveValue<"xs" | "sm" | "md" | "lg" | "xl" | "2xs">
- slot -
Content
usage import { Content } from "@sharegate/orbit-ui";
Name Description Default children * React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
- slot -