Giter Site home page Giter Site logo

digdir / designsystemet Goto Github PK

View Code? Open in Web Editor NEW
73.0 3.0 36.0 102.59 MB

Designsystemet

Home Page: https://designsystemet.no

License: MIT License

JavaScript 0.36% CSS 29.66% TypeScript 58.13% HTML 0.42% MDX 11.43%
components css designsystem react storybook tokens typescript

designsystemet's Introduction


Designsystemet logo

Designsystemet


๐Ÿ“– About Designsystemet

Designsystemet is a collection of important design elements, components and patterns that can be used to build public services.

Our goal is to create consistent and user-friendly experiences in digital solutions for public services, making them more efficient and reliable.


๐Ÿ”— Links

Storybook - Preview for React components.

Storefront - General documentation about the design system.

Theme - Theme builder.


๐Ÿ“ฆ Packages

@digdir/designsystemet - CLI for Designsystemet.

@digdir/designsystemet-theme - Themes for Designsystemet.

@digdir/designsystemet-css - Styling for components.

@digdir/designsystemet-react - React implementation of Designsystemet components.

Deprecated

@digdir/design-system-react โ€“ Replaced by @digdir/designsystemet-react. Contains legacy components that are no longer maintained

@digdir/design-system-tokens โ€“ Renamed to @digdir/designsystemet-theme


๐Ÿš€ Get started

Follow these steps to get started with the React components.

1. Install the packages

npm i @digdir/designsystemet-react @digdir/designsystemet-theme @digdir/designsystemet-css

Typescript

If you use Typescript, make sure you have typescript >= 3.8 as devDependencies:

npm i typescript --save-dev

2. Font

You are free to use any font-family with the components.

The components are designed and developed using the Inter font so variations might occur if a different font is used.

Add the Inter font (optional)

Add the <link> tag in <head>, and set font-family to Inter in your global css file.

The font-feature-settings adds a tail to lowercase L's.

HTML
<link
  rel="stylesheet"
  href="https://altinncdn.no/fonts/inter/inter.css"
/>
CSS
body {
  font-family: 'Inter', sans-serif;
  font-feature-settings: 'cv05' 1; /* Enable lowercase l with tail */
}

If you choose to install the font in a different way, remember to include the 400, 500 and 600 font weights.

3. Use a React component

import '@digdir/designsystemet-theme';
import '@digdir/designsystemet-css';

import { Button } from '@digdir/designsystemet-react';

<Button variant='secondary'>I am a button!</Button>;

@digdir/designsystemet-theme and @digdir/designsystemet-css only needs to be imported once.


๐Ÿซถ Contributing

Learn how you can contribute to this project by reading our Code of Conduct and Contributing Guide.


๐Ÿ’ช Contributors

We are lucky to have a great group of people who help with the design system.


๐Ÿ“ƒ License

Designsystemet is MIT licensed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.