Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nextui-org/theme

Package Overview
Dependencies
Maintainers
1
Versions
518
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextui-org/theme

The default theme for NextUI components

  • 0.0.0-canary-20240911033319
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
160K
decreased by-22.29%
Maintainers
1
Weekly downloads
 
Created

What is @nextui-org/theme?

@nextui-org/theme is a customizable theme package for the NextUI library, which provides a set of design tokens and utilities to create consistent and visually appealing user interfaces. It allows developers to easily define and apply themes across their applications.

What are @nextui-org/theme's main functionalities?

Custom Theme Creation

This feature allows developers to create custom themes by defining their own color schemes, typography, and other design tokens. The `createTheme` function is used to generate a theme object that can be applied to the application.

import { createTheme } from '@nextui-org/theme';

const myTheme = createTheme({
  type: 'dark',
  theme: {
    colors: {
      primary: '#ff4ecd',
      secondary: '#fefefe',
      background: '#000000'
    }
  }
});

Theme Provider

The `NextUIProvider` component is used to apply the custom theme to the entire application. By wrapping the application with `NextUIProvider` and passing the custom theme, all components within the application will adhere to the defined theme.

import { NextUIProvider } from '@nextui-org/react';
import { myTheme } from './myTheme';

function App() {
  return (
    <NextUIProvider theme={myTheme}>
      <YourComponent />
    </NextUIProvider>
  );
}

Using Theme Tokens

This feature allows developers to use theme tokens in their styled components. By using the `styled` function and referencing theme tokens (e.g., `$primary`, `$secondary`), developers can ensure that their components are consistent with the defined theme.

import { styled } from '@nextui-org/react';

const Button = styled('button', {
  backgroundColor: '$primary',
  color: '$secondary',
  padding: '10px 20px',
  borderRadius: '5px'
});

Other packages similar to @nextui-org/theme

Keywords

FAQs

Package last updated on 11 Sep 2024

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