The Core package includes all components and libraries in Paste.
Show full package list
Package | Version |
---|---|
@twilio-paste/account-switcher | ^3.0.1 |
@twilio-paste/alert | ^14.1.0 |
@twilio-paste/alert-dialog | ^9.2.0 |
@twilio-paste/anchor | ^12.1.0 |
@twilio-paste/animation-library | ^2.0.0 |
@twilio-paste/aspect-ratio | ^10.1.0 |
@twilio-paste/avatar | ^9.1.0 |
@twilio-paste/badge | ^8.1.0 |
@twilio-paste/base-radio-checkbox | ^13.1.0 |
@twilio-paste/box | ^10.2.0 |
@twilio-paste/breadcrumb | ^11.1.1 |
@twilio-paste/button | ^14.1.0 |
@twilio-paste/button-group | ^4.1.0 |
@twilio-paste/callout | ^4.1.0 |
@twilio-paste/card | ^9.1.0 |
@twilio-paste/chat-composer | ^5.1.1 |
@twilio-paste/chat-log | ^5.2.0 |
@twilio-paste/checkbox | ^13.1.1 |
@twilio-paste/clipboard-copy-library | ^3.0.0 |
@twilio-paste/code-block | ^4.1.0 |
@twilio-paste/code-editor-library | ^2.0.0 |
@twilio-paste/color-contrast-utils | ^5.0.0 |
@twilio-paste/combobox | ^16.2.1 |
@twilio-paste/combobox-primitive | ^2.1.1 |
@twilio-paste/customization | ^8.1.1 |
@twilio-paste/data-grid | ^8.2.1 |
@twilio-paste/data-visualization-library | ^5.0.0 |
@twilio-paste/date-picker | ^6.1.0 |
@twilio-paste/description-list | ^4.2.0 |
@twilio-paste/design-tokens | ^10.3.0 |
@twilio-paste/detail-text | ^3.1.0 |
@twilio-paste/disclosure | ^12.1.0 |
@twilio-paste/disclosure-primitive | ^2.1.1 |
@twilio-paste/display-heading | ^4.1.0 |
@twilio-paste/display-pill-group | ^8.0.1 |
@twilio-paste/dropdown-library | ^3.0.0 |
@twilio-paste/editable-code-block | ^2.1.0 |
@twilio-paste/file-picker | ^4.1.0 |
@twilio-paste/file-uploader | ^4.1.0 |
@twilio-paste/flex | ^8.1.0 |
@twilio-paste/form | ^11.1.1 |
@twilio-paste/form-pill-group | ^8.0.1 |
@twilio-paste/grid | ^8.1.1 |
@twilio-paste/heading | ^11.1.1 |
@twilio-paste/help-text | ^13.1.0 |
@twilio-paste/in-page-navigation | ^4.3.0 |
@twilio-paste/inline-code | ^4.1.1 |
@twilio-paste/inline-control-group | ^13.0.2 |
@twilio-paste/input | ^9.1.1 |
@twilio-paste/input-box | ^10.1.1 |
@twilio-paste/label | ^13.1.1 |
@twilio-paste/lexical-library | ^4.1.0 |
@twilio-paste/list | ^8.1.2 |
@twilio-paste/listbox-primitive | ^3.0.1 |
@twilio-paste/media-object | ^10.1.0 |
@twilio-paste/menu | ^14.1.1 |
@twilio-paste/menu-primitive | ^2.1.1 |
@twilio-paste/meter | ^1.0.3 |
@twilio-paste/minimizable-dialog | ^4.1.1 |
@twilio-paste/modal | ^16.1.1 |
@twilio-paste/modal-dialog-primitive | ^2.0.1 |
@twilio-paste/non-modal-dialog-primitive | ^2.0.2 |
@twilio-paste/pagination | ^7.1.1 |
@twilio-paste/paragraph | ^10.1.1 |
@twilio-paste/popover | ^13.2.0 |
@twilio-paste/product-switcher | ^3.0.2 |
@twilio-paste/progress-bar | ^1.1.0 |
@twilio-paste/progress-steps | ^2.1.1 |
@twilio-paste/radio-button-group | ^4.1.1 |
@twilio-paste/radio-group | ^13.1.1 |
@twilio-paste/react-spectrum-library | ^2.2.0 |
@twilio-paste/react-textarea-autosize-library | ^3.0.0 |
@twilio-paste/reakit-library | ^2.1.0 |
@twilio-paste/screen-reader-only | ^13.1.1 |
@twilio-paste/select | ^12.1.2 |
@twilio-paste/separator | ^8.1.1 |
@twilio-paste/sibling-box | ^9.1.1 |
@twilio-paste/side-modal | ^4.1.1 |
@twilio-paste/sidebar | ^1.1.1 |
@twilio-paste/skeleton-loader | ^6.1.1 |
@twilio-paste/slider | ^3.0.1 |
@twilio-paste/spinner | ^14.1.1 |
@twilio-paste/stack | ^8.1.0 |
@twilio-paste/status | ^2.1.1 |
@twilio-paste/style-props | ^9.1.1 |
@twilio-paste/styling-library | ^3.0.0 |
@twilio-paste/switch | ^5.1.1 |
@twilio-paste/syntax-highlighter-library | ^3.0.0 |
@twilio-paste/table | ^8.1.0 |
@twilio-paste/tabs | ^8.2.0 |
@twilio-paste/tabs-primitive | ^2.0.1 |
@twilio-paste/text | ^10.1.1 |
@twilio-paste/textarea | ^10.1.1 |
@twilio-paste/theme | ^11.0.1 |
@twilio-paste/time-picker | ^6.1.1 |
@twilio-paste/toast | ^12.1.1 |
@twilio-paste/tooltip | ^11.1.1 |
@twilio-paste/tooltip-primitive | ^2.0.1 |
@twilio-paste/topbar | ^1.2.0 |
@twilio-paste/truncate | ^14.1.1 |
@twilio-paste/types | ^6.0.0 |
@twilio-paste/uid-library | ^2.0.0 |
@twilio-paste/user-dialog | ^2.1.1 |
@twilio-paste/utils | ^5.0.0 |
@twilio-paste/visual-picker | ^2.0.2 |
We highly recommend accessing Paste components and libraries primarily through Core. To do this, install the Core package and use unbarreled imports to individually import the components and libraries used in each file.
After Core is installed, specific Paste packages in your project can be pinned to specific versions if needed by installing those packages individually.
In Paste, we use an "unbarreled" import mechanism, so the import statements look like this:
import {Box} from '@twilio-paste/core/box';
import {Anchor} from '@twilio-paste/core/anchor';
import {Button} from '@twilio-paste/core/button';
import {Theme} from '@twilio-paste/core/theme';
import {DisclosureIcon} from '@twilio-paste/icons/esm/DisclosureIcon';
import {DeleteIcon} from '@twilio-paste/icons/esm/DeleteIcon';
While this has more import lines than importing these components from @twilio-paste/core
, specifying the import to a limited package
keeps your bundles lean by only loading exactly what you need.
Unlike other bundled libraries, using Core and Icons this way won't load all of Paste into your product's bundle. It will only include the parts you are importing. This happens automatically, without any requirement for a tree-shaking config in your builds.
Paste Core is able to do this because Paste also publishes each library and component as its own package.
We recommend Core over solely using individual package installs to make maintaining Paste in your project easier.
Using a non-Core approach will cause the package.json
file to be full of individual package dependencies;
keeping their versions in sync can be quite time consuming.
// These imports do not use Core:
import {Box} from '@twilio-paste/box'; // not recommended
import {Anchor} from '@twilio-paste/anchor'; // not recommended
import {Button} from '@twilio-paste/button'; // not recommended
import {Theme} from '@twilio-paste/theme'; // not recommended
// Paste Icons are not individually published
import {DisclosureIcon} from '@twilio-paste/icons/esm/DisclosureIcon';
import {DeleteIcon} from '@twilio-paste/icons/esm/DeleteIcon';
However, the individual package install is invaluable for pinning specific versions of specific packages. If updating Core would mean updating a package you aren't ready for, you can install that specific package and import from it directly.
For example, if you are about to update Core, and notice this update changes the Button component,
a component you are not ready to update, this shouldn't stop you from updating Core!
You can install @twilio-paste/button
to the version that works for the project and import it like this:
import {Box} from '@twilio-paste/core/box';
import {Anchor} from '@twilio-paste/core/anchor';
import {Button} from '@twilio-paste/button'; // This loads the specific version we installed
import {Theme} from '@twilio-paste/core/theme';
You may have imported from other libraries like this:
import {Box, Anchor, Button, Theme} from '@twilio-paste/core'; // don't do this!
The problem with importing this way is that the referenced "main" file in each of these packages has to bundle all the different pieces together. This causes everything in Paste Core or Paste Icons to be loaded, even if we only need one small feature. With over 50 icons in our Icon package and 40 components in Core - with more being added continuously - this can become very heavy very quickly.
Do
Use unbarreled imports
Don't
Don't import all of Core into your file
Do
Pin a specific version of a package by installing and importing it directly
Don't
Don't individually install and import every single package. Use Core!
yarn add @twilio-paste/core
import {Box} from '@twilio-paste/core/box';
const App = () => <Box />;