Convert Figma logo to code with AI

nextui-org logonextui

🚀 Beautiful, fast and modern React UI library.

21,733
1,469
21,733
436

Top Related Projects

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

37,442

⚡️ Simple, Modular & Accessible UI Components for your React Applications

A utility-first CSS framework for rapid UI development.

An enterprise-class UI design language and React UI library

71,906

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

Quick Overview

NextUI is a modern, customizable, and accessible React UI library designed to create beautiful and responsive web applications. It offers a comprehensive set of pre-built components that are fully customizable and follow best practices for accessibility and performance.

Pros

  • Highly customizable with a flexible theming system
  • Excellent accessibility support out of the box
  • Modern and sleek design aesthetics
  • Comprehensive documentation and active community support

Cons

  • Relatively new compared to some other UI libraries, which may lead to fewer third-party resources
  • Learning curve for developers unfamiliar with React or modern UI libraries
  • Some advanced components may require additional configuration or customization

Code Examples

  1. Creating a simple button:
import { Button } from "@nextui-org/react";

export default function App() {
  return <Button color="primary">Click me</Button>;
}
  1. Using a modal component:
import { Modal, Button, Text } from "@nextui-org/react";

export default function App() {
  const [visible, setVisible] = React.useState(false);
  const handler = () => setVisible(true);
  const closeHandler = () => setVisible(false);

  return (
    <div>
      <Button onPress={handler}>Open modal</Button>
      <Modal closeButton aria-labelledby="modal-title" open={visible} onClose={closeHandler}>
        <Modal.Header>
          <Text id="modal-title" size={18}>
            Welcome to NextUI
          </Text>
        </Modal.Header>
        <Modal.Body>
          <Text>This is the modal content</Text>
        </Modal.Body>
        <Modal.Footer>
          <Button auto flat color="error" onPress={closeHandler}>
            Close
          </Button>
        </Modal.Footer>
      </Modal>
    </div>
  );
}
  1. Creating a responsive grid layout:
import { Grid, Card, Text } from "@nextui-org/react";

export default function App() {
  return (
    <Grid.Container gap={2} justify="center">
      <Grid xs={12} sm={4}>
        <Card>
          <Card.Body>
            <Text>Card 1</Text>
          </Card.Body>
        </Card>
      </Grid>
      <Grid xs={12} sm={4}>
        <Card>
          <Card.Body>
            <Text>Card 2</Text>
          </Card.Body>
        </Card>
      </Grid>
      <Grid xs={12} sm={4}>
        <Card>
          <Card.Body>
            <Text>Card 3</Text>
          </Card.Body>
        </Card>
      </Grid>
    </Grid.Container>
  );
}

Getting Started

To start using NextUI in your React project, follow these steps:

  1. Install NextUI and its peer dependencies:
npm install @nextui-org/react framer-motion
  1. Wrap your application with the NextUIProvider:
import { NextUIProvider } from '@nextui-org/react';

function App() {
  return (
    <NextUIProvider>
      {/* Your app content */}
    </NextUIProvider>
  );
}

export default App;
  1. Import and use NextUI components in your application:
import { Button, Input, Card } from '@nextui-org/react';

function MyComponent() {
  return (
    <Card>
      <Card.Body>
        <Input placeholder="Enter your name" />
        <Button color="primary">Submit</Button>
      </Card.Body>
    </Card>
  );
}

Competitor Comparisons

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • More mature and widely adopted, with a larger community and ecosystem
  • Extensive documentation and examples, making it easier for developers to get started
  • Offers a wider range of components and customization options

Cons of Material-UI

  • Larger bundle size, which can impact performance for smaller projects
  • Steeper learning curve due to its extensive API and customization options
  • Stricter adherence to Material Design guidelines, which may limit design flexibility

Code Comparison

Material-UI:

import { Button, TextField } from '@mui/material';

<Button variant="contained" color="primary">
  Click me
</Button>
<TextField label="Enter text" variant="outlined" />

NextUI:

import { Button, Input } from '@nextui-org/react';

<Button color="primary">Click me</Button>
<Input placeholder="Enter text" />

Both libraries offer similar component APIs, but NextUI's syntax is generally more concise. Material-UI provides more built-in variants and customization options out of the box, while NextUI focuses on simplicity and modern design trends.

37,442

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Pros of Chakra UI

  • More extensive component library with a wider range of pre-built components
  • Better documentation and community support due to its longer presence in the market
  • Highly customizable with a robust theming system

Cons of Chakra UI

  • Steeper learning curve, especially for beginners
  • Larger bundle size, which may impact initial load times
  • Less focus on modern, trendy designs compared to NextUI

