Sequence Design System is a reusable component library uses across the Sequence product suite.
Components are written in React with Tailwind, and its stories are written in Component Story Format.
pnpm add @0xsequence/design-system
The design system relies on these peer dependencies to be installed in your application:
pnpm add react react-dom motion
The design system requires to be used within an existing tailwind configured application. Your application should import the design system preset within your main css file. Check out the Tailwind Docs for more information on setting up your application
Import the styles at the root of your app:
@import 'tailwindcss';
@import '@0xsequence/design-system/preset';
/* Your app styles */
Then wrap your application root with the ThemeProvider:
import './index.css'
import { ThemeProvider } from '@0xsequence/design-system'
const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<React.StrictMode>
<ThemeProvider>
<App />
</ThemeProvider>
</React.StrictMode>
)
Then import components from the design system to build your UI:
import { Text, Button, useTheme } from '@0xsequence/design-system'
const App = () => (
const { theme, setTheme } = useTheme()
<div>
<Text variant="normal">Hello, World!</Text>
<Button variant="primary" label="Change theme" onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')} />
</div>
)
Clone the Sequence Design System GitHub Project then start Storybook.
pnpm install && pnpm storybook
pnpm install 0xsequence/design-system@latest
import '@0xsequence/design-system/styles.css'
pnpm install tailwindcss @tailwindcss/vite
@import 'tailwindcss';
@import '@0xsequence/design-system/preset';
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
/* ... other plugins like react() */
tailwindcss(),
],
})
V3 attemps to be mostly compatible but there are some breaking changes that will need to be addressed.
-
Form components are no longer wrapped in a Field component so properties like
labelLocation
,label
,description
are no longer on components like CheckBox, TextInput, etc. You will need to wrap these components in a Field component manually. -
RadioGroup no longer takes an options object. Instead you must use RadioGroup and RadioGroupItem components:
<RadioGroup>
<RadioGroupItem>
<RadioGroupItem>
<RadioGroupItem>
</RadioGroup>
-
Button component is now a simple component which allows you to easily create your own Buttons with children content of your choice, the Legacy Button component is renamed ButtonPreset which accepts properties like
leftIcon
,rightIcon
,label
, etc. -
Button variants have changed,
glass
is no longer the default variant, now usesecondary
. Some variants have been removed likefeature
, andemphasis
. -
Glass layers and blur effects: many of the raised popover layers like Toast, Popover, Tooltip, Select, used glass blurred effect. While this looked pretty good in certain cases, it caused issues with contrast and readability when overlayed ontop of certain user generated content and lighter content would show through too much. It was decided to switch to opaque layers instead.
-
Divider component is replaced with shadcn Separator component which supports horizontal and vertical orientation
Note: this package is not used in Storybook's UI, but the visual design is identical.