Giter Site home page Giter Site logo

riippi / suomifi-ui-components Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vrk-kpa/suomifi-ui-components

0.0 0.0 0.0 83.2 MB

Suomi.fi-styleguide in React components

License: Other

JavaScript 2.54% TypeScript 97.38% SCSS 0.01% Shell 0.06% CSS 0.01%

suomifi-ui-components's Introduction

npm NPM WCAG PRs Welcome

Suomi.fi-styleguide in React components. Living styleguide (latest release/master-branch).

โœจ Features

  • Accessibility WCAG 2.1 level AA
  • React-components with TypeScript support
  • Suomi.fi brand styles
  • Highly customizable (CSS, CSS-in-JS)

Works with React >= 16.8.0 and Styled Components >= 5.2.1. Supports TypeScript. CJS and ESM builds provided via the npm package.

Supported browser and screenreader combinations

Operating system Browsers Screen reader
macOS Safari, Chrome, Edge VoiceOver
Windows Chrome, Firefox, Edge NVDA
iOS Safari VoiceOver
Android Chrome TalkBack

๐Ÿ“ฆ Install

To install the component library itself

yarn add suomifi-ui-components

Include required styles from dist/main.css as best suited for your project. You can, for example, import the stylesheet to your app and let your bundler handle it:

import 'suomifi-ui-components/dist/main.css';

This stylesheet contains part of the global styles for the library as well as Reach UI peer dependency styles.

Include required fonts as best suited for your project. You can, for example, use the following import with your global css.

@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600&display=swap');

The following fonts and variants are required: Font-family: 'Source Sans Pro', Font-weight: 300, 400, 600

Peer dependencies

You should also install the following peer dependencies.

  • React version >=16.8.0 and related dependencies and typings.

  • styled-components version >=5.2.1 and related dependencies and typings.

  • The aim is to keep dependencies up to date and use the latest available versions. We encourage you to use the latest available versions of peer dependencies.

yarn add styled-components
  • If using TypeScript, version 3.8 or above is required.

  • In case TypeScript is used and skipLibCheck compiler option is set to false, also typings for react, react-dom, styled-components and warning are required.

yarn add @types/styled-components @types/warning

๐Ÿ”จ Usage

import { Button } from 'suomifi-ui-components';
ReactDOM.render(<Button />, mountNode);

๐ŸŒŠ Component variants

Components have variant-property for different versions of the current component.

import { Button } from 'suomifi-ui-components';
<Button variant="secondary">This is a secondary button</Button>;

โ›ฑ Extending styles

Components' styles can be customized with Styled Components:

styled(Button)...

or using CSS-ClassName:

<Button className="button--custom">Example</Button>
.fi-button.button--custom {
  ...;
}

Don't use !important, if really really needed - for specificity hack you can define styles using classNames multiple times .fi-button.button--custom.button--custom {...}

๐Ÿ”ฎ FAQ

See FAQ.md.

โŒจ๏ธ Development

See DEVELOPMENT.md.

๐Ÿค Contributing

We welcome all contributions. Please read our CONTRIBUTING.md first.

Licensing

MIT LICENSE

suomifi-ui-components's People

Contributors

j-kallunki avatar ketsappi avatar aappoalander avatar ljkaski avatar valger11 avatar riitasointi avatar riippi avatar dependabot[bot] avatar dependabot-preview[bot] avatar jporola avatar jukkah avatar sepporanninranta avatar jteuho avatar

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.