Code Comparison

Chakra UI button example:

import { Button } from "@chakra-ui/react"

function MyComponent() {
  return <Button colorScheme="blue">Click me</Button>
}

NextUI button example:

import { Button } from "@nextui-org/react"

function MyComponent() {
  return <Button color="primary">Click me</Button>
}

Both libraries offer similar component APIs, but Chakra UI tends to use more descriptive prop names (e.g., colorScheme instead of color). NextUI's syntax is often more concise, which can lead to cleaner code in some cases. However, Chakra UI's verbosity can make it easier for newcomers to understand the component's capabilities at a glance.

A utility-first CSS framework for rapid UI development.

Pros of Tailwind CSS

  • Highly customizable with a utility-first approach
  • Extensive documentation and large community support
  • Smaller bundle size when properly configured

Cons of Tailwind CSS

  • Steeper learning curve for developers new to utility-first CSS
  • Can lead to verbose class names in HTML

Code Comparison

NextUI:

<Button color="primary" auto>
  Button
</Button>

Tailwind CSS:

<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
  Button
</button>

NextUI provides pre-built components with a more concise API, while Tailwind CSS requires composing utility classes to achieve the same result. Tailwind offers more granular control over styles, but NextUI simplifies component creation with its ready-to-use elements.

Both libraries have their strengths: NextUI excels in rapid prototyping and consistent design implementation, while Tailwind CSS shines in flexibility and customization. The choice between them depends on project requirements, team preferences, and development speed priorities.

An enterprise-class UI design language and React UI library

Pros of Ant Design

  • More mature and widely adopted, with a larger community and ecosystem
  • Extensive component library with a wide range of UI elements
  • Comprehensive documentation and design resources

Cons of Ant Design

  • Heavier bundle size due to its extensive feature set
  • Less flexible customization options compared to NextUI's modern approach
  • Steeper learning curve for developers new to the library

Code Comparison

Ant Design button example:

import { Button } from 'antd';

const MyComponent = () => (
  <Button type="primary">Click me</Button>
);

NextUI button example:

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

const MyComponent = () => (
  <Button color="primary">Click me</Button>
);

Both libraries offer similar basic usage, but NextUI's API tends to be more modern and streamlined. Ant Design provides more configuration options out of the box, while NextUI focuses on simplicity and customization through CSS-in-JS.

NextUI is built with a focus on modern web technologies and offers a more lightweight alternative to Ant Design. It provides a fresh, customizable UI kit that's easy to integrate with React projects. However, it may lack some of the more specialized components found in Ant Design's extensive library.

Ultimately, the choice between these libraries depends on project requirements, team familiarity, and desired aesthetic. Ant Design is better suited for large-scale enterprise applications, while NextUI shines in projects prioritizing modern design and flexibility.

71,906

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

Pros of shadcn/ui

  • Highly customizable and flexible components
  • Follows a copy-paste approach, allowing developers to have full control over the code
  • Utilizes modern technologies like Radix UI and Tailwind CSS

Cons of shadcn/ui

  • Less out-of-the-box styling compared to NextUI
  • Requires more manual setup and configuration
  • Steeper learning curve for developers new to Radix UI or Tailwind CSS

Code Comparison

NextUI example:

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

export default function App() {
  return <Button>Click me</Button>;
}

shadcn/ui example:

import { Button } from '@/components/ui/button';

export default function App() {
  return <Button>Click me</Button>;
}

Both libraries offer similar usage patterns for basic components. However, shadcn/ui typically requires more customization and setup in the project's configuration files.

NextUI provides a more comprehensive set of pre-styled components, while shadcn/ui offers greater flexibility and control over the underlying code. The choice between the two depends on the project's requirements, the development team's preferences, and the desired level of customization.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

nextui

NextUI


License codecov badge npm downloads

NOTE: This is a community project, not associated with Vercel.

Getting Started

Visit https://nextui.org/guide to get started with NextUI.

Documentation

Visit https://nextui.org/docs to view the full documentation.

Storybook

Visit https://storybook.nextui.org to view the storybook for all components.

Canary Release

Canary versions are available after every merge into canary branch. You can install the packages with the tag canary in npm to use the latest changes before the next production release.

Community

We're excited to see the community adopt NextUI, raise issues, and provide feedback. Whether it's a feature request, bug report, or a project to showcase, please get involved!

Contributing

Contributions are always welcome!

See CONTRIBUTING.md for ways to get started.

Please adhere to this project's CODE_OF_CONDUCT.

License

MIT

NPM DownloadsLast 30 Days