All Projects → nextjs-components → nextjs-components

nextjs-components / nextjs-components

Licence: other
A collection of React components, transcribed from https://vercel.com/design.

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to nextjs-components

Braid Design System
Themeable design system for the SEEK Group
Stars: ✭ 888 (+865.22%)
Mutual labels:  css-modules, design-system
tds-community
TELUS Design System Community Components
Stars: ✭ 22 (-76.09%)
Mutual labels:  css-modules, design-system
designDoc
A lean product design process in markdown that enables cross-functional teams to take an idea from napkin to scale by prioritizing learnings to produce customer-centered solutions.
Stars: ✭ 28 (-69.57%)
Mutual labels:  design-system
fuck-design
回归本质,返璞归真!
Stars: ✭ 70 (-23.91%)
Mutual labels:  design-system
ui-kit
D2iQ UI Kit
Stars: ✭ 29 (-68.48%)
Mutual labels:  design-system
uinix-ui
A minimal framework-agnostic and configurable UI system to build UI systems. Your system your rules 🤘.
Stars: ✭ 19 (-79.35%)
Mutual labels:  design-system
ray
Resources for building interfaces with WeWork's design system
Stars: ✭ 55 (-40.22%)
Mutual labels:  design-system
nextjs-with-jest-typescript
A very simple example of Next.js-based website with Jest tests, all written in TypeScript
Stars: ✭ 70 (-23.91%)
Mutual labels:  css-modules
orfium-ictinus
This repo will include the building blocks to create the Orfium Parthenons to come ...
Stars: ✭ 20 (-78.26%)
Mutual labels:  design-system
GEL
The Design System and supporting website for Westpac GEL
Stars: ✭ 23 (-75%)
Mutual labels:  design-system
Bank-Account-Simulation
A Bank Account Simulation with JavaFX and SQLite back-end. Material UX|UI.
Stars: ✭ 19 (-79.35%)
Mutual labels:  css-modules
design-system
Nulogy Design System
Stars: ✭ 61 (-33.7%)
Mutual labels:  design-system
react-uswds
USWDS 3.0 components built in React
Stars: ✭ 108 (+17.39%)
Mutual labels:  design-system
hubble-scripts
🔭 📜 Transform Sketch config data & assets into dev-friendly formats.
Stars: ✭ 23 (-75%)
Mutual labels:  design-system
react-themeit
An easy way to theme your components using css modules and js css objects thanks to aphrodite. Also works with asynchronously loaded styles!
Stars: ✭ 28 (-69.57%)
Mutual labels:  css-modules
modular
Scaffold a react monorepo and its component parts.
Stars: ✭ 13 (-85.87%)
Mutual labels:  css-modules
template-design-system-de-l-etat
Démo du Design System de l'État (ressource non officielle)
Stars: ✭ 33 (-64.13%)
Mutual labels:  design-system
base-design-docs
A documentation site for the Base design system.
Stars: ✭ 22 (-76.09%)
Mutual labels:  design-system
big-design
Design system that powers the BigCommerce ecosystem.
Stars: ✭ 35 (-61.96%)
Mutual labels:  design-system
design-system
Strapi.io's design system 🚀
Stars: ✭ 262 (+184.78%)
Mutual labels:  design-system

nextjs-components

A collection of React components, transcribed from https://vercel.com/design. 1

npm latest package npm next package

nextjs-components

Motivation

Blog post from 01/09/2022

Todo's

  • Unit test coverage
  • Unit tests in CI (Github workflows)
  • Add every component to the docs site
  • Deploy the docs site
  • Report Bundle size
  • Figure out monorepo situation
    • Lerna? Turborepo?
    • 1 Large components-package or multiple per-component packages?
  • Move Todo's to project board

Installation

# with npm
npm i nextjs-components
# with yarn
yarn add nextjs-components

This project uses TypeScript and CSS modules. It relies on next-transpile-modules to work in a Next.js app.

yarn add next-transpile-modules

Usage

With Next.js

CodeSandbox

Hide/Show Example Code

Transpile ♻️

// next.config.js
const withTM = require("next-transpile-modules")(["nextjs-components"]);

/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  reactStrictMode: true,
};

module.exports = withTM(nextConfig);

Import Global CSS 💅

// pages/_app.tsx
import "nextjs-components/dist/styles/globals.css";

import {
  ThemeContextProvider,
  ToastsProvider,
  ToastArea,
} from "nextjs-components";

function App({ Component, pageProps }) {
  return (
    <ThemeContextProvider>
      <ToastsProvider>
        <Component {...pageProps} />
        <ToastArea />
      </ToastsProvider>
    </ThemeContextProvider>
  );
}

export default App;

