Rost

← All components

component

Icon

One of Rost's 23 glyphs, 24px, in the colour of the text around it.

In code Contract: review Guidance: proposed Contract on GitHub Figma 92:15 As markdown
Icons/arrow-down
Icons/arrow-down-left
Icons/arrow-left
Icons/arrow-right
Icons/arrow-up
Icons/chevron-down
Icons/chevron-left
Icons/chevron-right
Icons/chevron-up
Icons/desktop
Icons/dot
Icons/down-right
Icons/drag
Icons/minus
Icons/mobile
Icons/plus
Icons/scroll
Icons/search
Icons/star
Icons/lock
Icons/up-left
Icons/up-right

Install

npx github:Runceanu/rost add icon

It lands in src/rost/icon/, with what it needs and its contract. Install has the rest.

When to use

  • Next to a label

    Next to a label, when the shape says the same thing faster. An arrow on "Back", a chevron on something that opens.

  • Inside a button

    Inside Button and IconButton, through their icon slot, at Small.

When not to use

  • Something to press

    On its own as something to press. That's IconButton, which gives it a target and states.

    Use IconButton

  • A picture with no job

    A picture with no job next to words. That's an Illustration, which keeps its own colours.

    Use Illustration

  • A glyph Rost lacks

    A glyph Rost doesn't have. Add the SVG to assets/icons/ and Figma's set first, so they stay the same list.

Behaviour

It takes the text colour it sits in. Figma draws them in non-interactive/foreground/tertiary (#999999); inside a Button it's the button's icon colour, state by state. The shapes are Figma's exports, kept as they are.

Accessibility

  • Hidden

    Next to words that say the same, it's aria-hidden="true". That's the default.

  • Labelled

    On its own and meaningful, pass label. It becomes role="img" with that aria-label.

Content

A label names what it means, not what it looks like. "Next", not "Right arrow".

Props

PropTypeValuesDefault
name enum arrow-down · arrow-down-left · arrow-left · arrow-right · arrow-up · chevron-down · chevron-left · chevron-right · chevron-up · circle-outline · desktop · dot · down-right · drag · lock · minus · mobile · plus · scroll · search · star · up-left · up-right arrow-right
size enum Medium · Small · XSmall Medium
label slot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • background currentColor no token yet

displayinline-block · vertical-alignmiddle · flex-shrink0 · mask-positioncenter · mask-sizecontain · mask-repeatno-repeat

Changes by variant

26 variants. Each table is what one thing changes with: a column per size, a row per property. Where every row starts with the same token path, it's written once, under the property.

Follows size

In 3 variants

PropertyMediumSmallXSmall
root.heightspacing/size/… small 24px xsmall 20px 2xsmall 16px
root.widthspacing/size/… small 24px xsmall 20px 2xsmall 16px

Follows name

In 23 variants

PropertyArrow-downArrow-down-leftArrow-leftArrow-rightArrow-upChevron-downChevron-leftChevron-rightChevron-upCircle-outlineDesktopDotDown-rightDragLockMinusMobilePlusScrollSearchStarUp-leftUp-right
root.mask-image url(./svg/arrow-down.svg) url(./svg/arrow-down-left.svg) url(./svg/arrow-left.svg) url(./svg/arrow-right.svg) url(./svg/arrow-up.svg) url(./svg/chevron-down.svg) url(./svg/chevron-left.svg) url(./svg/chevron-right.svg) url(./svg/chevron-up.svg) url(./svg/circle-outline.svg) url(./svg/desktop.svg) url(./svg/dot.svg) url(./svg/down-right.svg) url(./svg/drag.svg) url(./svg/lock.svg) url(./svg/minus.svg) url(./svg/mobile.svg) url(./svg/plus.svg) url(./svg/scroll.svg) url(./svg/search.svg) url(./svg/star.svg) url(./svg/up-left.svg) url(./svg/up-right.svg)