Icons
85 line icons leaning back 9° like the slanted pixel, or upright, each its own export, with SF Symbol twins in SwiftUI.
Usage
import { Button, CheckIcon, CircleAlertIcon, SearchIcon, TrashIcon } from '@tuttn/slant'
// 16px and decorative by default: the text beside it carries the meaning.
<Button><CheckIcon />Approve</Button>
// An icon-only control names the control, not the icon.
<Button icon aria-label="Delete"><TrashIcon /></Button>
// An icon that means something on its own gets a label.
<CircleAlertIcon label="Failed" style={{ color: 'var(--sl-danger)' }} />
// size takes pixels or any CSS length; '1em' follows the text.
<SearchIcon size="1em" strokeWidth={1.5} />
// Icons lean back 9° like the slanted pixel; upright draws one straight.
<SearchIcon upright />
Props
| Prop | Type | Default | Description |
|---|
size | number | string | 16 | Width and height, in pixels or any CSS length ('1em' follows the font size). |
label | string | — | Announced to screen readers (role="img"); omitted, the icon is aria-hidden. |
upright | boolean | false | Draws the icon straight, without the 9° lean. |
strokeWidth | number | 2 | Line weight in grid units; 1.5 reads lighter at 20px and up. |
…rest | SVGAttributes<SVGSVGElement> | — | className, style and other attributes go on the svg. |
Every icon is a line drawing on the same 24-unit grid with a round 2-unit stroke, leaning back 9° about its centre like the slanted pixel (--sl-slant). Pass upright for the straight drawing, for example beside upright type in dense tables. The lean is part of the drawing, so a transform you put on an icon, such as a rotated chevron, still applies on top of it. Icons are coloured by currentColor, so each takes the colour of the text around it. Each one is its own export, so a bundle carries only the icons it imports, and each ends in Icon so MenuIcon never shadows the Menu component. The shapes are drawn after Lucide (ISC), and Slant's own components use the same set.
In SwiftUI, TUTTNKit's SlantIcon has a case for every icon under the same name. Each case is a view that draws the SF Symbol carrying its meaning, leaned back by the same 9°, so it follows Dynamic Type and font weight: SlantIcon.search.font(.body). SlantIcon.search.upright is the plain symbol as an Image, and .tuttnSlanted() leans any other view. A test keeps the two lists in step.
| React | SwiftUI | SF Symbol |
|---|
ArrowDownIcon | .arrowDown | arrow.down |
ArrowLeftIcon | .arrowLeft | arrow.left |
ArrowRightIcon | .arrowRight | arrow.right |
ArrowUpDownIcon | .arrowUpDown | arrow.up.arrow.down |
ArrowUpIcon | .arrowUp | arrow.up |
ArrowUpRightIcon | .arrowUpRight | arrow.up.right |
BellIcon | .bell | bell |
BoldIcon | .bold | bold |
CalendarIcon | .calendar | calendar |
CheckCheckIcon | .checkCheck | checklist |
CheckIcon | .check | checkmark |
ChevronDownIcon | .chevronDown | chevron.down |
ChevronLeftIcon | .chevronLeft | chevron.left |
ChevronRightIcon | .chevronRight | chevron.right |
ChevronUpIcon | .chevronUp | chevron.up |
CircleAlertIcon | .circleAlert | exclamationmark.circle |
CircleCheckIcon | .circleCheck | checkmark.circle |
CircleIcon | .circle | circle |
CircleXIcon | .circleX | xmark.circle |
ClockIcon | .clock | clock |
CodeIcon | .code | chevron.left.forwardslash.chevron.right |
CommandIcon | .command | command |
CopyIcon | .copy | doc.on.doc |
CornerDownLeftIcon | .cornerDownLeft | arrow.turn.down.left |
DownloadIcon | .download | square.and.arrow.down |
ExternalLinkIcon | .externalLink | arrow.up.right.square |
EyeIcon | .eye | eye |
EyeOffIcon | .eyeOff | eye.slash |
FileIcon | .file | doc |
FileTextIcon | .fileText | doc.text |
FilterIcon | .filter | line.3.horizontal.decrease |
FolderIcon | .folder | folder |
GitBranchIcon | .gitBranch | arrow.triangle.branch |
GitPullRequestIcon | .gitPullRequest | arrow.triangle.pull |
GlobeIcon | .globe | globe |
GridIcon | .grid | square.grid.2x2 |
HashIcon | .hash | number |
HeartIcon | .heart | heart |
HomeIcon | .home | house |
ImageIcon | .image | photo |
InboxIcon | .inbox | tray |
InfoIcon | .info | info.circle |
ItalicIcon | .italic | italic |
LayersIcon | .layers | square.stack.3d.up |
LinkIcon | .link | link |
ListIcon | .list | list.bullet |
ListOrderedIcon | .listOrdered | list.number |
LockIcon | .lock | lock |
LogOutIcon | .logOut | rectangle.portrait.and.arrow.right |
MailIcon | .mail | envelope |
MenuIcon | .menu | line.3.horizontal |
MessageIcon | .message | bubble.left |
MinusIcon | .minus | minus |
MonitorIcon | .monitor | display |
MoonIcon | .moon | moon |
MoreIcon | .more | ellipsis |
PaperclipIcon | .paperclip | paperclip |
PauseIcon | .pause | pause |
PencilIcon | .pencil | pencil |
PlayIcon | .play | play |
PlusIcon | .plus | plus |
QuoteIcon | .quote | quote.opening |
RefreshIcon | .refresh | arrow.triangle.2.circlepath |
SearchIcon | .search | magnifyingglass |
SendIcon | .send | paperplane |
SettingsIcon | .settings | slider.horizontal.3 |
SidebarIcon | .sidebar | sidebar.left |
SortAZIcon | .sortAZ | arrow.up.and.down.text.horizontal |
SparklesIcon | .sparkles | sparkles |
StarIcon | .star | star |
StopIcon | .stop | stop.fill |
SunIcon | .sun | sun.max |
TagIcon | .tag | tag |
TerminalIcon | .terminal | terminal |
ThumbsDownIcon | .thumbsDown | hand.thumbsdown |
ThumbsUpIcon | .thumbsUp | hand.thumbsup |
TrashIcon | .trash | trash |
TriangleAlertIcon | .triangleAlert | exclamationmark.triangle |
UndoIcon | .undo | arrow.counterclockwise |
UploadIcon | .upload | square.and.arrow.up |
UserIcon | .user | person |
UserPlusIcon | .userPlus | person.badge.plus |
UsersIcon | .users | person.2 |
WrapTextIcon | .wrapText | return |
XIcon | .x | xmark |