Import Components 🎉

// pages/index.tsx
import {
  Button,
  Checkbox,
  Container,
  fs,
  LoadingDots,
  Spacer,
  Spinner,
  Text,
  useTheme,
  useToasts,
  IconSizeContext,
  Toggle,
} from "nextjs-components";

import { Sun, Moon } from "nextjs-components/dist/icons";

export default function IndexPage() {
  const { selectTheme, isDarkMode } = useTheme();
  const toast = useToasts();

  return (
    <Container center>
      <Container row vcenter>
        <IconSizeContext.Provider value={{ size: 18 }}>
          <Sun />
          <Spacer x={0.4} />
          <Toggle
            checked={isDarkMode}
            onChange={(checked) => {
              selectTheme(checked ? "dark" : "light");
              toast.current.message(
                `Theme has been set to ${checked ? "dark" : "light"}`
              );
            }}
          />
          <Spacer x={0.4} />
          <Moon />
        </IconSizeContext.Provider>
      </Container>
      <Text h1 noMargin>
        Hello World
      </Text>
      <Text h2 noMargin>
        Hello World
      </Text>
      <Text h3 noMargin>
        Hello World
      </Text>

      <Spacer />

      <fs.Fieldset>
        <fs.Content>
          <fs.Title>The Holland Lop Jumped over the Fence</fs.Title>
          <fs.Subtitle>The Holland Lop Jumped over the Fence</fs.Subtitle>
        </fs.Content>
        <fs.Footer>
          <fs.Footer.Status>
            The Holland lop Jumped over the Fence
            <Spacer />
          </fs.Footer.Status>
          <fs.Footer.Actions>
            <Button size="small">Action</Button>
          </fs.Footer.Actions>
        </fs.Footer>
      </fs.Fieldset>

      <Spacer />
      <Button>A button!</Button>
      <Spacer />
      <Checkbox>A checkbox</Checkbox>
      <Spacer />
      <LoadingDots size={8} />
      <Spacer />
      <Spinner />
    </Container>
  );
}

With create-react-app

CodeSandbox

Hide/Show Example Code
// index.js
import { StrictMode } from "react";
import ReactDOM from "react-dom";

import "nextjs-components/dist/styles/globals.css";

import {
  ThemeContextProvider,
  ToastsProvider,
  ToastArea,
} from "nextjs-components";

import App from "./App";

const rootElement = document.getElementById("root");
ReactDOM.render(
  <StrictMode>
    <ThemeContextProvider>
      <ToastsProvider>
        <App />
        <ToastArea />
      </ToastsProvider>
    </ThemeContextProvider>
  </StrictMode>,
  rootElement
);
// App.js
import {
  Button,
  Checkbox,
  Container,
  fs,
  LoadingDots,
  Spacer,
  Spinner,
  Text,
  useTheme,
  useToasts,
  IconSizeContext,
  Toggle,
} from "nextjs-components";

import { Sun, Moon } from "nextjs-components/dist/icons";

export default function App() {
  const { selectTheme, isDarkMode } = useTheme();
  const toast = useToasts();

  return (
    <Container center>
      <Container row vcenter>
        <IconSizeContext.Provider value={{ size: 18 }}>
          <Sun />
          <Spacer x={0.4} />
          <Toggle
            checked={isDarkMode}
            onChange={(checked) => {
              selectTheme(checked ? "dark" : "light");
              toast.current.message(
                `Theme has been set to ${checked ? "dark" : "light"}`
              );
            }}
          />
          <Spacer x={0.4} />
          <Moon />
        </IconSizeContext.Provider>
      </Container>
      <Text h1 noMargin>
        Hello World
      </Text>
      <Text h2 noMargin>
        Hello World
      </Text>
      <Text h3 noMargin>
        Hello World
      </Text>

      <Spacer />

      <fs.Fieldset>
        <fs.Content>
          <fs.Title>The Holland Lop Jumped over the Fence</fs.Title>
          <fs.Subtitle>The Holland Lop Jumped over the Fence</fs.Subtitle>
        </fs.Content>
        <fs.Footer>
          <fs.Footer.Status>
            The Holland lop Jumped over the Fence
            <Spacer />
          </fs.Footer.Status>
          <fs.Footer.Actions>
            <Button size="small">Action</Button>
          </fs.Footer.Actions>
        </fs.Footer>
      </fs.Fieldset>

      <Spacer />
      <Button>A button!</Button>
      <Spacer />
      <Checkbox>A checkbox</Checkbox>
      <Spacer />
      <LoadingDots size={8} />
      <Spacer />
      <Spinner />
    </Container>
  );
}

Footnotes

  1. This is not affiliated with Vercel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].