Appearance
App UI Kit
Overview
What is the App UI Kit? Why use it?
The App UI Kit is a React-based component library designed for creating apps that emulate Canva's look and feel. If you're using the starter kit, the App UI Kit is already installed. Otherwise, refer to the Quickstart guide.
Features
- Based on the components used by Canva's own engineers.
- Designed for accessibility, usability, and cross-platform compatibility.
- Includes a variety of icons and design tokens.
When to use
We strongly recommend using the App UI Kit if you're planning to release an app to the public, because this makes it easier to comply with our design guidelines. Without these components, meeting the guidelines can be challenging.
If you're developing an app solely for your team members, using the App UI Kit will provide a more familiar user experience, although it's not mandatory.
Example
tsx
import React from "react";
import { Button, Rows, Text, Title } from "@canva/app-ui-kit";
export function App() {
return (
<Rows spacing="2u">
<Rows spacing="1u">
<Title>Hello world</Title>
<Text>This is a paragraph of text.</Text>
</Rows>
<Button variant="primary">Click me</Button>
</Rows>
);
}Live playground 🎉
To play around with the App UI Kit components, check out the App UI Kit Playroom — a live playground that comes preloaded with all of the UI components and examples of how to use them.
Quickstart
Get up and running with the App UI Kit.
The App UI Kit is a React-based component library for Canva apps. If you're using the starter kit, the App UI Kit is already set up for you. If you're not using the starter kit, this guide will help you get started.
Step 1: Install the App UI Kit
In the project's directory, run the following command:
bash
npm install @canva/app-ui-kitStep 2: Set up the AppUiProvider
At the root of the application, such as in a project's index.tsx file:
Import the following stylesheet:
tsximport "@canva/app-ui-kit/styles.css";Import the
AppUiProvidercomponent:tsximport { AppUiProvider } from "@canva/app-ui-kit";This component provides theming and user preferences to App UI Kit components.
Wrap the app in the
AppUiProvidercomponent:tsx<AppUiProvider> <App /> </AppUiProvider>Note: You should only use the
AppUiProvidercomponent once in an app's component tree.
Step 3: Start using the components
Import components from the
@canva/app-ui-kitpackage:tsximport { Button, Rows, Text, Title } from "@canva/app-ui-kit";Use them as you would any other React component:
tsxexport function App() { return ( <Rows spacing="2u"> <Rows spacing="1u"> <Title>Hello world</Title> <Text>This is a paragraph of text.</Text> </Rows> <Button variant="primary">Click me</Button> </Rows> ); }Warning: For your app to be theme-responsive, App UI Kit components and any custom components must be wrapped in
AppUiProvider.
Next steps
Once you're up and running, either:
- Check out the Storybook to explore the available components.
- Play around with the components in your app.
Colors
An overview of colors in the App UI Kit.
Canva has a distinct and vibrant color palette. The App UI Kit exposes a subset of this palette as design tokens. You can use these colors to create a user interface that matches Canva's aesthetic.
Using colors
The colors are exposed in the following formats:
- CSS variables
- JavaScript variables
- React component props (with exceptions)
You can use the CSS and JavaScript variables as you would any other design token.
In the case of React component props, some props only accept specific colors. For example, the Alert component only accepts the following colors for the tone prop:
tsx
<Alert tone="info">This is an alert.</Alert>
<Alert tone="warn">This is an alert.</Alert>
<Alert tone="positive">This is an alert.</Alert>
<Alert tone="critical">This is an alert.</Alert>These props are documented in Storybook and available as autocomplete options via IntelliSense.
List of color tokens
Actions
These colors are used to perform actions, in such components as buttons, menu items or pills.
Primary
Key actions that represent the main purpose of the interface.
Secondary
Supporting actions such as secondary buttons and pills.
Tertiary
Subdued actions such as menu items and teritary buttons.
Overlay
Actions that appear over busy and vibrant backgrounds.
Selected
Actions that indicate a user selection or the origin of an effect.
General
Universal color states that apply across multiple components.
Feedback
Positive
Successes and other positive information.
Info
General information.
Warn
Cautionary information.
Critical
Errors and problems.
Hint
Hints and assistive information.
Overlay
Info over busy backgrounds.
UI
Neutral grays, focus and overlay colors for use within UI components, such as alert or thumbnail backgrounds.
Content
General text and icons.
Control
Form elements such as text inputs, selects, pickers, sliders and switches.
General
Default states for interactive form elements.
Critical
Error states and validation problems in form controls.
Selected
Active or chosen states in form controls.
Link
Navigational link elements.
Handle
Tactile handles and grabbers.
Surface backgrounds
Elevation backgrounds of various surface containers.
Design Tokens
What are design tokens? Why use them?
A design token is a variable used to store design-related values, such as colors. They act as a single source of truth for design properties, simplifying the maintenance of interface elements and enabling features, such as theming.
The App UI Kit exposes design tokens as JavaScript variables, CSS variables, and React component props. Apps can use these tokens to customize components or create components that match the look and feel of Canva.
Your app must be wrapped in AppUiProvider for design tokens to work, even if you're using custom components.
Using design tokens
CSS variables
You can use the CSS variables in global stylesheets, CSS modules, or your app's source code:
css
.button {
background-color: var(--ui-kit-color-content-fg);
}The variables are written in kebab case and prefixed with --ui-kit-.
JavaScript variables
You can use the JavaScript variables in your app's source code:
tsx
import { AppUiProvider, tokens } from "@canva/app-ui-kit";
import "@canva/app-ui-kit/styles.css";
function App() {
return (
<AppUiProvider>
Hello world.</div>
</AppUiProvider>
);
}The variables are written in camel case, without a prefix.
Note: The values of the JavaScript variables are CSS variables. For example, the value of the colorContentFg token is var(--ui-kit-color-content-fg), not the underlying CSS value that the variable resolves to.
React component props
The props of some components only accept certain tokens. This prevents you from using components in a way that would be unfamiliar to Canva's users. For example, the Button component only has three color variants:
tsx
<Button variant="primary">Click me</Button>
<Button variant="secondary">Click me</Button>
<Button variant="tertiary">Click me</Button>These props are documented in Storybook and available as autocomplete options via IntelliSense.
List of design tokens
You can find the reference documentation for the tokens on the following pages:
- Colors
- Shadows
- Spacing
- Transitions
Spacing
An overview of spacing in the App UI Kit.
The App UI Kit exposes a spacing scale. This scale is made up of a limited range of numeric design tokens that are multiples of the base unit. By using these tokens, the size of and spacing between components remains consistent, which results in a more polished and visually harmonious experience.
Using spacing tokens
The tokens that make up the spacing scale are exposed as:
- CSS variables
- JavaScript variables
- React component props (with exceptions)
You can use the CSS and JavaScript variables as you would any other design token.
In the case of React component props, some props only accept values from the spacing scale. For example, the Rows component has a spacing prop that sets the vertical margin between its children:
tsx
<Rows spacing="2u">
<Box>This is a box.</Box>
<Box>This is a box.</Box>
<Box>This is a box.</Box>
</Rows>This code will render three rows of boxes with 2 units (16 pixels) between each row.
When passing values from the scale as props, the value takes the form of "𝑥u," where "𝑥" is a number on the scale, and "u" is an abbreviation of "unit." An exception to this rule is when the value is "0," because this value doesn't have a suffix.
List of spacing tokens
Spacing scale
Other spacing tokens
Shadows
An overview of shadows in the App UI Kit.
The App UI Kit exposes design tokens for shadows. These shadows add subtle elevation to a component, which is mostly noticeable with the light theme, as they blend in with the app's background on a dark theme.
List of shadow tokens
Transitions
An overview of transitions in the App UI Kit.
The App UI Kit exposes design tokens for transitions. These transitions add subtle animations to interface elements, such as fading between button states, and can be used to introduce consistent transitions in custom components.
List of transition tokens
Units
An overview of units in the App UI Kit.
Canva's user interface is laid out on a grid, which consists of square cells, each measuring 8 pixels in width and height. This 8-pixel measurement is referred to as the base unit.
By aligning interface elements to this grid, apps can maintain a level of visual consistency that is aesthetically pleasing. It's not enough for apps to only conform to the grid, but it is a fundamental building block.
To help apps conform to the grid, most sizing and spacing values in the App UI Kit (widths, heights, margins, etc.) are multiples of the base unit. This ensures that interface elements align correctly.
What are units?
A value that is a multiple of the base unit is referred to as a unit, abbreviated as u. As a result, the following values are synonymous:
- 8 pixels
- 1 unit
- 1u
Using units instead of hard-coded pixel values ensures that, should the size of the base unit change, apps would still conform to the grid. It also simplifies reasoning about relative sizing, as "2u" is twice "1u," thereby reducing the need for mental calculations when arranging components.
Using the base unit
Generally, apps don't need to directly use the base unit. This number is used to compute the values of tokens in the spacing scale, and apps should typically employ these tokens for setting sizes and spaces.
However, if you want to adhere to the grid using a value not available in the spacing scale, you can access the base unit as a CSS or JavaScript variable and calculate the value yourself.
CSS
css
.container {
padding: calc(var(--ui-kit-base-unit) * 10);
}JavaScript
ts
import { tokens } from "@canva/app-ui-kit";
const style = {
padding: `calc(${tokens.baseUnit} * 10)`,
};Exceptions
There are instances where conforming to the grid is impractical, such as when displaying a raster image with a fixed width and height. In these cases, disregard the grid. It is intended as a tool, not a constraint.
Changelog
The latest changes to the App UI Kit.
5.7.0 - 2026-03-05
Changed
- The
Boxcomponent's foreground color has been updated when the background is set tocanvas,tabdock,page,surface, orneutralLow. There may be minor visual changes. - The
Textcomponent's line height for sizelargehas been adjusted from 26px to 24px to align proportionally with other sizes. Minor visual changes should affect whitespace only. TestAppUiProvidernow supports an option to disable animations for testing purposes.- The
SurfaceHeadercomponent now uses a larger size for the back icon, resulting in minor visual changes.
5.6.0 - 2026-02-19
Changed
- Internal updates to css color token values, very minor visual regressions may appear.
- Updated the
colorUiOverlayBgcolor token value to be slightly darker in dark mode. Flyouttrigger has internal markup changes, removed an outer div wrapper from theFlyoutcomponent, no layout impact or regressions are expected.- Flyout component internal behavior change, header content (title, description) now defaults to center alignment for mobile sheet view to align to the rest of Canva.
- Changes the line height of the
Titlecomponent in size "large", from 32px to 30px on viewports <600px, and 42px to 40px on larger viewports. Visual changes are minor and affect whitespace only. - Updated internal
Titlefont weights for mostTitlesizes, large/medium/small titles from 700 to 600. No change required for consumers of the Title component, minimal visual shifts are expected affecting horizontal whitespace only. - Added better viewport safe-area detection to pinned elements, like the
FlyoutorFlyoutMenu.
Added
- Added a
HtmlPreviewcomponent that can be used to display HTML in thepreviewUiof content publisher intent apps.
Fixed
- Fixed an issue where the
Textcomponent font weight would behave differently than expected when when using a 'b' or 'strong' tag. They will now be 600 weight like the usualboldvariant of that component. - Fixed an issue with the
CarouselandTabscomponents would render incorrectly not follow the global ltr / rtl directions. - Fixed an issue where the
PillsInputremove button isn't being triggered whenmaxRowsis set and content is scrollable.
5.5.0 - 2026-01-14
Changed
- Reverted
Checkboxcomponent to usebox-shadowspread animation for checked/indeterminate states. The previousbackground-colorworkaround was for an iOS 26.1 Beta WebKit bug that has since been fixed in the stable release. No code changes required - this is a visual implementation detail. - Made the
Flyoutcomponent popover and sheet appearances have the same DOM structure on first paint. - Updated CSS tokens used in various components. Expect very slight visual updates.
Fixed
- Fixed the
Slidercomponent briefly flashing with the fill bar at 100% when first loading. - Fixed the
Cardcomponent fixed focus outline not visible on Safari. - Fixed carousel items not properly applying item width when they have fluid content.
5.4.0 - 2025-12-19
Changed
- Updated
reactandreact-dompeer dependency requirement to^19.2.3from^19.2.1. - Updated
mobxpeer dependency requirement to^6.13.5from^6.13.3. - Updated CSS tokens used in
AudioCard, expect very slight visual updates.
Fixed
- Fixed
Carouselsnapping not working with virtualized items. - Fixed a bug where the
Carouselcomponent would crash upon unmount. - Fixed
onScrollbeing called incorrectly in edge cases for theScrollablecomponent. It's now only called on scroll events.
5.3.0 - 2025-12-10
Changed
- Updated
reactandreact-dompeer dependencies to^19.2.1. Carouselcomponent improvements:- Items that are not fully visible are now marked as
inertby default. This means their elements and descendants won't be tabbable or interactive until they are fully visible. A new propoutOfViewItemBehaviorhas been added to opt out of this behavior. - Accessibility skip links have been disabled by default if the "inert"
outOfViewItemBehavioris selected (or defaulted), otherwise become enabled if "none" behavior is selected. - Updated the scroll buttons to have smoother animations, and updated the buttons to have circle buttons.
- Updated item visibility thresholds to improve stability and usability.
- Items that are not fully visible are now marked as
- Updated internal shadow colors, small variations in shadows can be expected.
Added
- Introduced the
SurfaceHeadercomponent. - Added a
triggerprop to theFlyoutMenucomponent, enabling any React.ReactNode to be a FlyoutMenu trigger. - Added a
variantprop to theLinkButtoncomponent, supporting eitherregular(default) orcritical.
Fixed
- Fixed a focus abandonment issue occurring when a focused carousel item becomes inert as the container is scrolled with arrow keys.
- Fixed an issue in cards where card content was sometimes leaking outside the selection border.
- Fixed a bug that produced focus jumps when navigating carousels with items wider than the container.
5.2.1 - 2025-11-11
Fixed
- Fixed
ColorSelectorcomponent which stopped working in development mode, due to a regression in React 19.2.
5.2.0 - 2025-10-22
Changed
- Updated the README to reference canva.dev docs for design tokens.
Fixed
Carousel's scroll button control now takes item gaps into account- Fixed a couple of iOS 26.1 beta bugs impacting
FlyoutMenu,Flyout,Select,CustomizableSelectandColorSelectorcomponents.- The top edge of the
Sheetcomponent would change position when the virtual keyboard is open. - Regression affecting transition of full height
Sheets when virtual keyboard opens.
- The top edge of the
5.1.0 - 2025-10-14
Changed
- Changed
reactandreact-dompeer dependency versions to 19.2.0.
Added
- Added
onPlay,onPause, andonEndedcallbacks to theAudioCardcomponent.
Fixed
- Fixed an IOS 26.1 beta bug, which broke the way the box-shadow was applied to
Checkboxto cover the entire area. Replaced it with background color. - Fixed a bug where one
AudioCardcomponent unmounting would stop all currently playingAudioCards. - Restored missing colorControlBorder token.
- Updated the colorControlBorderHovered semantic token to be correct in dark mode.
5.0.2 - 2025-10-08
Added
- Added
elevationSurfaceFloatingBgtoken for use as a background (surface) color. It is the preferred migration for the colorSurface token that was removed in v5.
Fixed
- Fixed a bug where the wrong ref could be returned for the
SearchInputMenucomponent.
5.0.1 - 2025-09-30
Removed
- Breaking: Added React 19 as a peer dependency and dropped React 18 support.
- Breaking: Remove tone property from InputPill component
- Breaking: Removed the default
colorSurfacebackground color styling for the globalhtmltag. - Breaking: Removed the deprecated
titleprop in theLinkcomponent. UsetooltipLabelinstead.
Changed
- Breaking: Implemented new design token system. See App UI Kit v4 to v5 Migration Guide for more information on upgrading.
- Breaking: The
sourceparameter of theonChangecallback for theColorSelectorcomponent is now optional. The migration is to check for undefined values in the callback handler. - Breaking: The default value for the
alignYproperty ofColumnis nowstretch. To continue using the old implicit behavior, set it tostartexplicitly. - Breaking: Replaced
PillandInputPilltruncateTextprop with newmaxWidthprop. The new prop better describes its functionality, and represents its size in a more explicit manner. - Breaking: Changed the
sizeproperty for thePillcomponent to be consistent withButtonsize variants. To retain the old "small" Pill size, use the new "xsmall" variant. - Breaking:
Pillnow uses a round shape to match Canva styling.
Added
- Added load callbacks to the media cards -
onImageLoadtoImageCard,onImageLoadandonVideoLoadtoVideoCardandonImageLoadandonAudioLoadtoAudioCard - Added
onTimeUpdatecallback to receive ontimeupdate events for theAudio Card - Added new
LinkButtoncomponent for in-app actions that do not need to open URLs. - Added
type=multiproperty to enable multiple selections for theSelectcomponent.
Fixed
- Resolved an issue with color-scheme CSS that broke dark mode.
- Fixed a bug where
ProgressBaralways had 0 width when rendered in a flex container.
4.10.0 - 2025-06-25
Deprecated
- Deprecated
titleprop in theLinkcomponent. Use the newly addedtooltipLabelprop instead.
Added
- Added the following components:
TimeInputCustomizableSelect
- Added the following icons:
TeamIcon
- Added a
timemode to theDateTimecomponent. - Added a
refproperty to theAudioCardcomponent to enable programmatic control.
4.9.0 - 2025-04-29
Added
- Add
onScrollprop forScrollablecomponent - Add
video/x-msvideoas an accepted video mime-type for theVideoCardcomponent - Add
descriptionandcontentprops to theAudioCardcomponent
Fixed
- Fixed a bug where the
VideoCardandEmbedCardcomponents were not correctly applying theborderRadiusprop
4.8.0 - 2025-02-20
Changed
- Changed the behavior of the
Image,VideoandEmbedCards to display the loading screen within the border rather than obscuring it.
Added
- Added
inline-flexas a display option for theBoxcomponent. - Added
bottomEndandbottomEndVisibilityprops toHorizontalCard.
4.7.1 - 2025-01-29
Fixed
- Fixed an issue where the
TruncatedTextcomponent was not exported, making it unavailable for use.
4.7.0 - 2025-01-21
Added
- Introduced the
TruncatedTextcomponent
Fixed
AudioCardnow stops the audio from playing when the component unmounts
4.6.0 - 2025-01-08
Changed
- Updated the
Buttoncomponent to useremfor width and height instead of pixel values, ensuring the container scales appropriately when text scales due to browser or OS settings. - Adjusted all form input components to use
remsizes, enabling them to adapt to text scaling via browser or OS settings.
Added
Introduced a
wrapInsetprop for theBadgecomponent, with a-1uvalue to improve the appearance and spacing of badges wrapped around icons.tsx<Box padding="3u"> <Badge shape="circle" text="4" tone="assist" wrapInset="-1u"> <CogIcon /> </Badge> </Box>
Fixed
- Resolved an issue with the
AudioCardcomponent where the pause button would incorrectly stop the track instead of pausing it. - Fixed a bug where content with scrollbars in the
TabPanelcomponent would not scale to the correct height. - Prevented the
PillsInputremove button'sonRemoveClickevent from bubbling up and inadvertently triggering the pill'sonClickevent.
4.5.0 - 2024-12-18
Added
- Added a
triggerModeprop to theColorSelectorcomponent. Enabling the rendering of aAddColorButtonas a trigger. - Added a
onDeleteColorprop to theColorSelectorcomponent, when a callback is provided it adds a delete button in the picker flyout. - Added a
onOpenandonCloseprop to theColorSelectorcomponent. - Added a
labelMarkerprop to theFormFieldcomponent. When provided, it renders a marker next to the label (e.g. "optional"). - Added
thumbnailPaddingandthumbnailBackgroundprops toImageCardto allow for custom svg support on theImageCardcomponent.
Fixed
- Fixed an issue where the text in the
PillandInputPillcomponents would overflow incorrectly whentruncatewas set tofalse. No considerable visual changes are expected, but a minor width change may be present for truncated pills. - Fixed an issue where arrow navigation in the
FlyoutMenucomponent would not focus in some scenarios of nested FlyoutMenus. - Other minor fixes and improvements.
4.4.0 - 2024-11-26
Changed
- Reduced the size of the HorizontalCard thumbnail to match other card components
Added
- Updated labels on
CheckboxGroup,Checkbox,FormField,RadioGroupandSwitchto allow for React.ReactNode
Fixed
- Set the default delimiters for
PillsInputto be [',',';','\t'] - Updated
AppUiProvidercomponent to support multiple mounts. - Fixed broken paste behavior when string without delimiters are pasted into
PillsInput - Fixed
Tabcontents display when overflowing as it would squash its contents.
4.3.0 - 2024-11-13
Added
- Added screen reader announcements for
PillsInput. - Added the following icons:
LayoutIconChartLineIconGlobeIcon
- Added the ability to group options in the
Selectcomponent. - Added a
descriptionprop to theCheckbox,CheckboxGroupandRadioGroupcomponents.
4.2.0 - 2024-10-30
Added
- Added the following components:
HorizontalCard
- Added the following icons:
ImageIcon
- Added a
topEndprop (with visibility control) to theAudioCardcomponent, to add an icon button decorator to the top end corner of the card. - Added a
"small"size for thePillcomponent. - Added improved
onDragbehaviour to theAudio,Video,Embed, andImageCards. They now hide their preview automatically when dragging (if dragging is enabled) and the preview is used as the drag image under the mouse cursor. - Added a peer dependency on Mobx
v6.13.3or later, due to an incompatibility with prior patches that would make components fail to update correctly.
Changed
- Updated the
TabPanelandTabPanelsflex grow behavior to always fill to outerTabsheight regardless if is "fill", "fixed" or "auto". Resolves an issue where theTabPanelcontent was not filling the height of theTabscomponent.
Fixed
- Fixed an issue where the text was being truncated for the
FlyoutMenucomponent's trigger button. - Fixed an issue where the
FlyoutMenucomponent was flickering on open due to React v18 changes. - Other minor fixes and improvements.
4.1.0 - 2024-10-14
Added
- Added a
showTooltipprop to thePillcomponent. - Added a
thumbnailAspectRatioprop to theImageCard, which can be used withthumbnailHeightand theCarouselcomponent to make carousels of fixed-height thumbnails with variable widths.
Fixed
- Fixed an issue where the
ButtontooltipDescription was not being used by screen readers. - Fixed an issue where a disabled
AudioCardcould be dragged. - Fixed a Safari display problem for
Tablabels. - Fixed a layout issue to the FileInput in button mode that caused multiple scrollbars in apps.
4.0.0 - 2024-09-23
Removed
- Breaking: Removed the "xlarge"
sizeoption from theTitleandTextcomponents, please use the "large" size instead. - Breaking: Removed the "neutral"
toneoption from theBadgecomponent, it is recommend to use the "contrast" tone instead. - Breaking: Removed the "large"
sizefrom theLoadingIndicatorcomponent. - Breaking: Removed the "center"
alignoption from theTabListcomponent. - Breaking: Removed the
stateprop from theInputPillcomponent, the default state now becomes only "default". - Breaking: Removed the
toneprop from theProgressBarcomponent. - Breaking: Removed the
sizeprop from theSwatchcomponent. - Breaking: Removed the
MoreVerticalIconicon, as outlined in a previous release, theMoreHorizontalIconis recommended instead.
Changed
- Breaking: Changed the
altprop to be required for theImageCardcomponent. - Updated the styling of the
Slidercomponent, the shadow on the slider knob is now removed when in a "disabled" state. - Updated the behavior of the
NumberInputcomponent, a decimal (".") is now permitted as the first character.
Added
- Added Localization support across all App UI Kit components.
- With the introduction of Canva Apps Localization, all messaging within apps can now go through the Canva Translation process.
- Additionally all auxiliary messaging that cannot be directly managing in components are also now automatically translated when respective languages are preferred.
- Additionally added LTR (left-to-right) and RTL (right-to-left) content direction support to pair with the addition of Apps Localization.
- Added a
pressedprop to theButtoncomponent, for only "secondary" and "tertiary" variants. - Added a "contrast" option to the
variantprop for theButtoncomponent. - Added the following icons:
ArrowMultiDirectionalIconCopyPlusIconDatabaseIconLineWeightsIconMoveLayerDownIconMoveLayerUpIconSpacingIconTextSpacingIcon
Fixed
- Fixed an issue with the
Tabscomponents where theTabtooltip would snap to the start when theTabListcomponent had thealignprop set to "stretch". - Fixed an issue where the
PillsInputcomponent would not display a grayed background when thedisabledprop was set to true. - Other minor fixes and improvements.
Note: Canva's app submission process requires a single app bundle. Implementing localization might increase the size of the app and cause webpack to split the bundle into multiple chunks. If this happens, you can force webpack to emmit a single bundle using the LimitChunkCountPlugin:
In your webpack.config.js:
- Add the
optimizemodule to thewebpackimport:
diff
- const { DefinePlugin } = require("webpack");
+ const { DefinePlugin, optimize } = require("webpack");- In the
pluginsadd the chunk limit before buildDevConfig is called. Modify the plugins definition:
diff
plugins: [
new DefinePlugin({
BACKEND_HOST: JSON.stringify(backendHost),
}),
+ new optimize.LimitChunkCountPlugin({ maxChunks: 1 }),
],3.8.0 - 2024-08-05
Added
- Added the following components:
DateInputFlyoutMenuFlyoutMenuDividerFlyoutMenuItemInputPillPillsInputScrollable
Fixed
- Fixed the heading size of the
Accordioncomponent.
3.7.0 - 2024-07-23
Added
- Added the following components:
AccordionAccordionItemFlyoutMenuMenuDividerMenuItemSearchInputMenu
- Added the following icons:
DatabaseIconStarFilledIconStarIconTableMergedHeaderCellsIcon
- Added a
TestAppUiProvidercomponent for use when testing@canva/app-ui-kitcomponents in test environments such as Jest. - Added a
sizeprop to theButtoncomponent for tertiary icon buttons. - Added a
selectable,selected, anddisabledprop to theAudioCardcomponent. - Added a
loadingprop to theAudioCard,EmbedCard,ImageCard,TypographyCard, andVideoCardcomponents.
Changed
- Updated the
onClickandariaLabelprops to now be optional for theImageCard,AudioCard,VideoCardandEmbedCardcomponents.
Fixed
- Fixed an issue in the
Slidercomponent where the handle overlay was getting cut off by the number input. - Fixed an issue where screen readers were double announcing labels to RadioGroups.
- Other minor fixes and improvements.
Deprecated
MoreVerticalIconis now deprecated, it is no longer recommended for use and will be removed in a future release. UseMoreHorizontalIconinstead.
3.6.0 - 2024-07-01
Added
- Added the following components:
TabTabListTabsTabPanelTabPanels
- Added the following icons:
CalendarIconMaximizeIconMinimizeIconMoreHorizontalIconMoreVerticalIconStrikethroughIcon
- Added a
disabledprop to theColorSelectorcomponent. - Added a
tooltipLabelprop to theBadgecomponent. - Added a
selectedprop to theButtoncomponent. - Added a
searchableprop to the FormSelectcomponent to allow searching for options. - Added a
thumbnailHeight,selectable,selected, anddisabledprop to theVideoCardandEmbedCardcomponents. - Added a
bottomEndandbottomEndVisibilityprop for adding card decorators to theAudioCard,EmbedCard,ImageCard, andVideoCardcomponents.
Changed
- Updated React version to
v18.3.1in Peer Dependencies.
Fixed
- Fixed an issue where the
MultilineInputcomponent scroll positioning was resetting on input value change. - Fixed an issue where closing the
Selectcomponent on touch devices resulted in the options menu reopening. - Fixed an issue with our build process to remove esm syntax from our cjs output.
- Other minor fixes and improvements.
3.5.1 - 2024-05-08
Added
- The following components:
AvatarAvatarGroupAvatarPlaceholder
- The following icons:
LinkIconFileTextIcon
- Added a new
contrasttone variant for theBadgecomponent, along with TSDoc comments explaining the meaning of eachtone. - Added a new
neutraltone variant for theAlertcomponent. - Added a new
disabledprop to theImageCardcomponent.
Changed
- Fixed
WordCountDecoratordisplaying incorrect ARIA label. - Update the
colorTabdocktoken value ever so slightly. - Render a truncated file name in
FileInputItemwhen file name is too long, and show the full file name in a tooltip instead. - Visual changes to
Pillcomponent selected and disabled states. - Visual updates to the
Slidercomponent.
Fixed
- Links with the
OpenInNewTabicon no longer leave the icon 'hanging' on a new line. - Fixed the
Linkcomponent withtarget="_blank"letting punctuation drop onto a new line. - Fixed a stacking context issue in
Carouselcomponent causing its buttons to be rendered above flyouts.
3.4.0 - 2024-03-18
Added
- The following icons:
FlagIconLightBulbIcon
Changed
- The
Badgecomponent now has awrapInsetprop. - The
Boxcomponent now has display and flexbox related props. - The
ImageCardcomponent now hasselectableandselectedprops.
Fixed
- Fixed the text in the
SegmentedControlcomponent where active items were not rendering in the right tone. - Fixes a stacking context issue in
SegmentedControlcausing its buttons to be rendered above flyouts. - Fixed disabled
Selectdisplaying option lists using arrow keys.
3.3.0 - 2024-02-27
Added
- The
Buttoncomponent now has analignmentprop.
3.2.0 - 2024-02-13
Improvements
- Reduced bundle size by over 7% by optimizing dependencies and implementing tree-shaking, resulting in faster loading times and improved performance.
Added
- The following components:
BadgeCarouselClearDecoratorMasonryPill
- The following icons:
ExportIconEyeIconFlipHorizontalIconFlipVerticalIconFolderIconGridIconInfoIconListBulletLtrIconRedoIconSlidersIconTransparencyIconUndoIcon
Changed
- The
Boxcomponent now has aclassNameprop. - The
Buttoncomponent now hasiconPositionandtooltipLabelprops. - The
EmbedCardcomponenttitleprop is now optional. - The
Selectcomponent options now hasdescription,disabledandIconprops. - The
Swatchcomponent now has anonDeleteprop. - The
TextInputcomponent now hasstartandendprops. - The
TypographyCardcomponent now has anonHovereffect. - The
VideoCardcomponent now has aborderRadiusprop. - Add
onBlurandonFocusprops to the following components:Checkbox,CheckboxGroup,MultilineInput,NumberInput,TextInput,RadioGroup,SegmentedControl,Select,Switch. - Add
onKeyDownprop to the following components:MultilineInput,NumberInput,TextInput. - Updated primitive color scale, lighter colors are now more vibrant with less murky tones. Darker colors are lighter and more muted.
Fixed
- Fixed
Slidertab order to belabel,slider,input. This fixes a bug where theSliderwas being rendered on top of other components. - Other minor fixes and improvements.
3.1.0 - 2023-12-12
Added
- The following components:
AudioCardAudioContextProviderEmbedCardImageCardLinkTypographyCardVideoCard
- The following icons:
LockOpenIconLockClosedIcon
Note: With the addition of the various Card components, the equivalent Draggable components, such as DraggableImage, have been removed from the starter kit.
Changed
- The
Buttoncomponent now has anariaLabelandiconprop. - The
Gridcomponent now has analignXprop. - The
Swatchcomponent now has atooltipLabelprop. - Renamed the
colorTypographyQuaternarytoken tocolorTypographyPlaceholder.
Fixed
- The spacing of the
FormFieldcomponent, ensuring consistency with the rest of the components.
3.0.0 - 2023-11-02
Added
- The following components:
AlertCharacterCountDecoratorColorSelectorSliderSwatchSwitchWordCountDecorator
- A number of new icons.
Changed
- Breaking: Made the second argument to the
onChangecallback of theMultilineInputcomponent optional.
Example update in consumer code:
diff
<MultilineInput
onChange={(value, event) => {
+ if (event == null) {
+ return;
+ }
const cursorPosition = event.target.selectionStart;
handleChangeAtCursorPosition(value, cursorPosition);
}}
/>- The
Buttoncomponent now accepts atypeprop. This prop can be set to"submit","button", or"reset". The default value is"button". - The
TextInputcomponent now accepts atypeprop. This prop can be set to"search","tel","text", or"url". The default value is"text". - The
MultilineInputcomponent now accepts afooterprop. You can use this prop to decorate the input with theCharacterCountDecoratororWordCountDecoratorcomponents.
2.0.0 - 2023-09-14
Removed
- Breaking: Removed default reset styles, including
* { margin: 0 }. Apps may need to update to add these styles back in to maintain current styling:
* {
margin: 0;
}
img, picture, video, canvas, svg {
display: block;
max-width: 100%;
}
input, button, textarea, select {
font: inherit;
}- Breaking: Removed
disableBubblesprop fromProgressBarcomponent. The bubble effect is now always enabled. Any usages of thedisableBubblesprop will need to be removed.
Changed
- Breaking: Renamed background color tokens. All usages must be updated to use the new name.
The Box component's background prop has changed and should be renamed accordingly:
| before | after |
|---|---|
<Box background={1} /> | <Box background="canvas" /> |
<Box background={2} /> | <Box background="tabdock" /> |
<Box background={3} /> | <Box background="page" /> |
<Box background={4} /> | <Box background="surface" /> |
Any references to the following color tokens should be renamed accordingly:
| before | after |
|---|---|
| tokens.colorBackground1 | tokens.colorCanvas |
| tokens.colorBackground2 | tokens.colorTabdock |
| tokens.colorBackground3 | tokens.colorPage |
| tokens.colorBackground4 | tokens.colorSurface |
Any references to the following CSS variables should be renamed accordingly:
| before | after |
|---|---|
| --ui-kit-color-background-1 | --ui-kit-color-canvas |
| --ui-kit-color-background-2 | --ui-kit-color-tabdock |
| --ui-kit-color-background-3 | --ui-kit-color-page |
| --ui-kit-color-background-4 | --ui-kit-color-surface |
Added
- Added new
Gridlayout component for displaying content in a grid. - Added and edited prop documentation across multiple files, to clarify language and provide more context.
Fixed
- Fixed disabled CSS bug in
Selectcomponent. - Fixed alignment of
Checkboxwith its label. - Fixed
MultilineInputtextarea not auto-growing when wordbreaks occur from resizing. - Validates input when using
FileInputselector. When using the OS provided selector to choose files, users could override filetype restrictions. - Other small bug fixes and improvements.
Other
onChangeprop inRadioGroupcomponent is now optional to align with the other form components.
1.0.0
Added
- Initial package release