npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

suomifi-ui-components

v15.0.0

Published

Suomi.fi UI component library

Downloads

1,504

Readme

suomifi-ui-components

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 (React 18 supported) 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

npm install suomifi-ui-components

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.

npm install 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 add typings for styled-components as well as react and react-dom as required by the React version used.

npm install @types/styled-components @types/react @types/react-dom

🔨 Usage

import { Button } from 'suomifi-ui-components';
<Button>Suomi.fi button</Button>;

🌊 Component variants

Components have a variant property for different versions of the component.

import { Button } from 'suomifi-ui-components';
<Button variant="secondary">This is a seconday 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 you can define styles using classNames multiple times .fi-button.button--custom.button--custom {...} for a specificity hack.

🔮 FAQ

See FAQ.md.

⌨️ Development

See DEVELOPMENT.md.

🤝 Contributing

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

Licensing

MIT LICENSE