Convert Figma logo to code with AI

Semantic-Org logoSemantic-UI-React

The official Semantic-UI-React integration

13,208
4,051
13,208
212

Top Related Projects

227,213

The library for web and native user interfaces.

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

Bootstrap components built with React

An enterprise-class UI design language and React UI library

A utility-first CSS framework for rapid UI development.

37,442

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

Quick Overview

Semantic-UI-React is the official React integration for Semantic UI, a popular UI framework. It provides a set of pre-built, customizable React components that follow Semantic UI's design principles, allowing developers to create responsive and visually appealing user interfaces with ease.

Pros

  • Extensive collection of ready-to-use React components
  • Seamless integration with Semantic UI's theming system
  • Fully responsive and mobile-friendly design
  • Active community and regular updates

Cons

  • Large bundle size compared to more lightweight UI libraries
  • Learning curve for developers unfamiliar with Semantic UI concepts
  • Limited customization options without modifying the core Semantic UI CSS

Code Examples

  1. Creating a basic button:
import { Button } from 'semantic-ui-react'

const MyButton = () => (
  <Button primary>Click me!</Button>
)
  1. Implementing a dropdown menu:
import { Dropdown } from 'semantic-ui-react'

const options = [
  { key: 'edit', text: 'Edit', value: 'edit' },
  { key: 'delete', text: 'Delete', value: 'delete' },
  { key: 'hide', text: 'Hide', value: 'hide' },
]

const DropdownExample = () => (
  <Dropdown
    placeholder='Select Action'
    fluid
    selection
    options={options}
  />
)
  1. Creating a responsive grid layout:
import { Grid, Image } from 'semantic-ui-react'

const GridExample = () => (
  <Grid columns={3} divided>
    <Grid.Row>
      <Grid.Column>
        <Image src='/images/image1.png' />
      </Grid.Column>
      <Grid.Column>
        <Image src='/images/image2.png' />
      </Grid.Column>
      <Grid.Column>
        <Image src='/images/image3.png' />
      </Grid.Column>
    </Grid.Row>
  </Grid>
)

Getting Started

To start using Semantic-UI-React in your project:

  1. Install the package:
npm install semantic-ui-react semantic-ui-css
  1. Import the CSS file in your main JavaScript file:
import 'semantic-ui-css/semantic.min.css'
  1. Import and use components in your React files:
import React from 'react'
import { Button, Header } from 'semantic-ui-react'

const App = () => (
  <div>
    <Header as='h1'>Welcome to My App</Header>
    <Button primary>Get Started</Button>
  </div>
)

export default App

Now you can start building your UI using Semantic-UI-React components!

Competitor Comparisons

227,213

The library for web and native user interfaces.

Pros of React

  • Larger ecosystem and community support
  • More flexible and can be used for a wider range of applications
  • Better performance for complex, dynamic UIs

Cons of React

  • Steeper learning curve for beginners
  • Requires additional libraries for full-featured UI development
  • More boilerplate code for simple applications

Code Comparison

React:

import React from 'react';

const Button = ({ onClick, children }) => (
  <button onClick={onClick}>{children}</button>
);

export default Button;

Semantic-UI-React:

import React from 'react';
import { Button } from 'semantic-ui-react';

const MyButton = ({ onClick, children }) => (
  <Button onClick={onClick}>{children}</Button>
);

export default MyButton;

The main difference is that Semantic-UI-React provides pre-styled components, while React requires custom styling or additional UI libraries. React's approach offers more flexibility but requires more work for basic UI elements. Semantic-UI-React simplifies the process of creating consistent, styled components but may be less customizable for unique designs.

Both libraries use a component-based architecture and support modern React features like hooks and functional components. The choice between them depends on project requirements, team expertise, and desired level of customization.

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

Pros of Material-UI

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples, making it easier for developers to implement
  • Stronger community support and more frequent updates

Cons of Material-UI

  • Steeper learning curve due to its extensive API and customization options
  • Larger bundle size, which may impact initial load times for applications
  • Stricter adherence to Material Design principles, potentially limiting design flexibility

Code Comparison

Material-UI:

import Button from '@mui/material/Button';

<Button variant="contained" color="primary">
  Click me
</Button>

Semantic-UI-React:

import { Button } from 'semantic-ui-react'

<Button primary>Click me</Button>

Both libraries offer similar functionality, but Material-UI provides more customization options out of the box. Semantic-UI-React has a simpler API, which can be easier for beginners to grasp quickly. However, Material-UI's extensive documentation and community support can offset its initial complexity for many developers.

Bootstrap components built with React

Pros of React Bootstrap

  • Larger community and more frequent updates
  • Closer alignment with native Bootstrap, making it easier for developers familiar with Bootstrap
  • Better TypeScript support out of the box

Cons of React Bootstrap

  • Less customizable compared to Semantic UI React
  • Fewer pre-built components and variations
  • Steeper learning curve for those not familiar with Bootstrap

Code Comparison

React Bootstrap:

import { Button } from 'react-bootstrap';

<Button variant="primary">Click me</Button>

