New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@canva/app-ui-kit

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@canva/app-ui-kit

React-based component library for creating Canva Apps that mimic the look and feel of Canva.

  • 4.8.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2.8K
increased by3.65%
Maintainers
0
Weekly downloads
 
Created
Source

@canva/app-ui-kit

React-based component library for creating Canva Apps that mimic the look and feel of Canva.

Table of contents

  • Introduction
  • Features
  • Installation
  • Usage
  • Components and Icons
  • Design tokens
  • Changelog
  • Contributing
  • License

Introduction

The App UI Kit is a React-based component library for designing and developing Canva Apps that mimic the look and feel of Canva.

To learn more about developing apps on Canva, see: Canva dev
To browse all components in the App UI Kit, see: Canva dev

Note: If you're planning on releasing a Canva App to the public, we strongly recommend using the App UI Kit, as we expect apps to meet certain design standards and it's difficult to do so without the components.

Features

  • Based on the components used by Canva's own engineers.
  • Built for accessibility, usability, and cross-platform compatibility.
  • Includes design tokens for creating custom components.

Installation

npm install @canva/app-ui-kit

Usage

Note: If you're using the starter kit, these steps have already been done for you.

At the root of the application, such as in the index.tsx file:

  1. Import the stylesheet:

    import '@canva/app-ui-kit/styles.css';
    
  2. Import the AppUiProvider component:

    import { AppUiProvider } from '@canva/app-ui-kit';
    
  3. Wrap the app in the AppUiProvider component:

    <AppUiProvider>
      <App />
    </AppUiProvider>
    

    This component should only be used once in an app's component tree.

After completing these steps, import and use components from the @canva/app-ui-kit package:

import { Button, Rows, Text, Title } from '@canva/app-ui-kit';
import React from 'react';

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>
  );
}

The components must exist as descendants of the AppUiProvider component.

Components and Icons

The App UI Kit exports a number of Components (e.g. Button, Text, Rows, etc. ) and Icons (e.g. PlusIcon, SearchIcon, etc.) to use in your apps.

For the complete list and documentation on all components and icons see our Storybook instance:

Design tokens

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, making it easier to keep UIs consistent and maintainable.

The App UI Kit exposes design tokens as JavaScript and CSS variables. Apps can use these tokens to create or customize components that match the look and feel of Canva. If Canva changes the token's values, those changes are automatically reflected in the app.

CSS variables

You can use the CSS variables in global stylesheets, CSS modules, or the app's source code:

.button {
  background-color: var(--ui-kit-color-primary);
}

The variables are written in kebab case and are prefixed with --ui-kit-.

JavaScript variables

You can use the JavaScript variables in the app's source code:

import { tokens } from '@canva/app-ui-kit';

function App() {
  return <div style={{ backgroundColor: tokens.colorPrimary }}>Hello world.</div>;
}

The variables are written in camel case, without a prefix.

List of design tokens

To view the complete list of available design tokens, expand the following section:

