0.10.0 • Published 1 year ago

@chakra-ui/pro-theme v0.10.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Welcome to Chakra UI Pro Theme

The Chakra UI Pro Theme extends the base Chakra UI theme by introducing additional component variants, sizes, and a collection of semantic tokens and text layer styles. Made to fit perfectly with the original Chakra UI theme, the Pro Theme makes your user interface look even better, and it won't mess up your current setup. Just a heads up though - if your custom variants have the same names as ours, you might see a few changes. For the best experience with the Pro Theme, you might want to check out our comparison here.

Installation

Ensure Chakra UI is installed in your project. If not, you can follow the installation guide on Chakra UI's website. To install Chakra UI Pro Theme, you can use yarn:

yarn add install @chakra-ui/pro-theme

Alternatively, if you prefer using npm:

npm install @chakra-ui/pro-theme

Setting up the Pro Theme

Setting up the Pro Theme is a straightforward process. The Pro Theme extends the base theme from Chakra UI and can be incorporated in a few simple steps. Import the Pro Theme and the base theme from Chakra UI:

import { theme as proTheme } from '@chakra-ui/pro-theme'
import { extendTheme, theme as baseTheme } from '@chakra-ui/react'

Next, extend the base theme with our Pro Theme:

export const theme = extendTheme(
  {
    colors: { ...baseTheme.colors, brand: baseTheme.colors.blue },
  },
  proTheme,
)

This code snippet imports the Pro Theme and the base theme from Chakra UI. It then uses the extendTheme function from Chakra UI to merge the Pro Theme with your custom configuration.

Font Configuration

Chakra UI Pro Theme uses Spline Sans as heading font family and Open Sans as body font family by default. To include this, first, you need to install the font:

yarn add @fontsource-variable/spline-sans @fontsource-variable/open-sans

Then, you can import it in your theme setup:

import '@fontsource-variable/open-sans'
import '@fontsource-variable/spline-sans'

Note: Depending on the platform/framework, the best way to install fonts may differ.

Using a Different Font

To use a different font, such as Inter, you first need to install the font:

yarn add @fontsource-variable/inter

Then, import the font and adjust the fonts key in your theme configuration:

import { theme as proTheme } from '@chakra-ui/pro-theme'
import { extendTheme, theme as baseTheme } from '@chakra-ui/react'
import '@fontsource-variable/inter'

export const theme = extendTheme(
  {
    colors: { ...baseTheme.colors, brand: baseTheme.colors.blue },
    fonts: {
      heading: "'Inter Variable', -apple-system, system-ui, sans-serif",
      body: "'Inter Variable', -apple-system, system-ui, sans-serif",
    },
  },
  proTheme,
)

Generating Theme Typings

With Chakra UI Pro Theme, you can enhance your development experience by generating theme typings. This makes the theme tokens used in the Pro Theme available to your IDE's intellisense, aiding in faster and more accurate development.

To generate the theme typings, follow these steps:

First, install the Chakra CLI as a dev dependency:

yarn add --dev @chakra-ui/cli

Next, generate the theme typings using the following command. Replace './path-to-theme.ts' with the actual path to your theme file:

yarn chakra-cli tokens ./path-to-theme.ts

Once this is completed, you may need to "Restart the TS Server" in VSCode to see the changes.

For further information about the Chakra CLI and theme typings, check out the Chakra CLI documentation.

0.9.0

1 year ago

0.6.0-beta.0

1 year ago

0.7.1

1 year ago

0.7.0

1 year ago

0.10.0

1 year ago

0.8.0

1 year ago

0.6.0

1 year ago

0.3.0

2 years ago

0.3.0-beta.0

2 years ago

0.5.0

2 years ago

0.5.0-beta.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.4.0

2 years ago

0.2.2

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.67

2 years ago

0.0.66

2 years ago

0.0.65

2 years ago

0.0.64

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.58

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.51

3 years ago

0.0.52

3 years ago

0.0.53

3 years ago

0.0.50

3 years ago

0.0.46

3 years ago

0.0.47

3 years ago

0.0.48

3 years ago

0.0.49

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.44

3 years ago

0.0.45

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.37

3 years ago

0.0.36

3 years ago

0.0.35

3 years ago

0.0.34

3 years ago

0.0.33

3 years ago

0.0.32

3 years ago

0.0.31

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago