Spinner
Twilio's Spinner component
- Status
- production
- Version
- 7.0.2
- Import from
@twilio-paste/core/spinner— or —@twilio-paste/spinner
Guidelines#
About Spinner#
The spinner is an icon component that can be used in situations where you would like to communicate a loading state to the user. It inherits a lot of properties from the Icon component.
Accessible animation
The spinner animation will automatically respect user preferences set at the operating system level via the prefers reduced motion API.
Examples#
Default#
The default Spinner settings are using the default icon size and color, which is designed to match our default text size and color.
Accessibility
You are required to set whether the Spinner is decorative or not, please follow the icon accessibility guidelines.
<Spinner decorative={false} title="Loading" />
Sizing#
To resize the Spinner set a size prop. It will accept any valid icon size token as it's value. These are conveniently designed to be 1:1 to font sizing, e.g. font-size-40 can be paired with icon-size-40.
<Stack orientation="horizontal" spacing="space30"><Spinner size="sizeIcon10" decorative={false} title="Loading" /><Spinner size="sizeIcon20" decorative={false} title="Loading" /><Spinner size="sizeIcon30" decorative={false} title="Loading" /><Spinner size="sizeIcon40" decorative={false} title="Loading" /><Spinner size="sizeIcon50" decorative={false} title="Loading" /><Spinner size="sizeIcon60" decorative={false} title="Loading" /><Spinner size="sizeIcon70" decorative={false} title="Loading" /><Spinner size="sizeIcon80" decorative={false} title="Loading" /><Spinner size="sizeIcon90" decorative={false} title="Loading" /><Spinner size="sizeIcon100" decorative={false} title="Loading" /><Spinner size="sizeIcon110" decorative={false} title="Loading" /></Stack>
Setting a color#
The Spinner, like any other icon, can be re-colored to meet your needs. Set an color in the same way you would with an icon.
<Spinner color="colorTextSuccess" decorative={false} title="Loading" />
Usage Guide#
API#
Installation#
yarn add @twilio-paste/spinner - or - yarn add @twilio-paste/coreUsage#
import {Spinner} from '@twilio-paste/spinner';const Component = () => { return <Spinner decorative={false} title="Loading" />;};Spinner Props#
as?: keyof JSX.IntrinsicElements
Changes the sematic element of the spinner wrapper.
decorative?: boolean
Whether or not the SVG is just visual flair or adds meaning to the page. Specifically for screenreaders to know whether to read out the title or not.
title?: string
The accessibility text that is read when screenreaders get to this component.
size?: IconSize
Used to change the size of the Spinner.
color?: TextColor
Sets the icon color to any of our text color tokens or currentColor, which inherits text color from the parent element.
delay?: number
Time delay in milliseconds of the animation.
Changelog
7.0.2#
Patch Changes#
0eded1fd#1319 Thanks @SiTaggart! - Change internal dependencies to have minor range matching on version numbers
7.0.1#
Patch Changes#
- Updated dependencies [
514bd5aa,514bd5aa]:- @twilio-paste/theme@5.0.1
- @twilio-paste/icons@5.1.1
- @twilio-paste/box@4.0.2
- @twilio-paste/style-props@3.0.1
7.0.0#
Patch Changes#
- Updated dependencies [
8b5a8592]:- @twilio-paste/icons@5.1.0
6.0.1#
Patch Changes#
- Updated dependencies [
509eba7a]:- @twilio-paste/box@4.0.1
- @twilio-paste/icons@5.0.1
6.0.0#
Patch Changes#
- Updated dependencies [
4c9ed5ca,26c828d8]:- @twilio-paste/design-tokens@6.6.0
- @twilio-paste/theme@5.0.0
- @twilio-paste/box@4.0.0
- @twilio-paste/icons@5.0.0
- @twilio-paste/style-props@3.0.0
5.0.2#
Patch Changes#
- Updated dependencies [
944c3407,af779398]:- @twilio-paste/design-tokens@6.5.2
- @twilio-paste/icons@4.0.2
- @twilio-paste/box@3.0.1
- @twilio-paste/style-props@2.0.1
- @twilio-paste/theme@4.3.1
5.0.1#
Patch Changes#
- Updated dependencies [
7340a6a5]:- @twilio-paste/icons@4.0.1
5.0.0#
Patch Changes#
- Updated dependencies [
f1675586]:- @twilio-paste/theme@4.3.0
- @twilio-paste/box@3.0.0
- @twilio-paste/icons@4.0.0
- @twilio-paste/style-props@2.0.0
4.0.1#
Patch Changes#
a12acb61#1158 Thanks @richbachman! - Pinned all twilio-paste package versions in order to keep them in sync with core when they are updated by changesets.Updated dependencies [
a12acb61,a12acb61,a12acb61,a12acb61]:- @twilio-paste/theme@4.2.2
- @twilio-paste/style-props@1.9.2
- @twilio-paste/box@2.13.2
- @twilio-paste/icons@3.13.1
4.0.0#
Patch Changes#
- Updated dependencies [
4114dac2]:- @twilio-paste/icons@3.13.0
All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
3.1.1 (2021-01-25)
Note: Version bump only for package @twilio-paste/spinner
Features#
3.0.5 (2021-01-15)
Note: Version bump only for package @twilio-paste/spinner
3.0.4 (2021-01-14)
Note: Version bump only for package @twilio-paste/spinner
3.0.3 (2021-01-13)
Note: Version bump only for package @twilio-paste/spinner
3.0.2 (2021-01-07)
Note: Version bump only for package @twilio-paste/spinner
3.0.1 (2020-12-17)
Note: Version bump only for package @twilio-paste/spinner
Bug Fixes#
- spinner: add forwardRef (4045250)
BREAKING CHANGES#
- spinner: component is now using fowardRef
2.0.41 (2020-12-15)
Note: Version bump only for package @twilio-paste/spinner
2.0.40 (2020-12-11)
Note: Version bump only for package @twilio-paste/spinner
2.0.39 (2020-12-11)
Note: Version bump only for package @twilio-paste/spinner
2.0.38 (2020-12-09)
Note: Version bump only for package @twilio-paste/spinner
2.0.37 (2020-12-03)
Note: Version bump only for package @twilio-paste/spinner
2.0.36 (2020-12-02)
Note: Version bump only for package @twilio-paste/spinner
2.0.35 (2020-11-16)
Note: Version bump only for package @twilio-paste/spinner
2.0.34 (2020-11-11)
Note: Version bump only for package @twilio-paste/spinner
2.0.33 (2020-11-10)
Note: Version bump only for package @twilio-paste/spinner
2.0.32 (2020-11-06)
Note: Version bump only for package @twilio-paste/spinner
2.0.31 (2020-11-05)
Note: Version bump only for package @twilio-paste/spinner
2.0.30 (2020-10-30)
Note: Version bump only for package @twilio-paste/spinner
2.0.29 (2020-10-29)
Note: Version bump only for package @twilio-paste/spinner
2.0.28 (2020-10-23)
Note: Version bump only for package @twilio-paste/spinner
2.0.27 (2020-10-21)
Note: Version bump only for package @twilio-paste/spinner
2.0.26 (2020-10-19)
Note: Version bump only for package @twilio-paste/spinner
2.0.25 (2020-10-15)
Note: Version bump only for package @twilio-paste/spinner
2.0.24 (2020-10-13)
Note: Version bump only for package @twilio-paste/spinner
2.0.23 (2020-10-09)
Note: Version bump only for package @twilio-paste/spinner
2.0.22 (2020-10-07)
Note: Version bump only for package @twilio-paste/spinner
2.0.21 (2020-10-07)
Note: Version bump only for package @twilio-paste/spinner
2.0.20 (2020-10-07)
Note: Version bump only for package @twilio-paste/spinner
2.0.19 (2020-10-07)
Note: Version bump only for package @twilio-paste/spinner
2.0.18 (2020-09-22)
Note: Version bump only for package @twilio-paste/spinner
2.0.17 (2020-09-21)
Note: Version bump only for package @twilio-paste/spinner
2.0.16 (2020-09-15)
Note: Version bump only for package @twilio-paste/spinner
2.0.15 (2020-09-15)
Note: Version bump only for package @twilio-paste/spinner
2.0.14 (2020-09-14)
Note: Version bump only for package @twilio-paste/spinner
2.0.13 (2020-09-10)
Note: Version bump only for package @twilio-paste/spinner
2.0.12 (2020-09-09)
Note: Version bump only for package @twilio-paste/spinner
2.0.11 (2020-09-09)
Note: Version bump only for package @twilio-paste/spinner
2.0.10 (2020-09-08)
Note: Version bump only for package @twilio-paste/spinner
2.0.9 (2020-09-08)
Note: Version bump only for package @twilio-paste/spinner
2.0.8 (2020-09-03)
Note: Version bump only for package @twilio-paste/spinner
2.0.7 (2020-08-31)
Note: Version bump only for package @twilio-paste/spinner
2.0.6 (2020-08-31)
Note: Version bump only for package @twilio-paste/spinner
2.0.5 (2020-08-24)
Note: Version bump only for package @twilio-paste/spinner
2.0.4 (2020-08-19)
Note: Version bump only for package @twilio-paste/spinner
2.0.3 (2020-08-12)
Note: Version bump only for package @twilio-paste/spinner
2.0.2 (2020-08-12)
Note: Version bump only for package @twilio-paste/spinner
2.0.1 (2020-08-06)
Note: Version bump only for package @twilio-paste/spinner
Bug Fixes#
BREAKING CHANGES#
icons: This change renames a key prop and changes the display mode from inline-flex to block
fix: use new icon prop (iconColor -> color)
test: update snapshots
chore(icons): update readme to mention correct display value
Co-authored-by: Rich Bachman rb@richbachman.com
- chore(website): update icon doc prop table
Co-authored-by: Rich Bachman rb@richbachman.com
Co-authored-by: Rich Bachman rb@richbachman.com
1.2.33 (2020-08-04)
Note: Version bump only for package @twilio-paste/spinner
1.2.32 (2020-08-04)
Note: Version bump only for package @twilio-paste/spinner
1.2.31 (2020-07-30)
Note: Version bump only for package @twilio-paste/spinner
1.2.30 (2020-07-29)
Note: Version bump only for package @twilio-paste/spinner
1.2.29 (2020-07-28)
Note: Version bump only for package @twilio-paste/spinner
1.2.28 (2020-07-22)
Note: Version bump only for package @twilio-paste/spinner
1.2.27 (2020-07-20)
Note: Version bump only for package @twilio-paste/spinner
1.2.26 (2020-07-15)
Note: Version bump only for package @twilio-paste/spinner
1.2.25 (2020-07-14)
Note: Version bump only for package @twilio-paste/spinner
1.2.24 (2020-07-14)
Note: Version bump only for package @twilio-paste/spinner
1.2.23 (2020-07-02)
Note: Version bump only for package @twilio-paste/spinner
1.2.22 (2020-07-02)
Note: Version bump only for package @twilio-paste/spinner
1.2.21 (2020-07-01)
Note: Version bump only for package @twilio-paste/spinner
1.2.20 (2020-06-25)
Note: Version bump only for package @twilio-paste/spinner
1.2.19 (2020-06-25)
Note: Version bump only for package @twilio-paste/spinner
1.2.18 (2020-06-23)
Note: Version bump only for package @twilio-paste/spinner
1.2.17 (2020-06-22)
Note: Version bump only for package @twilio-paste/spinner
1.2.16 (2020-06-18)
Note: Version bump only for package @twilio-paste/spinner
1.2.15 (2020-06-16)
Note: Version bump only for package @twilio-paste/spinner
1.2.14 (2020-06-12)
Note: Version bump only for package @twilio-paste/spinner
1.2.13 (2020-06-10)
Note: Version bump only for package @twilio-paste/spinner
1.2.12 (2020-06-05)
Note: Version bump only for package @twilio-paste/spinner
1.2.11 (2020-06-01)
Note: Version bump only for package @twilio-paste/spinner
1.2.10 (2020-06-01)
Note: Version bump only for package @twilio-paste/spinner
1.2.9 (2020-05-28)
Note: Version bump only for package @twilio-paste/spinner
1.2.8 (2020-05-20)
Note: Version bump only for package @twilio-paste/spinner
1.2.7 (2020-05-07)
Note: Version bump only for package @twilio-paste/spinner
1.2.6 (2020-05-07)
Note: Version bump only for package @twilio-paste/spinner
1.2.5 (2020-05-04)
Note: Version bump only for package @twilio-paste/spinner
1.2.4 (2020-05-01)
Note: Version bump only for package @twilio-paste/spinner
1.2.3 (2020-04-25)
Note: Version bump only for package @twilio-paste/spinner
1.2.2 (2020-04-22)
Note: Version bump only for package @twilio-paste/spinner
1.2.1 (2020-04-20)
Note: Version bump only for package @twilio-paste/spinner
Features#
- components: promote text components, spinner and primitive to prod (5605adc)
1.1.30 (2020-04-15)
Note: Version bump only for package @twilio-paste/spinner
1.1.29 (2020-04-08)
Bug Fixes#
- spinner: package dependencies updated to be correct (05b7f6a)
1.1.28 (2020-04-07)
Note: Version bump only for package @twilio-paste/spinner
1.1.27 (2020-04-07)
Note: Version bump only for package @twilio-paste/spinner
1.1.26 (2020-04-02)
Note: Version bump only for package @twilio-paste/spinner
1.1.25 (2020-03-24)
Bug Fixes#
- spinner: switch from theme-tokens to theme package dep (0415762)
1.1.24 (2020-03-17)
Note: Version bump only for package @twilio-paste/spinner
1.1.23 (2020-03-17)
Note: Version bump only for package @twilio-paste/spinner
1.1.22 (2020-03-11)
Note: Version bump only for package @twilio-paste/spinner
1.1.21 (2020-03-06)
Note: Version bump only for package @twilio-paste/spinner
1.1.20 (2020-03-02)
Note: Version bump only for package @twilio-paste/spinner
1.1.19 (2020-03-02)
Note: Version bump only for package @twilio-paste/spinner
1.1.18 (2020-02-28)
Note: Version bump only for package @twilio-paste/spinner
1.1.17 (2020-02-26)
Bug Fixes#
1.1.16 (2020-02-21)
Note: Version bump only for package @twilio-paste/spinner
1.1.15 (2020-02-20)
Note: Version bump only for package @twilio-paste/spinner
1.1.14 (2020-02-19)
Note: Version bump only for package @twilio-paste/spinner
1.1.13 (2020-02-18)
Note: Version bump only for package @twilio-paste/spinner
1.1.12 (2020-02-14)
Bug Fixes#
- spinner: add missing peer deps (f4d3d83)
1.1.11 (2020-02-13)
Note: Version bump only for package @twilio-paste/spinner
1.1.10 (2020-02-11)
Note: Version bump only for package @twilio-paste/spinner
1.1.9 (2020-02-11)
Note: Version bump only for package @twilio-paste/spinner
1.1.8 (2020-02-03)
Note: Version bump only for package @twilio-paste/spinner
1.1.7 (2020-01-27)
Note: Version bump only for package @twilio-paste/spinner
1.1.6 (2020-01-25)
Note: Version bump only for package @twilio-paste/spinner
1.1.5 (2020-01-24)
Note: Version bump only for package @twilio-paste/spinner
1.1.4 (2020-01-17)
Note: Version bump only for package @twilio-paste/spinner
1.1.3 (2019-12-20)
Note: Version bump only for package @twilio-paste/spinner
1.1.2 (2019-12-19)
Note: Version bump only for package @twilio-paste/spinner
1.1.1 (2019-12-05)
Bug Fixes#
Features#
1.0.2 (2019-11-18)
Bug Fixes#
1.0.1 (2019-11-12)
Note: Version bump only for package @twilio-paste/spinner
Features#
BREAKING CHANGES#
icons: removed all the inherited icons since we're moving to a new system
chore(icons): update icon list for storybook
fix(spinner): use new icon
fix(storybook): use new icon for story
fix(story): button icons should be 24px
fix: adjust icon size tokens
feat: add iconSizes as separate key in theme-tokens
feat(icons): icons package to use tokens and update icons
fix(spinner): update to use tokens and new icons
fix(button): use correct spinner size
fix(icons): major icons package fixes
- huge overhaul to build process
- now uses rollup
- builds into cjs and esm directories
- made the package publishable to npm
- moved svg folder out of src, now src only holds react stuff
- updated scripts to use new paths and cleaned up the code
- programmatically generates rollup config from the icon-list command
chore: add new icons dist folders to gitignore
fix: spinner and button icon usage
feat(icons): add rollup icon list cache file
fix(core-bundle): sort packages for consistent builds
chore: use
esminstead ofesin rollup for correctnesschore: yarn.lock
fix(spinner): lint error
chore(icons): move rollup icon list
chore(spinner): use types package in story
fix(spinner): swap out destructured props for explicit props
Features#
0.1.6 (2019-09-16)
Note: Version bump only for package @twilio-paste/spinner