List of design tokens
Colors
Primary
CSSJavaScript
--ui-kit-color-primarycolorPrimary
--ui-kit-color-primary-hovercolorPrimaryHover
--ui-kit-color-primary-activecolorPrimaryActive
--ui-kit-color-primary-disabledcolorPrimaryDisabled
--ui-kit-color-primary-forecolorPrimaryFore
--ui-kit-color-primary-fore-disabledcolorPrimaryForeDisabled
Secondary
CSSJavaScript
--ui-kit-color-secondarycolorSecondary
--ui-kit-color-secondary-hovercolorSecondaryHover
--ui-kit-color-secondary-activecolorSecondaryActive
--ui-kit-color-secondary-disabledcolorSecondaryDisabled
--ui-kit-color-secondary-forecolorSecondaryFore
--ui-kit-color-secondary-fore-disabledcolorSecondaryForeDisabled
Tertiary
CSSJavaScript
--ui-kit-color-tertiarycolorTertiary
--ui-kit-color-tertiary-hovercolorTertiaryHover
--ui-kit-color-tertiary-activecolorTertiaryActive
--ui-kit-color-tertiary-disabledcolorTertiaryDisabled
--ui-kit-color-tertiary-forecolorTertiaryFore
--ui-kit-color-tertiary-fore-disabledcolorTertiaryForeDisabled
Contrast
CSSJavaScript
--ui-kit-color-contrastcolorContrast
--ui-kit-color-contrast-hovercolorContrastHover
--ui-kit-color-contrast-activecolorContrastActive
--ui-kit-color-contrast-disabledcolorContrastDisabled
--ui-kit-color-contrast-forecolorContrastFore
--ui-kit-color-contrast-fore-disabledcolorContrastForeDisabled
Neutral
CSSJavaScript
--ui-kit-color-neutralcolorNeutral
--ui-kit-color-neutral-hovercolorNeutralHover
--ui-kit-color-neutral-activecolorNeutralActive
--ui-kit-color-neutral-disabledcolorNeutralDisabled
--ui-kit-color-neutral-lowcolorNeutralLow
--ui-kit-color-neutral-forecolorNeutralFore
Positive
CSSJavaScript
--ui-kit-color-positivecolorPositive
--ui-kit-color-positive-hovercolorPositiveHover
--ui-kit-color-positive-activecolorPositiveActive
--ui-kit-color-positive-disabledcolorPositiveDisabled
--ui-kit-color-positive-lowcolorPositiveLow
--ui-kit-color-positive-forecolorPositiveFore
--ui-kit-color-positive-fore-disabledcolorPositiveForeDisabled
--ui-kit-color-positive-fore-lowcolorPositiveForeLow
Info
CSSJavaScript
--ui-kit-color-infocolorInfo
--ui-kit-color-info-hovercolorInfoHover
--ui-kit-color-info-activecolorInfoActive
--ui-kit-color-info-disabledcolorInfoDisabled
--ui-kit-color-info-lowcolorInfoLow
--ui-kit-color-info-forecolorInfoFore
--ui-kit-color-info-fore-lowcolorInfoForeLow
--ui-kit-color-info-fore-disabledcolorInfoForeDisabled
Warn
CSSJavaScript
--ui-kit-color-warncolorWarn
--ui-kit-color-warn-hovercolorWarnHover
--ui-kit-color-warn-activecolorWarnActive
--ui-kit-color-warn-disabledcolorWarnDisabled
--ui-kit-color-warn-lowcolorWarnLow
--ui-kit-color-warn-forecolorWarnFore
--ui-kit-color-warn-fore-lowcolorWarnForeLow
--ui-kit-color-warn-fore-disabledcolorWarnForeDisabled
Critical
CSSJavaScript
--ui-kit-color-criticalcolorCritical
--ui-kit-color-critical-hovercolorCriticalHover
--ui-kit-color-critical-activecolorCriticalActive
--ui-kit-color-critical-disabledcolorCriticalDisabled
--ui-kit-color-critical-lowcolorCriticalLow
--ui-kit-color-critical-forecolorCriticalFore
--ui-kit-color-critical-fore-lowcolorCriticalForeLow
--ui-kit-color-critical-fore-disabledcolorCriticalForeDisabled
Background
CSSJavaScript
--ui-kit-color-canvascolorCanvas
--ui-kit-color-tabdockcolorTabdock
--ui-kit-color-pagecolorPage
--ui-kit-color-surfacecolorSurface
Border
CSSJavaScript
--ui-kit-color-bordercolorBorder
--ui-kit-color-border-hovercolorBorderHover
--ui-kit-color-border-activecolorBorderActive
--ui-kit-color-border-disabledcolorBorderDisabled
--ui-kit-color-border-criticalcolorBorderCritical
--ui-kit-color-border-lowcolorBorderLow
--ui-kit-color-border-strongcolorBorderStrong
Typography
CSSJavaScript
--ui-kit-color-typography-primarycolorTypographyPrimary
--ui-kit-color-typography-secondarycolorTypographySecondary
--ui-kit-color-typography-tertiarycolorTypographyTertiary
--ui-kit-color-typography-placeholdercolorTypographyPlaceholder
--ui-kit-color-typography-positivecolorTypographyPositive
--ui-kit-color-typography-infocolorTypographyInfo
--ui-kit-color-typography-warncolorTypographyWarn
--ui-kit-color-typography-criticalcolorTypographyCritical
--ui-kit-color-typography-critical-hovercolorTypographyCriticalHover
--ui-kit-color-typography-critical-activecolorTypographyCriticalActive
--ui-kit-color-typography-linkcolorTypographyLink
--ui-kit-color-typography-link-hovercolorTypographyLinkHover
--ui-kit-color-typography-link-activecolorTypographyLinkActive
Overlay
CSSJavaScript
--ui-kit-color-overlaycolorOverlay
Spacing
CSSJavaScript
--ui-kit-space-0space0
--ui-kit-space-050space050
--ui-kit-space-1space1
--ui-kit-space-150space150
--ui-kit-space-2space2
--ui-kit-space-3space3
--ui-kit-space-4space4
--ui-kit-space-6space6
--ui-kit-space-8space8
--ui-kit-space-12space12
--ui-kit-base-unitbaseUnit
--ui-kit-border-radiusborderRadius
--ui-kit-min-touchable-areaminTouchableArea
Shadows
CSSJavaScript
--ui-kit-shadow-surfaceshadowSurface
--ui-kit-shadow-surface-highshadowSurfaceHigh
Transition animations
CSSJavaScript
--ui-kit-hover-transitionhoverTransition
--ui-kit-fade-transitionfadeTransition

Changelog

See the CHANGELOG.md file or view it on our documentation site.

Contributing

We're actively developing this package but are not currently accepting third-party contributions. If you'd like to request any changes or additions to the package, submit a feature request via the Canva Developers Community.

License

See the LICENSE.md file.

FAQs

Package last updated on 19 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc