@ultraviolet/ui
TypeScript icon, indicating that this package has built-in type declarations

1.48.1 • Public • Published

Ultraviolet UI

npm version

Ultraviolet UI is a set of React components and utilities to build fast application.

Installation

$ pnpm add @ultraviolet/ui @emotion/react @emotion/styled

You will also need to import fonts in your project by adding:

<link
  href="https://fonts.cdnfonts.com/css/inter?styles=29139,29137,29140"
  rel="stylesheet"
/>
<link
  href="https://fonts.cdnfonts.com/css/jetbrains-mono-2?styles=156604"
  rel="stylesheet"
/>
<link
  href="https://fonts.cdnfonts.com/css/space-grotesk?styles=24816,24815"
  rel="stylesheet"
/>

Usage

import { Global, ThemeProvider, css } from '@emotion/react'
import { Button, normalize, theme } from '@ultraviolet/ui'

const App = () => (
  <ThemeProvider theme={theme}>
    <Global
      styles={css`
        ${normalize()}
      `}
    />
    <Button onClick={() => console.log('clicked')}>Click Me</Button>
  </ThemeProvider>
)

N.B. To allow typescript theme typings with @emotion/styled components, you'll have to define the @emotion/react module Theme interface in your project.

Example, in a emotion.d.ts file:

  • Declaration to use the default Ultraviolet Themes
import '@emotion/react'
import type { UltravioletUITheme } from '@ultraviolet/ui'

declare module '@emotion/react' {
  export interface Theme extends UltravioletUITheme {}
}
  • Declaration to use your custom theme
import '@emotion/react'
import type { MyTheme } from './src/theme'

declare module '@emotion/react' {
  export interface Theme extends MyTheme {}
}

Documentation

Checkout our documentation website.

Contributing

📝 You can participate in the development and start contributing to it.

Readme

Keywords

Package Sidebar

Install

npm i @ultraviolet/ui

Weekly Downloads

2,830

Version

1.48.1

License

Apache-2.0

Unpacked Size

683 kB

Total Files

143

Last publish

Collaborators

  • phiphi
  • mprost
  • scaleway-bot