Semantic UI React:

import { Button } from 'semantic-ui-react';

<Button primary>Click me</Button>

Both libraries offer similar component-based approaches, but Semantic UI React often provides more semantic prop names (e.g., primary instead of variant="primary"). React Bootstrap follows Bootstrap's class-based styling more closely, while Semantic UI React offers a more customizable and modular approach to styling components.

Overall, React Bootstrap is a solid choice for projects that require close alignment with Bootstrap, while Semantic UI React offers more flexibility and a wider range of pre-built components. The choice between the two often depends on project requirements, team familiarity, and desired customization level.

An enterprise-class UI design language and React UI library

Pros of Ant Design

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples, making it easier for developers to implement
  • Stronger TypeScript support and integration

Cons of Ant Design

  • Larger bundle size, which may impact initial load times
  • Less customizable out-of-the-box compared to Semantic UI React
  • Steeper learning curve due to its extensive API and features

Code Comparison

Ant Design button example:

import { Button } from 'antd';

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

Semantic UI React button example:

import { Button } from 'semantic-ui-react';

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

Both libraries offer similar basic functionality, but Ant Design provides more customization options through props, while Semantic UI React relies more on predefined styles and classes.

A utility-first CSS framework for rapid UI development.

Pros of Tailwind CSS

  • Highly customizable and flexible, allowing for rapid UI development
  • Smaller bundle size due to its utility-first approach
  • Better performance optimization with PurgeCSS integration

Cons of Tailwind CSS

  • Steeper learning curve for developers used to traditional CSS frameworks
  • Can lead to longer class names and potentially cluttered HTML
  • Less out-of-the-box styled components compared to Semantic UI React

Code Comparison

Tailwind CSS:

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

Semantic UI React:

import { Button } from 'semantic-ui-react'

<Button primary>Click me</Button>

Tailwind CSS uses utility classes to style elements directly in HTML, while Semantic UI React provides pre-styled components with semantic class names. Tailwind offers more granular control over styles, but Semantic UI React provides a more traditional component-based approach with less verbose markup.

37,442

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

Pros of Chakra UI

  • More customizable and flexible design system
  • Better accessibility features out of the box
  • Smaller bundle size and better performance

Cons of Chakra UI

  • Steeper learning curve for developers new to styled-system
  • Less pre-built components compared to Semantic UI React
  • Requires more configuration for theming and styling

Code Comparison

Chakra UI:

import { Box, Text } from "@chakra-ui/react"

<Box bg="tomato" p={4} color="white">
  <Text fontSize="xl">Hello, Chakra UI!</Text>
</Box>

Semantic UI React:

import { Segment, Header } from "semantic-ui-react"

<Segment inverted color="red">
  <Header as="h2">Hello, Semantic UI React!</Header>
</Segment>

Both libraries offer component-based approaches, but Chakra UI uses a more flexible prop-based styling system, while Semantic UI React relies on predefined classes and themes. Chakra UI's approach allows for easier customization and responsiveness, but Semantic UI React's predefined styles can lead to quicker development for standard designs.

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

Semantic UI React

Gitter Circle Codecov David npm

Installation & Usage

See the Documentation for an introduction, usage information, and examples.

Built With

  • Amazon Publishing — the full-service publisher of Amazon — APub.com
  • Netflix's Edge Developer Experience team's numerous internal apps
  • Netflix's flamescope
  • Microsoft's Teams prototyping

Example Projects

This is a listing of example projects and guides that will help you integrate Semantic UI React into your new or existing projects.

Show projects

semantic-ui-react-todos

Semantic UI React implementation of react-redux Todo List.

FAQ

Can I use custom Icons? Yes. Just use <Icon className='my-icon' /> instead of <Icon name='my-icon' />. See https://github.com/Semantic-Org/Semantic-UI-React/issues/931#issuecomment-263643210 for detailed info and examples.
How do I setup CSS?

There are several options. Refer to our doc on CSS Usage.

Can I use a custom CSS theme? Yes. Semantic UI React includes components that render valid Semantic UI HTML, no CSS is included. This allows you to load any Semantic UI CSS theme on top of your Semantic UI React app.

Here are some helpful links:

How Can I Help?

Voice Your Opinion

Help shape this library by weighing in on our RFC (request for comments) issues.

Contribute

Our CONTRIBUTING.md is a step-by-step setup and development guide.

Good First Issue

Issues labeled good first issue are a great way to ease into development on this project.

Missing Components

We're seeking component parity with Semantic UI, plus some addons. There is an issue for every missing component, labeled new component. Just comment on the issue you'd like to take.

Help Wanted Label

Any other issue labeled help wanted is ready for a PR.

Principles

  • No animation dependencies
  • Simple declarative component APIs vs brittle HTML markup
  • Complete keyboard support
  • Complete SUI component definition support
  • Completely documented
  • Completely tested
  • Accessible

Credit

Created by @levithomason and an amazing community of contributors.

Made possible only by @jlukic authoring Semantic UI.

Blazing deployments by Vercel.

NPM DownloadsLast 30 Days