Quick Start Learn how to setup Semantic UI code Guide

Quick Start

Installation

To get started, install the package using npm:

Terminal window
npm install @semantic-ui/core

Usage

If you’re using a module bundler like webpack, Rollup, or Parcel, you can import the components and themes directly into your JavaScript files. Make sure your bundler is configured to handle CSS imports.

import '@semantic-ui/core/components/button';
import '@semantic-ui/core/themes/button.css';

Framework Integration

Semantic UI Web Components can be easily integrated into popular JavaScript frameworks.

import React from 'react';
import '@semantic-ui/core/components/button';
import '@semantic-ui/core/themes/button.css';
function MyComponent() {
return <ui-button primary>Click me</ui-button>;
}
export default MyComponent;

Theming

Semantic UI Web Components provides pre-defined themes that you can use out of the box. However, you can also customize the components by overriding their CSS variables.

It’s recommended to scope variables to :root, so they will pierce multiple shadow DOM boundaries.

:root {
--button-primary-color: var(--red);
}