Skip to main content

Icon

The TkIcon component allows you to create a icon for adding visual information. It is also often useful in combination with other elements. This component uses Google's Material Symbols icons. For a complete list of available icon names, please visit: https://fonts.google.com/icons?icon.set=Material+Symbols

import { TkIcon } from '@takeoff-ui/react'

Basic​

Basic usage of the icon component.

View Code
<TkIcon icon="flight" />
<TkIcon icon="hotel" />
<TkIcon icon="directions_car" />
<TkIcon icon="local_dining" />

Variants​

Different variants of the icon component.

View Code
<TkIcon icon="flight" variant="primary" />
<TkIcon icon="flight" variant="secondary" />
<TkIcon icon="flight" variant="neutral" />
<TkIcon icon="flight" variant="info" />
<TkIcon icon="flight" variant="success" />
<TkIcon icon="flight" variant="warning" />
<TkIcon icon="flight" variant="danger" />
<TkIcon icon="flight" variant="white" />

Sign​

Display icons as signs.

View Code
<TkIcon icon="flight" sign variant="primary" />
<TkIcon icon="flight" sign variant="secondary" />
<TkIcon icon="flight" sign variant="neutral" />
<TkIcon icon="flight" sign variant="info" />
<TkIcon icon="flight" sign variant="success" />
<TkIcon icon="flight" sign variant="warning" />
<TkIcon icon="flight" sign variant="danger" />
<TkIcon icon="flight" sign variant="white" />

Sizes​

Available sizes for the icon component.

Standard Icons

small
base
medium
large
xlarge
xxlarge

Sign Icons

small
base
medium
large
xlarge
xxlarge
View Code
// Standard Icons
<TkIcon icon="flight" size="small" />
<TkIcon icon="flight" size="base" />
<TkIcon icon="flight" size="medium" />
<TkIcon icon="flight" size="large" />
<TkIcon icon="flight" size="xlarge" />
<TkIcon icon="flight" size="xxlarge" />

// Sign icons
<TkIcon icon="flight" sign size="small" />
<TkIcon icon="flight" sign size="base" />
<TkIcon icon="flight" sign size="medium" />
<TkIcon icon="flight" sign size="large" />
<TkIcon icon="flight" sign size="xlarge" />
<TkIcon icon="flight" sign size="xxlarge" />

Icon Types​

Different icon types (outlined, rounded, sharp).

outlined
rounded
sharp
View Code
<TkIcon icon="star" iconType="outlined" />
<TkIcon icon="star" iconType="rounded" />
<TkIcon icon="star" iconType="sharp" />

Custom Colors​

Custom color configurations for icons.

View Code
<TkIcon icon="flight" color="#FF5722" />
<TkIcon icon="flight" color="#2196F3" />
<TkIcon icon="flight" color="#4CAF50" />
<TkIcon icon="flight" sign backgroundColor="#F5F5F5" borderColor="#2196F3" iconColor="#2196F3" />
<TkIcon icon="flight" sign backgroundColor="#FFF9C4" borderColor="#FFC107" iconColor="#FFC107" />

API​

Props​

NameTypeDefaultDescription
stringnullThe background color of the sign (custom variant)
stringnullThe border color of the sign (custom variant)
stringnullThe color of the icon
booleannullIndicates whether the icon should be filled
stringnullSpecifies a material icon.
stringnullThe color of the icon (custom variant)
"i", "span"'i'The HTML tag to use for the icon element.
"outlined", "rounded", "sharp"'outlined'Specifies the type of the icon to be displayed.
booleanfalseControls whether the icon is shown as a sign (previously 'card' type)
"base", "large", "medium", "small", "xlarge", "xsmall", "xxlarge"'base'Sets size for the component.
"danger", "info", "neutral", "primary", "secondary", "success", "warning", "white"'primary'The variant of the icon.