General
Icon
Porto Faifo Symbols at three optical sizes.
import { Icon } from 'faifo-design'Icon draws one symbol from the bundled
Porto Faifo Symbols set. Each symbol has a drawing for 16,
20 and 24 pixels, so a small icon is not a scaled-down large one. An icon takes the colour of the
text around it unless a tone says otherwise.
#When to use
- Pass a
labelonly when the icon stands alone and carries meaning. Inside a button or beside a label it is decoration and stays hidden from assistive technology. - Use
IconButtonfor an action shown as a symbol; it owns the hit area, the name and the tooltip. - Use
ThumbnailorAvatarfor a record's picture or a person. Icons are for interface meaning, not content.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Text and Porto Faifo symbols
Typography role, document semantics and shared icon geometry.
Operations
One typography contract for every component.
Show codeHide code
import { Icon, Inline, Stack, Text } from 'faifo-design'
export const Example = () => (
<Stack
items={[
<Text as="h3" variant="headingLg">
Operations
</Text>,
<Text as="p" variant="bodyMd">
One typography contract for every component.
</Text>,
<Inline
items={[
<Icon name="layers-3" label="Workspace" />,
<Icon name="building-2" label="Company" />,
<Icon name="layout-grid" label="Applications" />,
<Icon name="sun" label="Light theme" />,
<Icon name="moon" label="Dark theme" />,
<Icon name="info" label="Information" />,
<Icon name="circle-check" tone="positive" label="Complete" />,
<Text numeric>1,284.00</Text>,
]}
/>,
]}
/>
)#API
Generated from the package source. A property without a description has none in the source yet.
#IconComponent
| Property | Description | Type | Default |
|---|---|---|---|
namerequired | – | IconName | – |
size | – | 'small' | 'default' | 'large' | 'default' |
tone | – | 'inherit' | 'muted' | 'info' | 'positive' | 'warning' | 'danger' | 'inherit' |
label | Omit for decoration; the containing control owns its accessible name. | string | – |
#Types
#IconName
type IconName = keyof typeof portoFaifoSymbols#IconProps
The properties of Icon, listed above.
#Hooks
The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.
icon